CoreFiles by mySites.guru
EvolvableLinkTrait.php84 lines, 1,633 bytes, from Joomla_4.3.3-Stable-Full_Package.zip
Raw History Compare with 4.3.2
md5
7001a4d2d1edb5e907afa6f3b055ee79
sha1
a72c8fc4bc24d864b6ec9655fcae6ba47ed1e423
sha256
4e5dd413f428ae75559eb39dad698bc019fa3237b4f776d08533908ce8bdf882
<?php


namespace Fig\Link;

use Psr\Link\EvolvableLinkInterface;

/**
 * Class EvolvableLinkTrait
 *
 * @implements EvolvableLinkInterface
 */
trait EvolvableLinkTrait
{
    use LinkTrait;

    /**
     * {@inheritdoc}
     *
     * @return EvolvableLinkInterface
     */
    public function withHref($href)
    {
        /** @var EvolvableLinkInterface $that */
        $that = clone($this);
        $that->href = $href;

        $that->templated = ($this->hrefIsTemplated($href));

        return $that;
    }

    /**
     * {@inheritdoc}
     *
     * @return EvolvableLinkInterface
     */
    public function withRel($rel)
    {
        /** @var EvolvableLinkInterface $that */
        $that = clone($this);
        $that->rel[$rel] = true;
        return $that;
    }

    /**
     * {@inheritdoc}
     *
     * @return EvolvableLinkInterface
     */
    public function withoutRel($rel)
    {
        /** @var EvolvableLinkInterface $that */
        $that = clone($this);
        unset($that->rel[$rel]);
        return $that;
    }

    /**
     * {@inheritdoc}
     *
     * @return EvolvableLinkInterface
     */
    public function withAttribute($attribute, $value)
    {
        /** @var EvolvableLinkInterface $that */
        $that = clone($this);
        $that->attributes[$attribute] = $value;
        return $that;
    }

    /**
     * {@inheritdoc}
     *
     * @return EvolvableLinkInterface
     */
    public function withoutAttribute($attribute)
    {
        /** @var EvolvableLinkInterface $that */
        $that = clone($this);
        unset($that->attributes[$attribute]);
        return $that;
    }
}

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.