Skip to content

Commit

Permalink
Fix psalm issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cspray committed Jun 3, 2024
1 parent ee2225f commit fab9bbd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/DocBlockArchitecturalDecision.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
3 changes: 1 addition & 2 deletions src/XmlDocumentGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
);
Expand Down
1 change: 0 additions & 1 deletion tests/Stub/Adr/StubMetaDataArchitecturalDecision.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit fab9bbd

Please sign in to comment.