private function extractData(object $data): array
    {
        if ($data instanceof \stdClass) {
            return (array) $data;
        }

        $extracted = [];
        $reflection = new \ReflectionObject($data);
        foreach (
            $reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method
        ) {
            if (!$this->isGetMethod($method)) {
                continue;
            }

            $extracted[$this->getAttributeName($method)] = $method->invoke(
                $data
            );
        }

        return $extracted;
    }
private function extractData(object $data): array
    {
        if ($data instanceof \stdClass) {
            return (array) $data;
        }

        $extracted = [];
        $reflection = new \ReflectionObject($data);
        foreach (
            $reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method
        ) {
            if (!$this->isGetMethod($method)) {
                continue;
            }

            $extracted[$this->getAttributeName($method)] = $method->invoke(
                $data
            );
        }

        return $extracted;
    }
private function extractData ( object $ data ) : array { if ( $ data instanceof \ stdClass ) { return ( array ) $ data ; } $ extracted = [ ] ; $ reflection = new \ ReflectionObject ( $ data ) ; foreach ( $ reflection -> getMethods ( ReflectionMethod :: IS_PUBLIC ) as $ method ) { if ( ! $ this -> isGetMethod ( $ method ) ) { continue ; } $ extracted [ $ this -> getAttributeName ( $ method ) ] = $ method -> invoke ( $ data ) ; } return $ extracted ; }
Extract the object data to array.

@param object $data

@return array
Extract the object data to array .