| 1 | <?php |
||
| 7 | class ScalarBeforeCompile extends \Webiny\Component\EventManager\Event |
||
| 8 | { |
||
| 9 | const EVENT_NAME = 'scalar.before-compile'; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @var Context |
||
| 13 | */ |
||
| 14 | private $context; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var \PhpParser\Node\Scalar |
||
| 18 | */ |
||
| 19 | private $scalar; |
||
| 20 | |||
| 21 | 802 | public function __construct(\PhpParser\NodeAbstract $scalar, Context $context) |
|
| 28 | |||
| 29 | /** |
||
| 30 | * @return \PhpParser\Node\Scalar |
||
| 31 | */ |
||
| 32 | 802 | public function getScalar() |
|
| 36 | |||
| 37 | /** |
||
| 38 | * @return Context |
||
| 39 | */ |
||
| 40 | 491 | public function getContext() |
|
| 44 | } |
||
| 45 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.