susina/psr2-code-generator

View on GitHub
src/Model/Parts/ReferenceReturnPart.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php declare(strict_types=1);

namespace Susina\Codegen\Model\Parts;

/**
 * Reference return part.
 *
 * Keeps track whether the return value is a reference or not
 *
 * @author Thomas Gossmann
 */
trait ReferenceReturnPart
{
    /** @var bool */
    private $referenceReturned = false;

    /**
     * Set true if a reference is returned of false if not.
     *
     * @return $this
     */
    public function setReferenceReturned(bool $bool): self
    {
        $this->referenceReturned = (bool) $bool;

        return $this;
    }

    /**
     * Returns whether a reference is returned.
     */
    public function isReferenceReturned(): bool
    {
        return $this->referenceReturned;
    }
}