diff --git a/src/DocBlockArchitecturalDecision.php b/src/DocBlockArchitecturalDecision.php index a536d15..a80425d 100644 --- a/src/DocBlockArchitecturalDecision.php +++ b/src/DocBlockArchitecturalDecision.php @@ -19,7 +19,7 @@ final public function getContents() : string { $reflection = new \ReflectionClass(static::class); $content = $reflection->getDocComment(); - if (!$content) { + if ($content === false) { throw MissingDocBlock::fromClass($reflection->getName()); } diff --git a/src/XmlDocumentGenerator.php b/src/XmlDocumentGenerator.php index 57c3682..164a83c 100644 --- a/src/XmlDocumentGenerator.php +++ b/src/XmlDocumentGenerator.php @@ -74,12 +74,11 @@ public function generateDocument(string $file, array $scanDirs) : void { $dom->createElementNS(ArchitecturalDecisionRecord::SCHEMA, 'contents') ); - assert(!is_null($contentsNode->ownerDocument)); $contentsNode->appendChild( $contentsNode->ownerDocument->createCDATASection($attribute->getContents()) ); - if (!empty($decisionAnnotation['targets'])) { + if ($decisionAnnotation['targets'] !== []) { $codeAnnotationsNode = $decisionElement->appendChild( $dom->createElementNS(ArchitecturalDecisionRecord::SCHEMA, 'codeAnnotations') ); diff --git a/tests/Stub/Adr/StubMetaDataArchitecturalDecision.php b/tests/Stub/Adr/StubMetaDataArchitecturalDecision.php index ee01884..d4cb6b0 100644 --- a/tests/Stub/Adr/StubMetaDataArchitecturalDecision.php +++ b/tests/Stub/Adr/StubMetaDataArchitecturalDecision.php @@ -22,7 +22,6 @@ public function getStatus() : string|DecisionStatus { public function setMetaData(DOMElement $meta) : void { $dom = $meta->ownerDocument; - assert(isset($dom)); $foo = $meta->appendChild( $dom->createElement('foo')