1
0
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:
Matthew Brown 2016-07-07 19:37:39 -04:00
parent ccc30163c2
commit 70a92e006d
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,7 @@
<?php
namespace CodeInspector\Issue;
class MixedMethodCall extends CodeError
{
}

View File

@ -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: