mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 12:24:49 +01:00
Fix formatting in examples
This commit is contained in:
parent
4b4e09277c
commit
6ce4aa19e4
@ -2,6 +2,7 @@
|
||||
$finder = array_reduce(
|
||||
[
|
||||
__DIR__ . '/src/',
|
||||
__DIR__ . '/examples/',
|
||||
__DIR__ . '/bin/',
|
||||
__DIR__ . '/tests/',
|
||||
],
|
||||
|
@ -1,9 +1,6 @@
|
||||
<?php
|
||||
namespace Psalm\Example\Plugin;
|
||||
|
||||
use PhpParser;
|
||||
use Psalm\Checker;
|
||||
use Psalm\Context;
|
||||
use Psalm\CodeLocation;
|
||||
use Psalm\FileManipulation\FileManipulation;
|
||||
use Psalm\StatementsSource;
|
||||
|
@ -4,8 +4,8 @@ namespace Psalm\Example\Plugin;
|
||||
use PhpParser;
|
||||
use Psalm\Checker;
|
||||
use Psalm\Checker\StatementsChecker;
|
||||
use Psalm\Context;
|
||||
use Psalm\CodeLocation;
|
||||
use Psalm\Context;
|
||||
use Psalm\FileManipulation\FileManipulation;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace Psalm\Examples\Template;
|
||||
|
||||
use PhpParser;
|
||||
@ -28,7 +27,6 @@ class TemplateChecker extends Psalm\Checker\FileChecker
|
||||
$first_stmt = $stmts[0];
|
||||
|
||||
if (($first_stmt instanceof PhpParser\Node\Stmt\Nop) && ($doc_comment = $first_stmt->getDocComment())) {
|
||||
|
||||
$comment_block = CommentChecker::parseDocComment(trim($doc_comment->getText()));
|
||||
|
||||
if (isset($comment_block['specials']['variablesfrom'])) {
|
||||
@ -69,7 +67,6 @@ class TemplateChecker extends Psalm\Checker\FileChecker
|
||||
$this_params = null;
|
||||
|
||||
if (($first_stmt instanceof PhpParser\Node\Stmt\Nop) && ($doc_comment = $first_stmt->getDocComment())) {
|
||||
|
||||
$comment_block = CommentChecker::parseDocComment(trim($doc_comment->getText()));
|
||||
|
||||
if (isset($comment_block['specials']['variablesfrom'])) {
|
||||
@ -91,7 +88,7 @@ class TemplateChecker extends Psalm\Checker\FileChecker
|
||||
}
|
||||
|
||||
$this_params->vars_in_scope['$this'] = new Type\Union([
|
||||
new Type\Atomic\TNamedObject(self::VIEW_CLASS)
|
||||
new Type\Atomic\TNamedObject(self::VIEW_CLASS),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@ -101,7 +98,7 @@ class TemplateChecker extends Psalm\Checker\FileChecker
|
||||
$this_params->check_variables = false;
|
||||
$this_params->self = self::VIEW_CLASS;
|
||||
$this_params->vars_in_scope['$this'] = new Type\Union([
|
||||
new Type\Atomic\TNamedObject(self::VIEW_CLASS)
|
||||
new Type\Atomic\TNamedObject(self::VIEW_CLASS),
|
||||
]);
|
||||
}
|
||||
|
||||
@ -113,6 +110,7 @@ class TemplateChecker extends Psalm\Checker\FileChecker
|
||||
/**
|
||||
* @param string $method_id
|
||||
* @param PhpParser\Node $stmt
|
||||
*
|
||||
* @return Context|false
|
||||
*/
|
||||
private function checkMethod($method_id, PhpParser\Node $stmt)
|
||||
@ -160,6 +158,7 @@ class TemplateChecker extends Psalm\Checker\FileChecker
|
||||
|
||||
/**
|
||||
* @param Context $context
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function checkWithViewClass(Context $context)
|
||||
|
@ -10,7 +10,6 @@
|
||||
<exclude-pattern>src/Psalm/CallMap.php</exclude-pattern>
|
||||
|
||||
<!-- These are just examples and stub classes/files, so it doesn't really matter if they're PSR-2 compliant. -->
|
||||
<exclude-pattern>examples/</exclude-pattern>
|
||||
<exclude-pattern>src/Psalm/Stubs/</exclude-pattern>
|
||||
<exclude-pattern>tests/stubs/</exclude-pattern>
|
||||
</ruleset>
|
||||
|
@ -3,7 +3,6 @@ namespace Psalm\Checker;
|
||||
|
||||
use PhpParser;
|
||||
use Psalm\CodeLocation;
|
||||
use Psalm\Context;
|
||||
use Psalm\StatementsSource;
|
||||
|
||||
class InterfaceChecker extends ClassLikeChecker
|
||||
|
Loading…
Reference in New Issue
Block a user