Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#69 re-introduced PHPStan static analysis #95

Merged
merged 26 commits into from
Aug 21, 2018
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c4c4826
re-enable phpstan
bendavies May 26, 2018
6c4f2b4
fix need for phpstan ignore
bendavies May 26, 2018
c8a711d
remove fix to wait for upstream fix
bendavies May 27, 2018
ebd1db8
upgrade to phpstan/phpstan-shim 0.10.2
bendavies Jul 23, 2018
43f4664
#69 switching to regular phpstan for everything - simpler, no weird …
Ocramius Aug 21, 2018
fa0a247
#69 removing `%currentWorkingDirectory%` from phpstan config - we wa…
Ocramius Aug 21, 2018
212ec81
#69 included PHPStan `beberlei/assert` integrations
Ocramius Aug 21, 2018
642ee7d
#69 making sure that the `cwd()` was correctly read
Ocramius Aug 21, 2018
3fc37ff
#69 hardening assumptions around `realpath()` and `cwd()` calls in c…
Ocramius Aug 21, 2018
7b3270d
#69 ensuring that located sources contents can be read
Ocramius Aug 21, 2018
0cd734f
#69 ensuring that `reset()` produces at least one valid value
Ocramius Aug 21, 2018
b9d759f
#69 ensuring that `realpath()` points to a valid location
Ocramius Aug 21, 2018
73869d0
#69 the `CompareClassesTest` always has the `$stringReflectorFactory…
Ocramius Aug 21, 2018
eb431ae
#69 corrected type hint on `OpenClassChangedTest` properties
Ocramius Aug 21, 2018
bc3268c
#69 corrected return type of data provider - phpcs drops unused impo…
Ocramius Aug 21, 2018
7bb341f
#69 corrected type declarations for class-constant-based tests
Ocramius Aug 21, 2018
9c0b151
#69 corrected return type of data provider - phpcs drops unused impo…
Ocramius Aug 21, 2018
2b7e204
#69 corrected return type of data provider - phpcs drops unused impo…
Ocramius Aug 21, 2018
69a5ef1
#69 corrected return type of data provider - phpcs drops unused impo…
Ocramius Aug 21, 2018
b42ca47
#69 corrected test class namespace
Ocramius Aug 21, 2018
fea058c
#69 ensuring that `realpath()` can retrieve a `string`
Ocramius Aug 21, 2018
e826b29
#69 removed `callable` mocking, removed redundant `realpath()` calls…
Ocramius Aug 21, 2018
1e68525
#69 added PHPStan PHPUnit integration
Ocramius Aug 21, 2018
3df1802
#69 added `realpath()` replacement that behaves a bit better than `r…
Ocramius Aug 21, 2018
4a05e71
#69 ensure that no deprecated API from nikolaposa/version is in use
Ocramius Aug 21, 2018
0ba91b2
#69 removed unused imports
Ocramius Aug 21, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#69 ensuring that located sources contents can be read
  • Loading branch information
Ocramius committed Aug 21, 2018
commit 7b3270d8832674144b503373c97c7ce7345cda67
6 changes: 5 additions & 1 deletion src/SourceLocator/StaticClassMapSourceLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ protected function createLocatedSource(Identifier $identifier) : ?LocatedSource
return null;
}

return new LocatedSource(file_get_contents($classFile), $classFile);
$fileContents = file_get_contents($classFile);

Assert::that($fileContents)->string();

return new LocatedSource($fileContents, $classFile);
}
}