Neoxygen\NeoClient\Formatter\Result::get PHP Method

get() public method

Returns the item or items bound to the given identifier, or $default if no items are bound.
public get ( string $identifier, mixed $default = null, boolean $singleAsArray = false ) : mixed
$identifier string
$default mixed A value to return if the identifier is not bound.
$singleAsArray boolean When true, always returns a single value as an array.
return mixed
    public function get($identifier, $default = null, $singleAsArray = false)
    {
        if (!array_key_exists($identifier, $this->identifiers)) {
            return $default;
        }
        if (is_array($this->identifiers[$identifier]) && 1 === count($this->identifiers[$identifier]) && $singleAsArray === false) {
            return array_values($this->identifiers[$identifier])[0];
        }
        return $this->identifiers[$identifier];
    }