Skip to content

Commit 982b751

Browse files
committed
Fix function call
1 parent 2820fd5 commit 982b751

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

includes/Scanner/Log.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public function add_abstraction_declarations( $abstractions, $logid, $unique = f
255255
$type = 'class';
256256
break;
257257
case 'Stmt_Function':
258-
$contextual_stmts = $this->parser_object->get_contextual_STMTS_for_element( $abstract )['context'];
258+
$contextual_stmts = $this->parser_object->get_contextual_stmts_for_element( $abstract )['context'];
259259
if ( $contextual_stmts !== $abstract->stmts && ! empty( $abstract->stmts ) ) {
260260
$continue = false; // Function declared inside another function.
261261
}

includes/Scanner/Prefix_Scanner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ private function add_globals_declarations_to_log() {
386386
if ( ! empty( $consts ) ) {
387387
foreach ( $consts as $const ) {
388388
$is_inside_element_type = null;
389-
$contextual_stmts = $this->get_contextual_STMTS_for_element( $const, $is_inside_element_type )['context'];
389+
$contextual_stmts = $this->get_contextual_stmts_for_element( $const, $is_inside_element_type )['context'];
390390
if ( ! empty( $contextual_stmts ) && ! in_array( $is_inside_element_type, array( 'PhpParser\Node\Stmt\Class_', 'PhpParser\Node\Stmt\Interface_' ), true ) ) { // Ignore const inside a class.
391391
if ( isset( $const->name ) && method_exists( $const->name, '__toString' ) && ! empty( $const->name->__toString() ) ) {
392392
$this->log()->add_var_expr( $const, 'prefixes_code', true );

phpstan.neon.dist

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,18 @@ parameters:
3232
-
3333
message: '/^Function str_ends_with not found.$/'
3434
path: includes/Checker/Checks/Abstract_File_Check.php
35+
-
36+
message: '/^Access to deprecated property \$parts of class PhpParser\\Node\\Name:/'
37+
path: includes/Scanner/PHP_Parser.php
38+
-
39+
message: '/^Call to function is_object\(\) with object will always evaluate to true\.$/'
40+
path: includes/Scanner/PHP_Parser.php
41+
-
42+
message: '/^Call to function method_exists\(\) with object and \'getEndLine\' will always evaluate to true\.$/'
43+
path: includes/Scanner/PHP_Parser.php
44+
-
45+
message: '/^Call to function method_exists\(\) with PhpParser\\Node\\Expr\\AssignOp\\Concat and \'getEndLine\' will always evaluate to true\.$/'
46+
path: includes/Scanner/PHP_Parser.php
47+
-
48+
message: '/^Instanceof between PhpParser\\Node\\Expr\\AssignOp\\Concat and PhpParser\\Node\\Expr\\AssignOp will always evaluate to true\.$/'
49+
path: includes/Scanner/PHP_Parser.php

0 commit comments

Comments
 (0)