1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 12:24:49 +01:00

Enable casing plugin and fix issues it found

This commit is contained in:
Matthew Brown 2019-01-12 10:52:23 -05:00
parent a49b5af3e9
commit b43a6a31f1
12 changed files with 15 additions and 11 deletions

View File

@ -38,6 +38,10 @@
<file name="src/Psalm/Internal/Stubs/SabreEvent.php"/>
</stubs>
<plugins>
<plugin filename="examples/plugins/FunctionCasingChecker.php" />
</plugins>
<issueHandlers>
<MisplacedRequiredParam errorLevel="suppress"/>
<PossiblyNullOperand errorLevel="suppress"/>

View File

@ -463,7 +463,7 @@ class Config
$old_dom_document = $dom_document;
$dom_document = new \DOMDocument();
$dom_document->loadXML($old_dom_document->saveXml());
$dom_document->loadXML($old_dom_document->saveXML());
}
// Enable user error handling

View File

@ -150,7 +150,7 @@ class FileFilter
while ($iterator->valid()) {
if (!$iterator->isDot() && $iterator->isLink()) {
$linked_path = readlink($iterator->getPathName());
$linked_path = readlink($iterator->getPathname());
if (stripos($linked_path, $directory_path) !== 0) {
if ($ignore_type_stats && $filter instanceof ProjectFileFilter) {

View File

@ -694,7 +694,7 @@ class ClassAnalyzer extends ClassLikeAnalyzer
$fake_param = (new PhpParser\Builder\Param($param->name));
if ($param->signature_type) {
/** @psalm-suppress DeprecatedMethod */
$fake_param->setTypehint((string)$param->signature_type);
$fake_param->setTypeHint((string)$param->signature_type);
}
return $fake_param->getNode();

View File

@ -111,7 +111,7 @@ class ConfigFile
}
}
$doc->loadXml($file_contents);
$doc->loadXML($file_contents);
return $doc;
}

View File

@ -125,7 +125,7 @@ class DocumentationTest extends TestCase
}
$this->expectException('\Psalm\Exception\CodeException');
$this->expectExceptionMessageRegexp('/\b' . preg_quote($error_message, '/') . '\b/');
$this->expectExceptionMessageRegExp('/\b' . preg_quote($error_message, '/') . '\b/');
$file_path = self::$src_dir_path . 'somefile.php';

View File

@ -87,7 +87,7 @@ class ErrorAfterUpdateTest extends \Psalm\Tests\TestCase
}
$this->expectException('\Psalm\Exception\CodeException');
$this->expectExceptionMessageRegexp('/\b' . preg_quote($error_message, '/') . '\b/');
$this->expectExceptionMessageRegExp('/\b' . preg_quote($error_message, '/') . '\b/');
$codebase->reloadFiles($this->project_analyzer, array_keys($end_files));

View File

@ -81,7 +81,7 @@ class IncludeTest extends TestCase
$config = $codebase->config;
$this->expectException('\Psalm\Exception\CodeException');
$this->expectExceptionMessageRegexp('/\b' . preg_quote($error_message, '/') . '\b/');
$this->expectExceptionMessageRegExp('/\b' . preg_quote($error_message, '/') . '\b/');
$codebase->scanFiles();

View File

@ -78,7 +78,7 @@ class TestCase extends BaseTestCase
public function addFile($file_path, $contents)
{
$this->file_provider->registerFile($file_path, $contents);
$this->project_analyzer->getCodeBase()->scanner->addFileToShallowScan($file_path);
$this->project_analyzer->getCodebase()->scanner->addFileToShallowScan($file_path);
}
/**

View File

@ -44,7 +44,7 @@ trait InvalidCodeAnalysisTestTrait
}
$this->expectException('\Psalm\Exception\CodeException');
$this->expectExceptionMessageRegexp('/\b' . preg_quote($error_message, '/') . '\b/');
$this->expectExceptionMessageRegExp('/\b' . preg_quote($error_message, '/') . '\b/');
$file_path = self::$src_dir_path . 'somefile.php';

View File

@ -87,7 +87,7 @@ class UnusedCodeTest extends TestCase
}
$this->expectException('\Psalm\Exception\CodeException');
$this->expectExceptionMessageRegexp('/\b' . preg_quote($error_message, '/') . '\b/');
$this->expectExceptionMessageRegExp('/\b' . preg_quote($error_message, '/') . '\b/');
$file_path = self::$src_dir_path . 'somefile.php';

View File

@ -87,7 +87,7 @@ class UnusedVariableTest extends TestCase
}
$this->expectException('\Psalm\Exception\CodeException');
$this->expectExceptionMessageRegexp('/\b' . preg_quote($error_message, '/') . '\b/');
$this->expectExceptionMessageRegExp('/\b' . preg_quote($error_message, '/') . '\b/');
$file_path = self::$src_dir_path . 'somefile.php';