Allow external path implementations
parent
de8ad536d6
commit
93df980c8a
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Arokettu\Path\Helpers;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class DataTypeHelper
|
||||
{
|
||||
public static function iterableToNewListInstance(iterable $iterable): \SplDoublyLinkedList
|
||||
{
|
||||
if ($iterable instanceof \SplDoublyLinkedList) {
|
||||
return clone $iterable;
|
||||
}
|
||||
|
||||
$list = new \SplDoublyLinkedList();
|
||||
|
||||
foreach ($iterable as $value) {
|
||||
$list->push($value);
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Arokettu\Path;
|
||||
|
||||
interface RelativePathInterface extends PathInterface
|
||||
{
|
||||
public function isRoot(): bool;
|
||||
}
|
Loading…
Reference in New Issue