CoreFiles by mySites.guru
GenericLinkProvider.php29 lines, 806 bytes, from Joomla_4.0.0-alpha2-Alpha-Full_Package.zip
Raw History Compare with 3.10.0-alpha9
md5
e62d7bc1502784fa4fb3405c26ff037f
sha1
4d514e9e2060d1f81741b4d0fa0d02d0062c1346
sha256
c045fe3f6e0795bf8568685f1e72c8ce579df737f755ea45a18de5eadc775147
<?php

namespace Fig\Link;

use Psr\Link\EvolvableLinkProviderInterface;
use Psr\Link\LinkInterface;

class GenericLinkProvider implements EvolvableLinkProviderInterface
{
    use EvolvableLinkProviderTrait;

    /**
     * Constructs a new link provider.
     *
     * @param LinkInterface[] $links
     *   Optionally, specify an initial set of links for this provider.
     *   Note that the keys of the array will be ignored.
     */
    public function __construct(array $links = [])
    {
        // This block will throw a type error if any item isn't a LinkInterface, by design.
        array_filter($links, function (LinkInterface $item) {
            return true;
        });

        $hashes = array_map('spl_object_hash', $links);
        $this->links = array_combine($hashes, $links);
    }
}

The same content is in 141 releases, Joomla 4.0.0-alpha2 to 4.4.14. See them all, or every version of this file.