| 1 | <?php |
||
| 10 | class UndoContext extends DrupalSubContextBase { |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Whether the stack is locked (i.e., not accepting new operations). |
||
| 14 | * |
||
| 15 | * @var bool |
||
| 16 | */ |
||
| 17 | protected $locked = FALSE; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * The operation stack. |
||
| 21 | * |
||
| 22 | * @var array |
||
| 23 | */ |
||
| 24 | protected $stack = []; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Executes all undo operations in the stack. |
||
| 28 | * |
||
| 29 | * @AfterScenario |
||
| 30 | */ |
||
| 31 | public function runAll() { |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Adds an operation to the undo stack. |
||
| 44 | * |
||
| 45 | * @param callable $callback |
||
| 46 | * The function to call. |
||
| 47 | * @param array $arguments |
||
| 48 | * (optional) Arguments to pass to the callback. None of the arguments can |
||
| 49 | * be passed by reference. |
||
| 50 | */ |
||
| 51 | public function push(callable $callback, array $arguments = []) { |
||
| 56 | |||
| 57 | } |
||
| 58 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.