CoreFiles by mySites.guru
LinkTrait.php63 lines, 1,104 bytes, from Joomla_6.2.0-beta1-Beta-Full_Package.zip
Raw History Compare with 6.1.0-beta3
md5
9fbf0aaa34e7ff34f1c2f19077168754
sha1
aad40ec73609588608af35e021b71fbf8bb1a168
sha256
4e60d71982e88262206b8d081551408e1b0fa73a859a4828cb49dbcebd6bd086
<?php

namespace Fig\Link;

use Psr\Link\LinkInterface;

/**
 * Class LinkTrait
 *
 * @inherits LinkInterface
 */
trait LinkTrait
{
    use TemplatedHrefTrait;

    private string $href = '';

    /**
     * The set of rels on this link.
     *
     * Note: Because rels are an exclusive set, we use the keys of the array
     * to store the rels that have been added, not the values. The values
     * are simply boolean true.  A rel is present if the key is set, false
     * otherwise.
     *
     * @var string[]
     */
    private array $rel = [];

    private array $attributes = [];

    /**
     * {@inheritdoc}
     */
    public function getHref(): string
    {
        return $this->href;
    }

    /**
     * {@inheritdoc}
     */
    public function isTemplated(): bool
    {
        return $this->hrefIsTemplated($this->href);
    }

    /**
     * {@inheritdoc}
     */
    public function getRels(): array
    {
        return array_keys($this->rel);
    }

    /**
     * {@inheritdoc}
     */
    public function getAttributes(): array
    {
        return $this->attributes;
    }
}

The same content is in 158 releases, Joomla 5.0.0-alpha1 to 6.3.0-alpha1. See them all, or every version of this file.