Skip to content
Permalink
Browse files

Apply PHPCS fixes

Fixes #1880
  • Loading branch information...
muglug committed Jul 5, 2019
1 parent fe79758 commit da42be175f0e8ed7e30b24884df617a953ea2df0
Showing with 1,765 additions and 1,659 deletions.
  1. +2 −1 composer.json
  2. +10 −10 src/Psalm/CodeLocation.php
  3. +0 −2 src/Psalm/CodeLocation/DocblockTypeLocation.php
  4. +1 −1 src/Psalm/CodeLocation/ParseErrorLocation.php
  5. +1 −2 src/Psalm/CodeLocation/Raw.php
  6. +24 −19 src/Psalm/Codebase.php
  7. +53 −48 src/Psalm/Config.php
  8. +12 −13 src/Psalm/Config/Creator.php
  9. +1 −1 src/Psalm/Config/ErrorLevelFileFilter.php
  10. +21 −20 src/Psalm/Config/FileFilter.php
  11. +5 −5 src/Psalm/Config/IssueHandler.php
  12. +1 −1 src/Psalm/Config/ProjectFileFilter.php
  13. +9 −10 src/Psalm/Context.php
  14. +16 −15 src/Psalm/DocComment.php
  15. +24 −16 src/Psalm/ErrorBaseline.php
  16. +3 −1 src/Psalm/FileBasedPluginAdapter.php
  17. +1 −1 src/Psalm/FileManipulation.php
  18. +8 −9 src/Psalm/Internal/Clause.php
  19. +43 −44 src/Psalm/Internal/Codebase/Analyzer.php
  20. +5 −5 src/Psalm/Internal/Codebase/CallMap.php
  21. +26 −26 src/Psalm/Internal/Codebase/ClassLikes.php
  22. +8 −10 src/Psalm/Internal/Codebase/Functions.php
  23. +12 −15 src/Psalm/Internal/Codebase/Methods.php
  24. +10 −10 src/Psalm/Internal/Codebase/Populator.php
  25. +9 −9 src/Psalm/Internal/Codebase/Properties.php
  26. +2 −3 src/Psalm/Internal/Codebase/Reflection.php
  27. +21 −17 src/Psalm/Internal/Codebase/Scanner.php
  28. +23 −20 src/Psalm/Internal/Diff/AstDiffer.php
  29. +5 −6 src/Psalm/Internal/Diff/ClassStatementsDiffer.php
  30. +2 −2 src/Psalm/Internal/Diff/DiffElem.php
  31. +41 −37 src/Psalm/Internal/Diff/FileDiffer.php
  32. +3 −4 src/Psalm/Internal/Diff/FileStatementsDiffer.php
  33. +3 −4 src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php
  34. +0 −1 src/Psalm/Internal/ExecutionEnvironment/BuildInfoCollector.php
  35. +6 −7 src/Psalm/Internal/ExecutionEnvironment/GitInfoCollector.php
  36. +0 −1 src/Psalm/Internal/ExecutionEnvironment/SystemCommandExecutor.php
  37. +0 −1 src/Psalm/Internal/FileManipulation/CodeMigration.php
  38. +2 −3 src/Psalm/Internal/FileManipulation/FileManipulationBuffer.php
  39. +9 −9 src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php
  40. +35 −36 src/Psalm/Internal/Fork/Pool.php
  41. +7 −3 src/Psalm/Internal/Fork/PsalmRestarter.php
  42. +8 −5 src/Psalm/Internal/LanguageServer/Client/TextDocument.php
  43. +4 −2 src/Psalm/Internal/LanguageServer/ClientHandler.php
  44. +2 −3 src/Psalm/Internal/LanguageServer/EmitterInterface.php
  45. +7 −6 src/Psalm/Internal/LanguageServer/EmitterTrait.php
  46. +0 −1 src/Psalm/Internal/LanguageServer/IdGenerator.php
  47. +0 −1 src/Psalm/Internal/LanguageServer/LanguageClient.php
  48. +31 −26 src/Psalm/Internal/LanguageServer/LanguageServer.php
  49. +4 −2 src/Psalm/Internal/LanguageServer/Message.php
  50. +0 −2 src/Psalm/Internal/LanguageServer/ProtocolReader.php
  51. +8 −5 src/Psalm/Internal/LanguageServer/ProtocolStreamReader.php
  52. +0 −1 src/Psalm/Internal/LanguageServer/ProtocolStreamWriter.php
  53. +1 −2 src/Psalm/Internal/LanguageServer/ProtocolWriter.php
  54. +23 −35 src/Psalm/Internal/LanguageServer/Server/TextDocument.php
  55. +9 −5 src/Psalm/Internal/PluginManager/Command/DisableCommand.php
  56. +9 −5 src/Psalm/Internal/PluginManager/Command/EnableCommand.php
  57. +8 −9 src/Psalm/Internal/PluginManager/Command/ShowCommand.php
  58. +10 −8 src/Psalm/Internal/PluginManager/ComposerLock.php
  59. +4 −3 src/Psalm/Internal/PluginManager/ConfigFile.php
  60. +7 −5 src/Psalm/Internal/PluginManager/PluginList.php
  61. +5 −5 src/Psalm/Internal/PluginManager/PluginListFactory.php
  62. +12 −12 src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php
  63. +6 −4 src/Psalm/Internal/Provider/ClassLikeStorageProvider.php
  64. +3 −4 src/Psalm/Internal/Provider/FileProvider.php
  65. +11 −5 src/Psalm/Internal/Provider/FileReferenceCacheProvider.php
  66. +11 −5 src/Psalm/Internal/Provider/FileReferenceProvider.php
  67. +12 −12 src/Psalm/Internal/Provider/FileStorageCacheProvider.php
  68. +2 −1 src/Psalm/Internal/Provider/FileStorageProvider.php
  69. +6 −4 src/Psalm/Internal/Provider/FunctionExistenceProvider.php
  70. +7 −5 src/Psalm/Internal/Provider/FunctionParamsProvider.php
  71. +8 −6 src/Psalm/Internal/Provider/FunctionReturnTypeProvider.php
  72. +6 −4 src/Psalm/Internal/Provider/MethodExistenceProvider.php
  73. +7 −5 src/Psalm/Internal/Provider/MethodParamsProvider.php
  74. +8 −6 src/Psalm/Internal/Provider/MethodReturnTypeProvider.php
  75. +7 −5 src/Psalm/Internal/Provider/MethodVisibilityProvider.php
  76. +19 −16 src/Psalm/Internal/Provider/ParserCacheProvider.php
  77. +7 −5 src/Psalm/Internal/Provider/PropertyExistenceProvider.php
  78. +7 −5 src/Psalm/Internal/Provider/PropertyTypeProvider.php
  79. +7 −5 src/Psalm/Internal/Provider/PropertyVisibilityProvider.php
  80. +6 −7 src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayColumnReturnTypeProvider.php
  81. +7 −8 src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFilterReturnTypeProvider.php
  82. +6 −7 src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMapReturnTypeProvider.php
  83. +5 −6 src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMergeReturnTypeProvider.php
  84. +1 −2 src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayPointerAdjustmentReturnTypeProvider.php
  85. +1 −2 src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayPopReturnTypeProvider.php
  86. +1 −2 src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayRandReturnTypeProvider.php
  87. +20 −18 src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReduceReturnTypeProvider.php
  88. +1 −2 src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReverseReturnTypeProvider.php
  89. +1 −2 src/Psalm/Internal/Provider/ReturnTypeProvider/ArraySliceReturnTypeProvider.php
  90. +1 −1 src/Psalm/Internal/Provider/ReturnTypeProvider/DomNodeAppendChild.php
  91. +1 −2 src/Psalm/Internal/Provider/ReturnTypeProvider/FilterVarReturnTypeProvider.php
  92. +3 −4 src/Psalm/Internal/Provider/ReturnTypeProvider/FirstArgStringReturnTypeProvider.php
  93. +3 −4 src/Psalm/Internal/Provider/ReturnTypeProvider/GetClassMethodsReturnTypeProvider.php
  94. +3 −4 src/Psalm/Internal/Provider/ReturnTypeProvider/GetObjectVarsReturnTypeProvider.php
  95. +7 −8 src/Psalm/Internal/Provider/ReturnTypeProvider/IteratorToArrayReturnTypeProvider.php
  96. +3 −4 src/Psalm/Internal/Provider/ReturnTypeProvider/MktimeReturnTypeProvider.php
  97. +16 −17 src/Psalm/Internal/Provider/ReturnTypeProvider/ParseUrlReturnTypeProvider.php
  98. +2 −2 src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementSetFetchMode.php
  99. +4 −5 src/Psalm/Internal/Provider/ReturnTypeProvider/RangeReturnTypeProvider.php
  100. +2 −2 src/Psalm/Internal/Provider/ReturnTypeProvider/SimpleXmlElementAsXml.php
  101. +4 −5 src/Psalm/Internal/Provider/ReturnTypeProvider/StrReplaceReturnTypeProvider.php
  102. +6 −7 src/Psalm/Internal/Provider/ReturnTypeProvider/VersionCompareReturnTypeProvider.php
  103. +16 −10 src/Psalm/Internal/Provider/StatementsProvider.php
  104. +1 −1 src/Psalm/Internal/Scope/SwitchScope.php
  105. +24 −9 src/Psalm/Internal/Stubs/Amp.php
  106. +68 −17 src/Psalm/Internal/Stubs/CoreGenericFunctions.php
  107. +7 −7 src/Psalm/Internal/Traverser/CustomTraverser.php
  108. +4 −4 src/Psalm/Internal/Type/ParseTree.php
  109. +0 −1 src/Psalm/Internal/Type/ParseTree/MethodParamTree.php
  110. +19 −16 src/Psalm/Internal/Type/TypeCombination.php
  111. +4 −3 src/Psalm/Internal/Visitor/CloningVisitor.php
  112. +18 −17 src/Psalm/Internal/Visitor/PartialParserVisitor.php
  113. +43 −41 src/Psalm/Internal/Visitor/ReflectorVisitor.php
  114. +26 −10 src/Psalm/Internal/Visitor/SimpleNameResolver.php
  115. +21 −18 src/Psalm/IssueBuffer.php
  116. +1 −0 src/Psalm/Plugin/Hook/AfterAnalysisInterface.php
  117. +1 −1 src/Psalm/Plugin/Hook/AfterClassLikeExistenceCheckInterface.php
  118. +1 −0 src/Psalm/Plugin/Hook/AfterCodebasePopulatedInterface.php
  119. +1 −1 src/Psalm/Plugin/Hook/FunctionExistenceProviderInterface.php
  120. +1 −1 src/Psalm/Plugin/Hook/FunctionParamsProviderInterface.php
  121. +2 −2 src/Psalm/Plugin/Hook/FunctionReturnTypeProviderInterface.php
  122. +0 −1 src/Psalm/Plugin/Hook/MethodExistenceProviderInterface.php
  123. +1 −1 src/Psalm/Plugin/Hook/MethodParamsProviderInterface.php
  124. +2 −2 src/Psalm/Plugin/Hook/MethodReturnTypeProviderInterface.php
  125. +0 −1 src/Psalm/Plugin/Hook/MethodVisibilityProviderInterface.php
  126. +0 −1 src/Psalm/Plugin/Hook/PropertyExistenceProviderInterface.php
  127. +2 −2 src/Psalm/Plugin/Hook/PropertyTypeProviderInterface.php
  128. +0 −1 src/Psalm/Plugin/Hook/PropertyVisibilityProviderInterface.php
  129. +2 −1 src/Psalm/Plugin/Hook/StringInterpreterInterface.php
  130. +0 −1 src/Psalm/Plugin/PluginEntryPointInterface.php
  131. +18 −16 src/Psalm/Plugin/Shepherd.php
  132. +1 −1 src/Psalm/Progress/DebugProgress.php
  133. +5 −3 src/Psalm/Progress/DefaultProgress.php
  134. +2 −1 src/Psalm/Progress/LongProgress.php
  135. +2 −2 src/Psalm/Progress/Progress.php
  136. +2 −3 src/Psalm/Report/CheckstyleReport.php
  137. +9 −9 src/Psalm/Report/CompactReport.php
  138. +1 −1 src/Psalm/Report/ConsoleReport.php
  139. +1 −1 src/Psalm/Report/EmacsReport.php
  140. +2 −2 src/Psalm/Report/JsonReport.php
  141. +4 −4 src/Psalm/Report/JsonSummaryReport.php
  142. +1 −1 src/Psalm/Report/PylintReport.php
  143. +3 −3 src/Psalm/Report/SonarqubeReport.php
  144. +1 −1 src/Psalm/Report/TextReport.php
  145. +1 −1 src/Psalm/Report/XmlReport.php
  146. +6 −1 src/Psalm/SourceControl/Git/CommitInfo.php
  147. +0 −1 src/Psalm/SourceControl/Git/GitInfo.php
  148. +0 −1 src/Psalm/SourceControl/Git/RemoteInfo.php
  149. +0 −1 src/Psalm/SourceControl/SourceControlInfo.php
  150. +3 −4 src/Psalm/Storage/FunctionLikeStorage.php
  151. +0 −2 src/Psalm/Storage/MethodStorage.php
  152. +1 −1 src/Psalm/Storage/PropertyStorage.php
  153. +33 −30 src/Psalm/Type.php
  154. +14 −13 src/Psalm/Type/Algebra.php
  155. +27 −23 src/Psalm/Type/Atomic.php
  156. +3 −3 src/Psalm/Type/Atomic/CallableTrait.php
  157. +2 −2 src/Psalm/Type/Atomic/GenericTrait.php
  158. +1 −1 src/Psalm/Type/Atomic/GetClassT.php
  159. +0 −1 src/Psalm/Type/Atomic/HasClassString.php
  160. +4 −3 src/Psalm/Type/Atomic/HasIntersectionTrait.php
  161. +7 −7 src/Psalm/Type/Atomic/ObjectLike.php
  162. +2 −2 src/Psalm/Type/Atomic/TArray.php
  163. +3 −3 src/Psalm/Type/Atomic/TClassString.php
  164. +2 −2 src/Psalm/Type/Atomic/TGenericObject.php
  165. +2 −2 src/Psalm/Type/Atomic/TIterable.php
  166. +2 −2 src/Psalm/Type/Atomic/TKeyOfClassConstant.php
  167. +2 −2 src/Psalm/Type/Atomic/TLiteralClassString.php
  168. +1 −0 src/Psalm/Type/Atomic/TLiteralString.php
  169. +1 −2 src/Psalm/Type/Atomic/TNamedObject.php
  170. +4 −4 src/Psalm/Type/Atomic/TObjectWithProperties.php
  171. +2 −2 src/Psalm/Type/Atomic/TTemplateParam.php
  172. +35 −30 src/Psalm/Type/Reconciler.php
  173. +37 −40 src/Psalm/Type/Union.php
  174. +1 −0 src/command_functions.php
  175. +10 −8 src/psalm-language-server.php
  176. +1 −2 src/psalm_plugin.php
  177. +5 −5 tests/AnnotationTest.php
  178. +4 −4 tests/ArrayAccessTest.php
  179. +1 −1 tests/AssertTest.php
  180. +0 −5 tests/BadFormatTest.php
  181. +4 −4 tests/CallableTest.php
  182. +5 −7 tests/ClassStringTest.php
  183. +4 −4 tests/ClassTest.php
  184. +2 −2 tests/CodebaseTest.php
  185. +8 −8 tests/ComposerLockTest.php
  186. +6 −6 tests/Config/ConfigFileTest.php
  187. +18 −28 tests/Config/ConfigTest.php
  188. +2 −2 tests/Config/CreatorTest.php
  189. +2 −1 tests/Config/Plugin/Hook/StringProvider/TSqlSelectString.php
  190. +9 −19 tests/Config/PluginTest.php
  191. +1 −1 tests/DeprecatedAnnotationTest.php
  192. +11 −11 tests/DocumentationTest.php
  193. +16 −17 tests/EndToEnd/PsalmEndToEndTest.php
  194. +1 −1 tests/ErrorBaselineTest.php
  195. +3 −3 tests/FileDiffTest.php
  196. +2 −2 tests/FileManipulation/ClassConstantMoveTest.php
  197. +11 −11 tests/FileManipulation/ClassMoveTest.php
  198. +10 −10 tests/FileManipulation/MethodMoveTest.php
  199. +1 −1 tests/FileManipulation/NamespaceMoveTest.php
  200. +0 −4 tests/FileManipulation/ParamTypeManipulationTest.php
  201. +4 −4 tests/FileManipulation/PropertyMoveTest.php
  202. +2 −6 tests/FileManipulation/ReturnTypeManipulationTest.php
  203. +0 −3 tests/FileManipulation/UndefinedVariableManipulationTest.php
  204. +0 −4 tests/FileManipulation/UnusedCodeManipulationTest.php
  205. +6 −6 tests/FileReferenceTest.php
  206. +3 −3 tests/FileUpdates/AnalyzedMethodTest.php
  207. +3 −3 tests/FileUpdates/CachedStorageTest.php
  208. +5 −5 tests/FileUpdates/ErrorAfterUpdateTest.php
  209. +5 −5 tests/FileUpdates/ErrorFixTest.php
  210. +7 −7 tests/FileUpdates/TemporaryUpdateTest.php
  211. +10 −10 tests/FunctionCallTest.php
  212. +3 −3 tests/IncludeTest.php
  213. +4 −4 tests/InterfaceTest.php
  214. +1 −1 tests/Internal/Provider/FakeFileProvider.php
  215. +1 −1 tests/Internal/Provider/ParserInstanceCacheProvider.php
  216. +1 −1 tests/InternalAnnotationTest.php
  217. +1 −1 tests/IssueSuppressionTest.php
  218. +6 −6 tests/LanguageServer/CompletionTest.php
  219. +1 −1 tests/Loop/DoTest.php
  220. +1 −1 tests/Loop/ForTest.php
  221. +1 −1 tests/Loop/ForeachTest.php
  222. +3 −4 tests/MagicMethodAnnotationTest.php
  223. +2 −2 tests/MethodCallTest.php
  224. +3 −3 tests/MethodSignatureTest.php
  225. +1 −1 tests/Php56Test.php
  226. +9 −10 tests/ProjectCheckerTest.php
  227. +25 −26 tests/PropertyTypeTest.php
  228. +0 −1 tests/PsalmInternalAnnotationTest.php
  229. +1 −1 tests/PsalmPluginTest.php
  230. +3 −3 tests/RedundantConditionTest.php
  231. +6 −8 tests/ReportOutputTest.php
  232. +1 −1 tests/ReturnTypeTest.php
  233. +4 −8 tests/StubTest.php
  234. +14 −14 tests/Template/ClassTemplateExtendsTest.php
  235. +12 −12 tests/Template/ClassTemplateTest.php
  236. +10 −10 tests/Template/FunctionClassStringTemplateTest.php
  237. +7 −7 tests/Template/FunctionTemplateTest.php
  238. +5 −5 tests/TestCase.php
  239. +2 −2 tests/TestConfig.php
  240. +0 −4 tests/ThrowsAnnotationTest.php
  241. +1 −1 tests/TraitTest.php
  242. +4 −4 tests/Traits/InvalidCodeAnalysisTestTrait.php
  243. +4 −4 tests/Traits/ValidCodeAnalysisTestTrait.php
  244. +1 −4 tests/TryCatchTest.php
  245. +2 −2 tests/TypeAlgebraTest.php
  246. +1 −1 tests/TypeCombinationTest.php
  247. +3 −23 tests/TypeParseTest.php
  248. +7 −7 tests/TypeReconciliationTest.php
  249. +3 −3 tests/UnusedCodeTest.php
  250. +3 −3 tests/UnusedVariableTest.php
  251. +5 −5 tests/ValueTest.php
  252. +3 −2 tests/fixtures/DummyProjectWithErrors/src/FileWithErrors.php
  253. +3 −2 tests/fixtures/config_discovery/files_in_lib/lib/Baz.php
  254. +0 −1 tests/fixtures/performance/diff_parse_large_file.php
  255. +0 −1 tests/fixtures/stubs/class_alias.php
  256. +48 −17 tests/fixtures/stubs/conditional_interface.php
  257. +0 −1 tests/fixtures/stubs/polyfill.php
@@ -52,7 +52,8 @@
"psalm/plugin-phpunit": "^0.6",
"phpmyadmin/sql-parser": "^5.0",
"symfony/process": "^4.3",
"slevomat/coding-standard": "^5.0"
"slevomat/coding-standard": "^5.0",
"friendsofphp/php-cs-fixer": "^2.15"
},
"suggest": {
"ext-igbinary": "^2.0.5"
@@ -1,22 +1,22 @@
<?php
namespace Psalm;
use function explode;
use function max;
use function min;
use PhpParser;
use function preg_match;
use const PREG_OFFSET_CAPTURE;
use function preg_quote;
use function preg_replace;
use Psalm\Internal\Analyzer\CommentAnalyzer;
use function str_replace;
use function strlen;
use function strpos;
use function explode;
use function substr;
use function trim;
use function preg_replace;
use function str_replace;
use function preg_quote;
use function preg_match;
use const PREG_OFFSET_CAPTURE;
use function strrpos;
use function min;
use function max;
use function substr;
use function substr_count;
use function trim;
class CodeLocation
{
@@ -1,8 +1,6 @@
<?php
namespace Psalm\CodeLocation;
use PhpParser;
class DocblockTypeLocation extends \Psalm\CodeLocation
{
/** @var int */
@@ -2,8 +2,8 @@
namespace Psalm\CodeLocation;
use PhpParser;
use function substr_count;
use function substr;
use function substr_count;
class ParseErrorLocation extends \Psalm\CodeLocation
{
@@ -1,9 +1,8 @@
<?php
namespace Psalm\CodeLocation;
use PhpParser;
use function substr_count;
use function substr;
use function substr_count;
class Raw extends \Psalm\CodeLocation
{
@@ -1,10 +1,23 @@
<?php
namespace Psalm;
use LanguageServerProtocol\{Position, Range, Command};
use function array_combine;
use function array_merge;
use function count;
use function error_log;
use function explode;
use function in_array;
use function krsort;
use function ksort;
use LanguageServerProtocol\Command;
use LanguageServerProtocol\Position;
use LanguageServerProtocol\Range;
use const PHP_MAJOR_VERSION;
use const PHP_MINOR_VERSION;
use PhpParser;
use Psalm\Internal\Analyzer\Statements\Block\ForeachAnalyzer;
use function preg_match;
use Psalm\Internal\Analyzer\ProjectAnalyzer;
use Psalm\Internal\Analyzer\Statements\Block\ForeachAnalyzer;
use Psalm\Internal\Analyzer\TypeAnalyzer;
use Psalm\Internal\Provider\ClassLikeStorageProvider;
use Psalm\Internal\Provider\FileProvider;
@@ -17,24 +30,12 @@
use Psalm\Storage\ClassLikeStorage;
use Psalm\Storage\FileStorage;
use Psalm\Storage\FunctionLikeStorage;
use const PHP_MAJOR_VERSION;
use const PHP_MINOR_VERSION;
use function in_array;
use function array_combine;
use function strlen;
use function strpos;
use function strrpos;
use function strtolower;
use function explode;
use function array_merge;
use function substr;
use function error_log;
use function ksort;
use function krsort;
use function preg_match;
use function strlen;
use function count;
use function array_shift;
use function substr_count;
use function strrpos;
class Codebase
{
@@ -378,7 +379,7 @@ public function reloadFiles(ProjectAnalyzer $project_analyzer, array $candidate_
}
foreach ($referenced_files as $referenced_file_path) {
if (in_array($referenced_file_path, $diff_files)) {
if (in_array($referenced_file_path, $diff_files, true)) {
continue;
}
@@ -593,6 +594,7 @@ public function findReferencesToMethod($method_id)
public function findReferencesToProperty(string $property_id)
{
list($fq_class_name, $property_name) = explode('::', $property_id);
return $this->file_reference_provider->getClassPropertyLocations(
strtolower($fq_class_name) . '::' . $property_name
);
@@ -709,9 +711,10 @@ public function classExists($fq_class_name)
* @param string $fq_class_name
* @param string $possible_parent
*
* @return bool
* @throws \Psalm\Exception\UnpopulatedClasslikeException when called on unpopulated class
* @throws \InvalidArgumentException when class does not exist
*
* @return bool
*/
public function classExtends($fq_class_name, $possible_parent)
{
@@ -1004,6 +1007,7 @@ public function getSymbolInformation(string $file_path, string $symbol)
return '<?php ' . ($storage->abstract ? 'abstract ' : '') . 'class ' . $storage->name;
} catch (\Exception $e) {
error_log($e->getMessage());
return null;
}
}
@@ -1077,6 +1081,7 @@ public function getSymbolLocation(string $file_path, string $symbol)
return $storage->location;
} catch (\UnexpectedValueException $e) {
error_log($e->getMessage());
return null;
} catch (\InvalidArgumentException $e) {
return null;
@@ -1150,7 +1155,7 @@ public function getFunctionArgumentAtPosition(string $file_path, Position $posit
$offset = $position->toOffset($file_contents);
list(,, $argument_map) = $this->analyzer->getMapsForFile($file_path);
list(, , $argument_map) = $this->analyzer->getMapsForFile($file_path);
$reference = null;
$argument_number = null;
@@ -1,70 +1,69 @@
<?php
namespace Psalm;
use function array_merge;
use function array_pop;
use function array_unique;
use function class_exists;
use Composer\Autoload\ClassLoader;
use function count;
use const DIRECTORY_SEPARATOR;
use function dirname;
use const E_USER_ERROR;
use function explode;
use function file_exists;
use function file_get_contents;
use function filetype;
use function get_class;
use function get_defined_constants;
use function get_defined_functions;
use function in_array;
use function intval;
use function is_dir;
use function json_decode;
use function libxml_clear_errors;
use const LIBXML_ERR_ERROR;
use const LIBXML_ERR_FATAL;
use function libxml_get_errors;
use function libxml_use_internal_errors;
use function mkdir;
use const PHP_EOL;
use function phpversion;
use function preg_match;
use function preg_quote;
use function preg_replace;
use Psalm\Config\IssueHandler;
use Psalm\Config\ProjectFileFilter;
use Psalm\Exception\ConfigException;
use Psalm\Internal\Analyzer\ClassLikeAnalyzer;
use Psalm\Internal\Analyzer\FileAnalyzer;
use Psalm\Internal\Analyzer\ProjectAnalyzer;
use Psalm\Internal\Scanner\FileScanner;
use Psalm\Issue\ArgumentIssue;
use Psalm\Issue\ClassIssue;
use Psalm\Issue\CodeIssue;
use Psalm\Issue\FunctionIssue;
use Psalm\Issue\MethodIssue;
use Psalm\Issue\ArgumentIssue;
use Psalm\Issue\PropertyIssue;
use Psalm\Config\IssueHandler;
use Psalm\Config\ProjectFileFilter;
use Psalm\Exception\ConfigException;
use Psalm\Internal\Analyzer\FileAnalyzer;
use Psalm\Internal\Scanner\FileScanner;
use Psalm\Plugin\Hook;
use Psalm\PluginRegistrationSocket;
use Psalm\Progress\Progress;
use Psalm\Progress\VoidProgress;
use SimpleXMLElement;
use const PHP_EOL;
use function realpath;
use function is_dir;
use function dirname;
use const DIRECTORY_SEPARATOR;
use function file_exists;
use function file_get_contents;
use function sha1;
use function libxml_use_internal_errors;
use function libxml_get_errors;
use const LIBXML_ERR_FATAL;
use const LIBXML_ERR_ERROR;
use function libxml_clear_errors;
use function sys_get_temp_dir;
use function mkdir;
use function trigger_error;
use const E_USER_ERROR;
use function phpversion;
use function version_compare;
use function intval;
use function strtolower;
use function preg_replace;
use function class_exists;
use function count;
use function reset;
use function preg_quote;
use function in_array;
use function explode;
use function get_class;
use function array_pop;
use function rmdir;
use function scandir;
use function sha1;
use SimpleXMLElement;
use function strpos;
use function preg_match;
use function array_merge;
use function get_defined_constants;
use function get_defined_functions;
use function json_decode;
use function array_unique;
use function strtr;
use function strrpos;
use function strtolower;
use function strtr;
use function substr;
use function substr_count;
use function scandir;
use function filetype;
use function sys_get_temp_dir;
use function trigger_error;
use function unlink;
use function rmdir;
use function version_compare;
class Config
{
@@ -402,12 +401,14 @@ class Config
/**
* Static methods to be called after codebase has been populated
*
* @var class-string<Hook\AfterCodebasePopulatedInterface>[]
*/
public $after_codebase_populated = [];
/**
* Static methods to be called after codebase has been populated
*
* @var class-string<Hook\AfterAnalysisInterface>[]
*/
public $after_analysis = [];
@@ -479,7 +480,7 @@ public static function getConfigForPath($path, $base_dir, $output_format)
if (!$config_path) {
if ($output_format === \Psalm\Report::TYPE_CONSOLE) {
echo 'Could not locate a config XML file in path '. $path
echo 'Could not locate a config XML file in path ' . $path
. '. Have you run \'psalm --init\' ?' . PHP_EOL;
exit(1);
}
@@ -493,6 +494,7 @@ public static function getConfigForPath($path, $base_dir, $output_format)
* Searches up a folder hierarchy for the most immediate config.
*
* @throws ConfigException
*
* @return ?string
*/
public static function locateConfigFile(string $path)
@@ -516,6 +518,7 @@ public static function locateConfigFile(string $path)
$dir_path = dirname($dir_path);
} while (dirname($dir_path) !== $dir_path);
return null;
}
@@ -1049,7 +1052,8 @@ public function initializePlugins(ProjectAnalyzer $project_analyzer)
/**
* @psalm-suppress InvalidStringClass
* @var Plugin\PluginEntryPointInterface $plugin_object
*
* @var Plugin\PluginEntryPointInterface
*/
$plugin_object = new $plugin_class_name;
$plugin_object($socket, $plugin_config);
@@ -1271,6 +1275,7 @@ public function getReportingLevelForIssue(CodeIssue $e, array $suppressed_issues
/**
* @param string $issue_type
*
* @return string|null
*/
private static function getParentIssueType($issue_type)
@@ -1,25 +1,24 @@
<?php
namespace Psalm\Config;
use Psalm\Exception\ConfigCreationException;
use Psalm\Internal\Provider;
use function is_dir;
use function array_merge;
use function array_shift;
use function array_unique;
use function count;
use const DIRECTORY_SEPARATOR;
use function dirname;
use function explode;
use function file_exists;
use function json_decode;
use function file_get_contents;
use function is_array;
use function dirname;
use function str_replace;
use function glob;
use function implode;
use function array_merge;
use function is_array;
use function is_dir;
use function json_decode;
use function preg_replace;
use function array_unique;
use Psalm\Exception\ConfigCreationException;
use function sort;
use function glob;
use function explode;
use function array_shift;
use function count;
use function str_replace;
class Creator
{

0 comments on commit da42be1

Please sign in to comment.
You can’t perform that action at this time.