mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Check for mixed method calls
This commit is contained in:
parent
ccc30163c2
commit
70a92e006d
7
src/CodeInspector/Issue/MixedMethodCall.php
Normal file
7
src/CodeInspector/Issue/MixedMethodCall.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace CodeInspector\Issue;
|
||||
|
||||
class MixedMethodCall extends CodeError
|
||||
{
|
||||
}
|
@ -9,6 +9,7 @@ use CodeInspector\Issue\ForbiddenCode;
|
||||
use CodeInspector\Issue\InvalidArgument;
|
||||
use CodeInspector\Issue\InvalidNamespace;
|
||||
use CodeInspector\Issue\InvalidIterator;
|
||||
use CodeInspector\Issue\MixedMethodCall;
|
||||
use CodeInspector\Issue\NullReference;
|
||||
use CodeInspector\Issue\ParentNotFound;
|
||||
use CodeInspector\Issue\PossiblyUndefinedVariable;
|
||||
@ -1835,6 +1836,11 @@ class StatementsChecker
|
||||
break;
|
||||
|
||||
case 'mixed':
|
||||
if (IssueBuffer::accepts(
|
||||
new MixedMethodCall('Cannot call method ' . $stmt->name . ' on a mixed variable', $this->_file_name, $stmt->getLine())
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user