Skip to content

Commit

Permalink
Rename stub to avoid phpstorm conflict (#5213)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Feb 13, 2021
1 parent 15a9eec commit a80d5b7
Show file tree
Hide file tree
Showing 29 changed files with 40 additions and 40 deletions.
12 changes: 6 additions & 6 deletions src/Psalm/Config.php
Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand All @@ -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');
Expand All @@ -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');
Expand All @@ -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');
Expand All @@ -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');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/Config/PluginTest.php
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/IncludeTest.php
Expand Up @@ -545,7 +545,7 @@ public function __construct() {
'files' => [
getcwd() . DIRECTORY_SEPARATOR . 'file1.php' => '<?php
function getEndpoints() : void {
$listFile = "tests/fixtures/stubs/custom_functions.php";
$listFile = "tests/fixtures/stubs/custom_functions.phpstub";
if (!file_exists($listFile)) {
throw new RuntimeException("Endpoint list not found");
}
Expand Down
58 changes: 29 additions & 29 deletions tests/StubTest.php
Expand Up @@ -71,7 +71,7 @@ public function testNonexistentStubFile(): void
</projectFiles>
<stubs>
<file name="stubs/invalidfile.php" />
<file name="stubs/invalidfile.phpstub" />
</stubs>
</psalm>'
)
Expand All @@ -92,7 +92,7 @@ public function testStubFileClass(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/systemclass.php" />
<file name="tests/fixtures/stubs/systemclass.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -132,13 +132,13 @@ public function testLoadStubFileWithRelativePath(): void
errorLevel="1"
>
<stubs>
<file name="./tests/../tests/fixtures/stubs/systemclass.php" />
<file name="./tests/../tests/fixtures/stubs/systemclass.phpstub" />
</stubs>
</psalm>'
)
);

$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));
}
Expand All @@ -154,13 +154,13 @@ public function testLoadStubFileWithAbsolutePath(): void
errorLevel="1"
>
<stubs>
<file name="' . $runDir . '/tests/fixtures/stubs/systemclass.php" />
<file name="' . $runDir . '/tests/fixtures/stubs/systemclass.phpstub" />
</stubs>
</psalm>'
)
);

$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));
}
Expand All @@ -179,7 +179,7 @@ public function testStubFileConstant(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/systemclass.php" />
<file name="tests/fixtures/stubs/systemclass.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -302,7 +302,7 @@ public function testNamespacedStubClass(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/namespaced_class.php" />
<file name="tests/fixtures/stubs/namespaced_class.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -339,7 +339,7 @@ public function testStubRegularFunction(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/custom_functions.php" />
<file name="tests/fixtures/stubs/custom_functions.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -370,7 +370,7 @@ public function testStubVariadicFunction(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/custom_functions.php" />
<file name="tests/fixtures/stubs/custom_functions.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -403,7 +403,7 @@ public function testStubVariadicFunctionWrongArgType(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/custom_functions.php" />
<file name="tests/fixtures/stubs/custom_functions.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -464,7 +464,7 @@ public function testPolyfilledFunction(): void
'<?xml version="1.0"?>
<psalm
errorLevel="1"
autoloader="tests/fixtures/stubs/polyfill.php"
autoloader="tests/fixtures/stubs/polyfill.phpstub"
>
<projectFiles>
<directory name="src" />
Expand Down Expand Up @@ -496,7 +496,7 @@ public function testConditionalConstantDefined(): void
'<?xml version="1.0"?>
<psalm
errorLevel="1"
autoloader="tests/fixtures/stubs/conditional_constant_define_inferred.php"
autoloader="tests/fixtures/stubs/conditional_constant_define_inferred.phpstub"
>
<projectFiles>
<directory name="src" />
Expand Down Expand Up @@ -528,7 +528,7 @@ public function testClassAlias(): void
'<?xml version="1.0"?>
<psalm
errorLevel="1"
autoloader="tests/fixtures/stubs/class_alias.php"
autoloader="tests/fixtures/stubs/class_alias.phpstub"
>
<projectFiles>
<directory name="src" />
Expand Down Expand Up @@ -592,7 +592,7 @@ public function testStubFunctionWithFunctionExists(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/custom_functions.php" />
<file name="tests/fixtures/stubs/custom_functions.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -624,7 +624,7 @@ public function testNamespacedStubFunctionWithFunctionExists(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/custom_functions.php" />
<file name="tests/fixtures/stubs/custom_functions.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -686,7 +686,7 @@ public function testNamespacedStubFunction(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/namespaced_functions.php" />
<file name="tests/fixtures/stubs/namespaced_functions.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -717,7 +717,7 @@ public function testConditionalNamespacedStubFunction(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/conditional_namespaced_functions.php" />
<file name="tests/fixtures/stubs/conditional_namespaced_functions.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -748,7 +748,7 @@ public function testConditionallyExtendingInterface(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/conditional_interface.php" />
<file name="tests/fixtures/stubs/conditional_interface.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -795,7 +795,7 @@ public function testStubFileWithExistingClassDefinition(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/DomainException.php" />
<file name="tests/fixtures/stubs/DomainException.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -826,7 +826,7 @@ public function testStubFileWithPartialClassDefinitionWithMoreMethods(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/partial_class.php" />
<file name="tests/fixtures/stubs/partial_class.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -874,7 +874,7 @@ public function testExtendOnlyStubbedClass(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/partial_class.php" />
<file name="tests/fixtures/stubs/partial_class.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -909,7 +909,7 @@ public function testStubFileWithExtendedStubbedClass(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/partial_class.php" />
<file name="tests/fixtures/stubs/partial_class.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -946,7 +946,7 @@ public function testStubFileWithPartialClassDefinitionWithCoercion(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/partial_class.php" />
<file name="tests/fixtures/stubs/partial_class.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -991,7 +991,7 @@ public function testStubFileWithPartialClassDefinitionGeneralReturnType(): void
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/partial_class.php" />
<file name="tests/fixtures/stubs/partial_class.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -1032,7 +1032,7 @@ public function testStubFileWithTemplatedClassDefinitionAndMagicMethodOverride()
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/templated_class.php" />
<file name="tests/fixtures/stubs/templated_class.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -1128,7 +1128,7 @@ public function testStubOverridingMissingClass(): void
<directory name="src" />
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/MissingClass.php" />
<file name="tests/fixtures/stubs/MissingClass.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -1159,7 +1159,7 @@ public function testStubOverridingMissingMethod(): void
<directory name="src" />
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/MissingMethod.php" />
<file name="tests/fixtures/stubs/MissingMethod.phpstub" />
</stubs>
</psalm>'
)
Expand Down Expand Up @@ -1190,7 +1190,7 @@ public function testStubReplacingInterfaceDocblock(): void
<directory name="src" />
</projectFiles>
<stubs>
<file name="tests/fixtures/stubs/Doctrine.php" />
<file name="tests/fixtures/stubs/Doctrine.phpstub" />
</stubs>
</psalm>'
)
Expand Down
2 changes: 1 addition & 1 deletion tests/VariadicTest.php
Expand Up @@ -42,7 +42,7 @@ public function testVariadicFunctionFromAutoloadFile(): void
dirname(__DIR__),
'<?xml version="1.0"?>
<psalm
autoloader="tests/fixtures/stubs/custom_functions.php"
autoloader="tests/fixtures/stubs/custom_functions.phpstub"
>
<projectFiles>
<directory name="src" />
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,5 @@
<?php
require_once __DIR__ . '/base_plugin.php';
require_once __DIR__ . '/base_plugin.phpstub';

class ExtendingPlugin extends BasePlugin
{
Expand Down
Expand Up @@ -3,7 +3,7 @@
use Psalm\Plugin\PluginEntryPointInterface;
use Psalm\Plugin\RegistrationInterface;

require_once __DIR__ . '/extending_plugin.php';
require_once __DIR__ . '/extending_plugin.phpstub';

class ExtendingPluginRegistration implements PluginEntryPointInterface
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a80d5b7

Please sign in to comment.