app/Action/DataProvider.php
/**
     * Public properties to array.
     *
     * @return array
     */
Public properties to array.
@return array
Public properties to array . @return array
public function toArray(): array
    {
        try{
            $reflection = new \ReflectionClass(static::class);
            $props = $reflection->getProperties(\ReflectionProperty::IS_PUBLIC);
            $array = [];
            foreach ($props as $prop) {
                $propName = $prop->getName();
                $array[$propName] = $this->{$propName};
            }
        }catch(\ReflectionException $exception){
            $array = [];
        }
        return $array;
    }
public function toArray ( ) : array { try { $ reflection = new \ ReflectionClass ( static :: class ) ; $ props = $ reflection -> getProperties ( \ ReflectionProperty :: IS_PUBLIC ) ; $ array = [ ] ; foreach ( $ props as $ prop ) { $ propName = $ prop -> getName ( ) ; $ array [ $ propName ] = $ this -> { $ propName } ; } } catch ( \ ReflectionException $ exception ) { $ array = [ ] ; } return $ array ; }
Public properties to array.
Public properties to array .