Skip to content

Commit

Permalink
Change Rdf::read() to find Auxiliary Resources
Browse files Browse the repository at this point in the history
Previously this was done by `getMetaData`, but as that calls `read`, it makes more sens eto call it there.
This also makes for more consists return values.
  • Loading branch information
Potherca committed Aug 22, 2022
1 parent 2293045 commit 2a0b105
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Flysystem/Adapter/Rdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ final public function read($path)
'size' => strlen($contents), // filesize in bytes,
'type' => 'file',
];
$metaData = array_merge($metaData, $this->findAuxiliaryResources($path));
} else {
$metaData = $this->adapter->read($path);
}
Expand Down Expand Up @@ -186,7 +187,7 @@ final public function getMetadata($path)
// @CHECKME: Does it make more sense to call `guessMimeType` or should `getMimeType` be called?
$metadata = array_merge($metadata, ['mimetype' => $this->guessMimeType($path)], $this->read($path));
}
return array_merge($metadata, $this->findAuxiliaryResources($path));
return array_merge($metadata);
} else {
return $metadata;
}
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/Flysystem/Adapter/RdfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ public function testRdfAdapterShouldCallInnerAdapterAndGraphWhenNonProxyMethodsA
'path' => self::MOCK_PATH,
'size' => 2,
'type' => 'file',
'describedby' => '/mock/path.meta',
'acl' => '/mock/path.acl',
];

if ($method === 'getMimeType') {
Expand Down

0 comments on commit 2a0b105

Please sign in to comment.