| 1 | <?php |
||
| 13 | class PyStringYamlParser { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * PyStringNode object. |
||
| 17 | * |
||
| 18 | * @var PyStringNode; |
||
| 19 | */ |
||
| 20 | protected $node; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * PyStringYamlParser constructor. |
||
| 24 | * |
||
| 25 | * @param \Behat\Gherkin\Node\PyStringNode $node |
||
| 26 | * PyString containing text in YAML format. |
||
| 27 | */ |
||
| 28 | public function __construct(PyStringNode $node) { |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Parse YAML contained in a PyString node. |
||
| 34 | * |
||
| 35 | * @return array |
||
| 36 | * Parsed YAML. |
||
| 37 | */ |
||
| 38 | public function parse() { |
||
| 51 | |||
| 52 | } |
||
| 53 |
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.