From a80d5b736bddfee3e1d261ad3460d9fa8e7879f0 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Sun, 14 Feb 2021 00:42:34 +0100 Subject: [PATCH] Rename stub to avoid phpstorm conflict (#5213) --- src/Psalm/Config.php | 12 ++-- stubs/{Php80.php => Php80.phpstub} | 0 stubs/{Xdebug.php => Xdebug.phpstub} | 0 stubs/{ext-ds.php => ext-ds.phpstub} | 0 stubs/{ext-geos.php => ext-geos.phpstub} | 0 stubs/{pdo.php => pdo.phpstub} | 0 stubs/{soap.php => soap.phpstub} | 0 tests/Config/PluginTest.php | 2 +- tests/IncludeTest.php | 2 +- tests/StubTest.php | 58 +++++++++---------- tests/VariadicTest.php | 2 +- .../stubs/{Doctrine.php => Doctrine.phpstub} | 0 ...nException.php => DomainException.phpstub} | 0 ...{MissingClass.php => MissingClass.phpstub} | 0 ...issingMethod.php => MissingMethod.phpstub} | 0 .../{base_plugin.php => base_plugin.phpstub} | 0 .../{class_alias.php => class_alias.phpstub} | 0 ...ditional_constant_define_inferred.phpstub} | 0 ...face.php => conditional_interface.phpstub} | 0 ... conditional_namespaced_functions.phpstub} | 0 ...functions.php => custom_functions.phpstub} | 0 ...ng_plugin.php => extending_plugin.phpstub} | 2 +- ...hp => extending_plugin_entrypoint.phpstub} | 2 +- ...ced_class.php => namespaced_class.phpstub} | 0 ...tions.php => namespaced_functions.phpstub} | 0 ...artial_class.php => partial_class.phpstub} | 0 .../stubs/{polyfill.php => polyfill.phpstub} | 0 .../{systemclass.php => systemclass.phpstub} | 0 ...ated_class.php => templated_class.phpstub} | 0 29 files changed, 40 insertions(+), 40 deletions(-) rename stubs/{Php80.php => Php80.phpstub} (100%) rename stubs/{Xdebug.php => Xdebug.phpstub} (100%) rename stubs/{ext-ds.php => ext-ds.phpstub} (100%) rename stubs/{ext-geos.php => ext-geos.phpstub} (100%) rename stubs/{pdo.php => pdo.phpstub} (100%) rename stubs/{soap.php => soap.phpstub} (100%) rename tests/fixtures/stubs/{Doctrine.php => Doctrine.phpstub} (100%) rename tests/fixtures/stubs/{DomainException.php => DomainException.phpstub} (100%) rename tests/fixtures/stubs/{MissingClass.php => MissingClass.phpstub} (100%) rename tests/fixtures/stubs/{MissingMethod.php => MissingMethod.phpstub} (100%) rename tests/fixtures/stubs/{base_plugin.php => base_plugin.phpstub} (100%) rename tests/fixtures/stubs/{class_alias.php => class_alias.phpstub} (100%) rename tests/fixtures/stubs/{conditional_constant_define_inferred.php => conditional_constant_define_inferred.phpstub} (100%) rename tests/fixtures/stubs/{conditional_interface.php => conditional_interface.phpstub} (100%) rename tests/fixtures/stubs/{conditional_namespaced_functions.php => conditional_namespaced_functions.phpstub} (100%) rename tests/fixtures/stubs/{custom_functions.php => custom_functions.phpstub} (100%) rename tests/fixtures/stubs/{extending_plugin.php => extending_plugin.phpstub} (52%) rename tests/fixtures/stubs/{extending_plugin_entrypoint.php => extending_plugin_entrypoint.phpstub} (86%) rename tests/fixtures/stubs/{namespaced_class.php => namespaced_class.phpstub} (100%) rename tests/fixtures/stubs/{namespaced_functions.php => namespaced_functions.phpstub} (100%) rename tests/fixtures/stubs/{partial_class.php => partial_class.phpstub} (100%) rename tests/fixtures/stubs/{polyfill.php => polyfill.phpstub} (100%) rename tests/fixtures/stubs/{systemclass.php => systemclass.phpstub} (100%) rename tests/fixtures/stubs/{templated_class.php => templated_class.phpstub} (100%) diff --git a/src/Psalm/Config.php b/src/Psalm/Config.php index 88c232c9e47..953fcbe6f0d 100644 --- a/src/Psalm/Config.php +++ b/src/Psalm/Config.php @@ -1659,7 +1659,7 @@ public function visitPreloadedStubFiles(Codebase $codebase, ?Progress $progress $core_generic_files = []; if (\PHP_VERSION_ID < 80000 && $codebase->php_major_version >= 8) { - $stringable_path = dirname(__DIR__, 2) . '/stubs/Php80.php'; + $stringable_path = dirname(__DIR__, 2) . '/stubs/Php80.phpstub'; if (!file_exists($stringable_path)) { throw new \UnexpectedValueException('Cannot locate PHP 8.0 classes'); @@ -1734,7 +1734,7 @@ public function visitStubFiles(Codebase $codebase, ?Progress $progress = null): ]; if (\PHP_VERSION_ID >= 80000 && $codebase->php_major_version >= 8) { - $stringable_path = dirname(__DIR__, 2) . '/stubs/Php80.php'; + $stringable_path = dirname(__DIR__, 2) . '/stubs/Php80.phpstub'; if (!file_exists($stringable_path)) { throw new \UnexpectedValueException('Cannot locate PHP 8.0 classes'); @@ -1744,7 +1744,7 @@ public function visitStubFiles(Codebase $codebase, ?Progress $progress = null): } if (\extension_loaded('PDO')) { - $ext_pdo_path = dirname(__DIR__, 2) . '/stubs/pdo.php'; + $ext_pdo_path = dirname(__DIR__, 2) . '/stubs/pdo.phpstub'; if (!file_exists($ext_pdo_path)) { throw new \UnexpectedValueException('Cannot locate pdo classes'); @@ -1754,7 +1754,7 @@ public function visitStubFiles(Codebase $codebase, ?Progress $progress = null): } if (\extension_loaded('soap')) { - $ext_pdo_path = dirname(__DIR__, 2) . '/stubs/soap.php'; + $ext_pdo_path = dirname(__DIR__, 2) . '/stubs/soap.phpstub'; if (!file_exists($ext_pdo_path)) { throw new \UnexpectedValueException('Cannot locate soap classes'); @@ -1764,7 +1764,7 @@ public function visitStubFiles(Codebase $codebase, ?Progress $progress = null): } if (\extension_loaded('ds')) { - $ext_ds_path = dirname(__DIR__, 2) . '/stubs/ext-ds.php'; + $ext_ds_path = dirname(__DIR__, 2) . '/stubs/ext-ds.phpstub'; if (!file_exists($ext_ds_path)) { throw new \UnexpectedValueException('Cannot locate ext-ds classes'); @@ -1776,7 +1776,7 @@ public function visitStubFiles(Codebase $codebase, ?Progress $progress = null): $stub_files = array_merge($core_generic_files, $this->stub_files); if ($this->load_xdebug_stub) { - $xdebug_stub_path = dirname(__DIR__, 2) . '/stubs/Xdebug.php'; + $xdebug_stub_path = dirname(__DIR__, 2) . '/stubs/Xdebug.phpstub'; if (!file_exists($xdebug_stub_path)) { throw new \UnexpectedValueException('Cannot locate Xdebug stub'); diff --git a/stubs/Php80.php b/stubs/Php80.phpstub similarity index 100% rename from stubs/Php80.php rename to stubs/Php80.phpstub diff --git a/stubs/Xdebug.php b/stubs/Xdebug.phpstub similarity index 100% rename from stubs/Xdebug.php rename to stubs/Xdebug.phpstub diff --git a/stubs/ext-ds.php b/stubs/ext-ds.phpstub similarity index 100% rename from stubs/ext-ds.php rename to stubs/ext-ds.phpstub diff --git a/stubs/ext-geos.php b/stubs/ext-geos.phpstub similarity index 100% rename from stubs/ext-geos.php rename to stubs/ext-geos.phpstub diff --git a/stubs/pdo.php b/stubs/pdo.phpstub similarity index 100% rename from stubs/pdo.php rename to stubs/pdo.phpstub diff --git a/stubs/soap.php b/stubs/soap.phpstub similarity index 100% rename from stubs/soap.php rename to stubs/soap.phpstub diff --git a/tests/Config/PluginTest.php b/tests/Config/PluginTest.php index 2ab5bc15c80..7a466d6f71d 100644 --- a/tests/Config/PluginTest.php +++ b/tests/Config/PluginTest.php @@ -494,7 +494,7 @@ public function testFloatCheckerPluginIssueSuppressionByDocblock(): void public function testInheritedHookHandlersAreCalled(): void { - require_once dirname(__DIR__) . '/fixtures/stubs/extending_plugin_entrypoint.php'; + require_once dirname(__DIR__) . '/fixtures/stubs/extending_plugin_entrypoint.phpstub'; $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( diff --git a/tests/IncludeTest.php b/tests/IncludeTest.php index ef218a6d17a..a9aae37ccfe 100644 --- a/tests/IncludeTest.php +++ b/tests/IncludeTest.php @@ -545,7 +545,7 @@ public function __construct() { 'files' => [ getcwd() . DIRECTORY_SEPARATOR . 'file1.php' => ' - + ' ) @@ -92,7 +92,7 @@ public function testStubFileClass(): void - + ' ) @@ -132,13 +132,13 @@ public function testLoadStubFileWithRelativePath(): void errorLevel="1" > - + ' ) ); - $path = $this->getOperatingSystemStyledPath('tests/fixtures/stubs/systemclass.php'); + $path = $this->getOperatingSystemStyledPath('tests/fixtures/stubs/systemclass.phpstub'); $stub_files = $this->project_analyzer->getConfig()->getStubFiles(); $this->assertStringContainsString($path, \reset($stub_files)); } @@ -154,13 +154,13 @@ public function testLoadStubFileWithAbsolutePath(): void errorLevel="1" > - + ' ) ); - $path = $this->getOperatingSystemStyledPath('tests/fixtures/stubs/systemclass.php'); + $path = $this->getOperatingSystemStyledPath('tests/fixtures/stubs/systemclass.phpstub'); $stub_files = $this->project_analyzer->getConfig()->getStubFiles(); $this->assertStringContainsString($path, \reset($stub_files)); } @@ -179,7 +179,7 @@ public function testStubFileConstant(): void - + ' ) @@ -302,7 +302,7 @@ public function testNamespacedStubClass(): void - + ' ) @@ -339,7 +339,7 @@ public function testStubRegularFunction(): void - + ' ) @@ -370,7 +370,7 @@ public function testStubVariadicFunction(): void - + ' ) @@ -403,7 +403,7 @@ public function testStubVariadicFunctionWrongArgType(): void - + ' ) @@ -464,7 +464,7 @@ public function testPolyfilledFunction(): void ' @@ -496,7 +496,7 @@ public function testConditionalConstantDefined(): void ' @@ -528,7 +528,7 @@ public function testClassAlias(): void ' @@ -592,7 +592,7 @@ public function testStubFunctionWithFunctionExists(): void - + ' ) @@ -624,7 +624,7 @@ public function testNamespacedStubFunctionWithFunctionExists(): void - + ' ) @@ -686,7 +686,7 @@ public function testNamespacedStubFunction(): void - + ' ) @@ -717,7 +717,7 @@ public function testConditionalNamespacedStubFunction(): void - + ' ) @@ -748,7 +748,7 @@ public function testConditionallyExtendingInterface(): void - + ' ) @@ -795,7 +795,7 @@ public function testStubFileWithExistingClassDefinition(): void - + ' ) @@ -826,7 +826,7 @@ public function testStubFileWithPartialClassDefinitionWithMoreMethods(): void - + ' ) @@ -874,7 +874,7 @@ public function testExtendOnlyStubbedClass(): void - + ' ) @@ -909,7 +909,7 @@ public function testStubFileWithExtendedStubbedClass(): void - + ' ) @@ -946,7 +946,7 @@ public function testStubFileWithPartialClassDefinitionWithCoercion(): void - + ' ) @@ -991,7 +991,7 @@ public function testStubFileWithPartialClassDefinitionGeneralReturnType(): void - + ' ) @@ -1032,7 +1032,7 @@ public function testStubFileWithTemplatedClassDefinitionAndMagicMethodOverride() - + ' ) @@ -1128,7 +1128,7 @@ public function testStubOverridingMissingClass(): void - + ' ) @@ -1159,7 +1159,7 @@ public function testStubOverridingMissingMethod(): void - + ' ) @@ -1190,7 +1190,7 @@ public function testStubReplacingInterfaceDocblock(): void - + ' ) diff --git a/tests/VariadicTest.php b/tests/VariadicTest.php index d015966ef98..df05de75418 100644 --- a/tests/VariadicTest.php +++ b/tests/VariadicTest.php @@ -42,7 +42,7 @@ public function testVariadicFunctionFromAutoloadFile(): void dirname(__DIR__), ' diff --git a/tests/fixtures/stubs/Doctrine.php b/tests/fixtures/stubs/Doctrine.phpstub similarity index 100% rename from tests/fixtures/stubs/Doctrine.php rename to tests/fixtures/stubs/Doctrine.phpstub diff --git a/tests/fixtures/stubs/DomainException.php b/tests/fixtures/stubs/DomainException.phpstub similarity index 100% rename from tests/fixtures/stubs/DomainException.php rename to tests/fixtures/stubs/DomainException.phpstub diff --git a/tests/fixtures/stubs/MissingClass.php b/tests/fixtures/stubs/MissingClass.phpstub similarity index 100% rename from tests/fixtures/stubs/MissingClass.php rename to tests/fixtures/stubs/MissingClass.phpstub diff --git a/tests/fixtures/stubs/MissingMethod.php b/tests/fixtures/stubs/MissingMethod.phpstub similarity index 100% rename from tests/fixtures/stubs/MissingMethod.php rename to tests/fixtures/stubs/MissingMethod.phpstub diff --git a/tests/fixtures/stubs/base_plugin.php b/tests/fixtures/stubs/base_plugin.phpstub similarity index 100% rename from tests/fixtures/stubs/base_plugin.php rename to tests/fixtures/stubs/base_plugin.phpstub diff --git a/tests/fixtures/stubs/class_alias.php b/tests/fixtures/stubs/class_alias.phpstub similarity index 100% rename from tests/fixtures/stubs/class_alias.php rename to tests/fixtures/stubs/class_alias.phpstub diff --git a/tests/fixtures/stubs/conditional_constant_define_inferred.php b/tests/fixtures/stubs/conditional_constant_define_inferred.phpstub similarity index 100% rename from tests/fixtures/stubs/conditional_constant_define_inferred.php rename to tests/fixtures/stubs/conditional_constant_define_inferred.phpstub diff --git a/tests/fixtures/stubs/conditional_interface.php b/tests/fixtures/stubs/conditional_interface.phpstub similarity index 100% rename from tests/fixtures/stubs/conditional_interface.php rename to tests/fixtures/stubs/conditional_interface.phpstub diff --git a/tests/fixtures/stubs/conditional_namespaced_functions.php b/tests/fixtures/stubs/conditional_namespaced_functions.phpstub similarity index 100% rename from tests/fixtures/stubs/conditional_namespaced_functions.php rename to tests/fixtures/stubs/conditional_namespaced_functions.phpstub diff --git a/tests/fixtures/stubs/custom_functions.php b/tests/fixtures/stubs/custom_functions.phpstub similarity index 100% rename from tests/fixtures/stubs/custom_functions.php rename to tests/fixtures/stubs/custom_functions.phpstub diff --git a/tests/fixtures/stubs/extending_plugin.php b/tests/fixtures/stubs/extending_plugin.phpstub similarity index 52% rename from tests/fixtures/stubs/extending_plugin.php rename to tests/fixtures/stubs/extending_plugin.phpstub index 45071e260a6..00c12a69701 100644 --- a/tests/fixtures/stubs/extending_plugin.php +++ b/tests/fixtures/stubs/extending_plugin.phpstub @@ -1,5 +1,5 @@