diff --git a/CHANGELOG.md b/CHANGELOG.md index fde44bc2f3..6899c4734a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi ## [Unreleased][unreleased] +### Changed + + - Blocks added outside of the parsing context now have their start/end line numbers defaulted to 0 to avoid type errors (#579) + ### Fixed - Fixed replacement blocks not inheriting the start line number of the container they're replacing (#579) diff --git a/src/Block/Element/AbstractBlock.php b/src/Block/Element/AbstractBlock.php index b8ac83b527..1edd683f2a 100644 --- a/src/Block/Element/AbstractBlock.php +++ b/src/Block/Element/AbstractBlock.php @@ -45,12 +45,12 @@ abstract class AbstractBlock extends Node /** * @var int */ - protected $startLine; + protected $startLine = 0; /** * @var int */ - protected $endLine; + protected $endLine = 0; protected function setParent(Node $node = null) {