Jyxo\Spl\Object::__get PHP Method

__get() public method

Returns a property value if it has a getter defined.
public __get ( string $name ) : mixed
$name string Property name
return mixed
    public function &__get(string $name)
    {
        $class = get_class($this);
        $name = ucfirst($name);
        // Return null if no getter is found
        $value = null;
        // Tests for possible getters
        static $types = ['get', 'is'];
        foreach ($types as $type) {
            $getter = $type . $name;
            if (self::hasMethod($class, $getter)) {
                // It's necessary to save the value to a variable first because of using &
                $value = $this->{$getter}();
                break;
            }
        }
        return $value;
    }