Skip to content

Commit

Permalink
Merge branch 'master' of github.com:BePark/flysystem-fallback-to-read…
Browse files Browse the repository at this point in the history
…-only-adapter
  • Loading branch information
jvb committed May 6, 2017
2 parents ca11568 + 126a76e commit b4223e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ReadOnlyFallbackAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ public function listContents($directory = '', $recursive = false)
$inverseRef = [];
foreach ($tmpResult as $index => $mainContent)
{
$inverseRef[ $mainContent[ 'path' ] ] = $index;
$inverseRef[$mainContent['path']] = $index;
}

$fallbackContents = $this->_readOnlyAdapter->listContents($directory, $recursive);
foreach ($fallbackContents as $fallbackContent)
{
if (!isset($inverseRef[ $fallbackContent[ 'path' ] ]))
if (!isset($inverseRef[$fallbackContent['path']]))
{
$tmpResult[] = $fallbackContent;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/units/ReadOnlyFallbackAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testHasPath(AdapterInterface $mainAdapter, AdapterInterface $rea
$this
->assert('test path existence on mainAdapter')
->given($this->calling($mainAdapter)->has = true,
$this->calling($readOnlyAdapter)->has = false)
$this->calling($readOnlyAdapter)->has = false)
->then
->boolean($this->testedInstance->has('/foo'))->isTrue
->mock($mainAdapter)->receive('has')->withIdenticalArguments('/foo')->once
Expand All @@ -43,7 +43,7 @@ public function testHasPath(AdapterInterface $mainAdapter, AdapterInterface $rea
$this
->assert('test none existing path')
->given($this->calling($mainAdapter)->has = false,
$this->calling($readOnlyAdapter)->has = false)
$this->calling($readOnlyAdapter)->has = false)
->then
->boolean($this->testedInstance->has('/foo'))->isFalse
->mock($mainAdapter)->receive('has')->withIdenticalArguments('/foo')->once
Expand Down

0 comments on commit b4223e2

Please sign in to comment.