These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Tests\PHPSA\Expression; |
||
4 | |||
5 | use PhpParser\Node; |
||
6 | use PHPSA\CompiledExpression; |
||
7 | use PHPSA\Compiler\Expression; |
||
8 | |||
9 | class ErrorSuppressTest extends \Tests\PHPSA\TestCase |
||
10 | { |
||
11 | public function testErrorSuppressSuccess() |
||
12 | { |
||
13 | $baseExpression = new Node\Expr\ErrorSuppress(new Node\Expr\Print_( |
||
14 | $this->newScalarExpr("test") |
||
15 | )); |
||
16 | $compiledExpression = $this->compileExpression($baseExpression); |
||
17 | |||
18 | parent::assertInstanceOfCompiledExpression($compiledExpression); |
||
0 ignored issues
–
show
|
|||
19 | parent::assertSame(CompiledExpression::INTEGER, $compiledExpression->getType()); |
||
0 ignored issues
–
show
It seems like you call parent on a different method (
assertSame() instead of testErrorSuppressSuccess() ). Are you sure this is correct? If so, you might want to change this to $this->assertSame() .
This check looks for a call to a parent method whose name is different than the method from which it is called. Consider the following code: class Daddy
{
protected function getFirstName()
{
return "Eidur";
}
protected function getSurName()
{
return "Gudjohnsen";
}
}
class Son
{
public function getFirstName()
{
return parent::getSurname();
}
}
The
Loading history...
|
|||
20 | parent::assertSame(1, $compiledExpression->getValue()); |
||
0 ignored issues
–
show
It seems like you call parent on a different method (
assertSame() instead of testErrorSuppressSuccess() ). Are you sure this is correct? If so, you might want to change this to $this->assertSame() .
This check looks for a call to a parent method whose name is different than the method from which it is called. Consider the following code: class Daddy
{
protected function getFirstName()
{
return "Eidur";
}
protected function getSurName()
{
return "Gudjohnsen";
}
}
class Son
{
public function getFirstName()
{
return parent::getSurname();
}
}
The
Loading history...
|
|||
21 | } |
||
22 | } |
||
23 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.