| 1 | <?php |
||
| 12 | class BasicEntityRemover implements EntityRemovalStrategy { |
||
| 13 | |||
| 14 | private $snakRemover; |
||
| 15 | |||
| 16 | public function __construct( SnakRemover $snakRemover ) { |
||
| 19 | |||
| 20 | public function removeEntity( EntityDocument $entity ) { |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param EntityDocument $entity |
||
| 26 | * |
||
| 27 | * @return boolean |
||
| 28 | */ |
||
| 29 | public function canRemove( EntityDocument $entity ) { |
||
| 32 | |||
| 33 | } |
||
| 34 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: