Skip to content

Commit

Permalink
removing array_unique
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Feb 2, 2019
1 parent 27979a9 commit 2c3d13a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions lib/Meta/MetaEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
use LogicException;
use function array_merge;
use function array_search;
use function array_unique;
use function array_values;
use function in_array;
use function is_array;
use function is_string;
Expand Down Expand Up @@ -124,7 +122,7 @@ public function getTocs() : array
*/
public function getDepends() : array
{
return array_values(array_unique($this->depends));
return $this->depends;
}

/**
Expand Down
6 changes: 4 additions & 2 deletions tests/Builder/BuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Doctrine\RST\Builder;
use Doctrine\RST\Meta\MetaEntry;
use Doctrine\Tests\RST\BaseBuilderTest;
use function array_unique;
use function array_values;
use function file_exists;
use function file_get_contents;
use function file_put_contents;
Expand Down Expand Up @@ -61,14 +63,14 @@ public function testCachedMetas() : void
'index',
'toc-glob',
'subdir/index',
], $metaEntries['introduction']->getDepends());
], array_values(array_unique($metaEntries['introduction']->getDepends())));

// assert the self-refs don't mess up dependencies
self::assertSame([
'subdir/index',
'index',
'subdir/file',
], $metaEntries['subdir/index']->getDepends());
], array_values(array_unique($metaEntries['subdir/index']->getDepends())));

// update meta cache to see that it was used
// Summary is the main header in "index.rst"
Expand Down

0 comments on commit 2c3d13a

Please sign in to comment.