public function addReference($identifier, $value, $overwrite = false)
    {
        if (array_key_exists($identifier, $this->references) && !$overwrite) {
            throw new \Exception("A reference with identifier '$identifier' already exists");
        }

        $this->references[$identifier] = $value;

        return true;
    }
public function addReference($identifier, $value, $overwrite = false)
    {
        if (array_key_exists($identifier, $this->references) && !$overwrite) {
            throw new \Exception("A reference with identifier '$identifier' already exists");
        }

        $this->references[$identifier] = $value;

        return true;
    }
public function addReference ( $ identifier , $ value , $ overwrite = false ) { if ( array_key_exists ( $ identifier , $ this -> references ) && ! $ overwrite ) { throw new \ Exception ( "A reference with identifier '$identifier' already exists" ) ; } $ this -> references [ $ identifier ] = $ value ; return true ; }
Add a reference to be retrieved later.

@param string $identifier The identifier of the reference
@param mixed $value The value of the reference
@param bool $overwrite do overwrite the existing ref if it exist without raising an exception
@return bool true if the reference is accepted by this resolver, otherwise false
@throws \Exception When there is a reference with the specified $identifier already.
Add a reference to be retrieved later .