Skip to content

Commit

Permalink
TASK: persistent resource without persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
simstern committed May 1, 2023
1 parent dd44673 commit dd3e4c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Classes/Provider/ResourceFakerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ public function __construct(Generator $generator, array $options)
* A persistent resource
*
* @param string $fileName
* @param bool $withoutPersistenceEnabled
* @return PersistentResource|null
*/
public function persistentResource(string $fileName): ?PersistentResource
public function persistentResource(string $fileName, bool $withoutPersistenceEnabled = false): ?PersistentResource
{
if (substr($fileName, 0, 11) !== 'resource://') {
$fileName = $this->options['fixturePath'] . $fileName;
}

if ($this->options['persistenceEnabled'] === true) {
if ($this->options['persistenceEnabled'] === true || $withoutPersistenceEnabled === true) {
return $this->resourceManager->importResource($fileName);
} else {
return null;
Expand Down

0 comments on commit dd3e4c2

Please sign in to comment.