diff --git a/src/Util/YamlSourceManipulator.php b/src/Util/YamlSourceManipulator.php index fe332670b..22357995d 100644 --- a/src/Util/YamlSourceManipulator.php +++ b/src/Util/YamlSourceManipulator.php @@ -714,7 +714,7 @@ private function updateContents(string $newContents, array $newData, int $newPos private function convertToYaml($data) { $indent = $this->depth > 0 && isset($this->indentationForDepths[$this->depth]) - ? $this->indentationForDepths[$this->depth] / $this->depth + ? intdiv($this->indentationForDepths[$this->depth], $this->depth) : 4; $newDataString = Yaml::dump($data, 4, $indent); @@ -1132,7 +1132,7 @@ private function removeMetadataKeys(array $data) unset($data[$key]); } - if (0 === strpos($val, self::COMMENT_PLACEHOLDER_VALUE)) { + if (null !== $val && 0 === strpos($val, self::COMMENT_PLACEHOLDER_VALUE)) { unset($data[$key]); } }