phug-php/util

View on GitHub
Util/Partial/ValueTrait.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Phug\Util\Partial;

/**
 * Class ValueTrait.
 *
 * @template T of mixed
 */
trait ValueTrait
{
    use StaticMemberTrait;

    /**
     * @var T
     */
    private $value = null;

    /**
     * @return T
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * @return bool
     */
    public function hasStaticValue()
    {
        return $this->hasStaticMember('value');
    }

    /**
     * @param T $value
     *
     * @return $this
     */
    public function setValue($value)
    {
        $this->value = $value;

        return $this;
    }
}