| 1 | <?php |
||
| 7 | class ConsoleDiff extends FirstDiff |
||
| 8 | { |
||
| 9 | const UNCLOSED_TAGS = '/<(?P<tag>[a-z;=]+)>(?!.*?<\/(?:(?P=tag)|)>)/i'; |
||
| 10 | |||
| 11 | /** @var FirstDiff */ |
||
| 12 | private $diff; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * ConsoleDiff constructor. |
||
| 16 | * |
||
| 17 | * @param FirstDiff|null $differ |
||
| 18 | */ |
||
| 19 | public function __construct($differ = null) |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param string[] $old |
||
| 26 | * @param string[] $new |
||
| 27 | * @param int $options |
||
| 28 | * |
||
| 29 | * @return string[] |
||
| 30 | */ |
||
| 31 | public function lines(array $old, array $new, $options = OutputInterface::OUTPUT_NORMAL) |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Find a list of unclosed tags |
||
| 53 | * |
||
| 54 | * @param string $string |
||
| 55 | * |
||
| 56 | * @return string[] |
||
| 57 | */ |
||
| 58 | private function getUnclosedTags($string) |
||
| 65 | } |
||
| 66 |
If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration: