diff --git a/lib/Meta/MetaEntry.php b/lib/Meta/MetaEntry.php index fa2a83a9..807acd8d 100644 --- a/lib/Meta/MetaEntry.php +++ b/lib/Meta/MetaEntry.php @@ -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; @@ -124,7 +122,7 @@ public function getTocs() : array */ public function getDepends() : array { - return array_values(array_unique($this->depends)); + return $this->depends; } /** diff --git a/tests/Builder/BuilderTest.php b/tests/Builder/BuilderTest.php index 5ea312b3..9e59f4d5 100644 --- a/tests/Builder/BuilderTest.php +++ b/tests/Builder/BuilderTest.php @@ -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; @@ -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"