public function getData()
    {
        $this->performGetRequest('/search.php?vpn=' . $this->plateNumber);

        $html = (string) $this->response->getBody();

        $crawler = new Crawler($html);
        $rawVehicleData = [];

        $nodeValues = $crawler->filter('table > tbody > tr')->each( function( $node, $i) {
                // Remove double spaces, and newline(s)
                $formData = trim(preg_replace('/\s+/', ' ', $node->text()));

                return $this->processData($formData);
                 
        });

        // Strip multi-dimensional data array into simple associative array.
        $vehicleData = [];
        foreach ($nodeValues as $index => $value) {
            foreach ($value as $key => $carData) {
                $vehicleData[$key] = $carData;
            }
        }

        return $vehicleData;
    }
public function getData()
    {
        $this->performGetRequest('/search.php?vpn=' . $this->plateNumber);

        $html = (string) $this->response->getBody();

        $crawler = new Crawler($html);
        $rawVehicleData = [];

        $nodeValues = $crawler->filter('table > tbody > tr')->each( function( $node, $i) {
                // Remove double spaces, and newline(s)
                $formData = trim(preg_replace('/\s+/', ' ', $node->text()));

                return $this->processData($formData);
                 
        });

        // Strip multi-dimensional data array into simple associative array.
        $vehicleData = [];
        foreach ($nodeValues as $index => $value) {
            foreach ($value as $key => $carData) {
                $vehicleData[$key] = $carData;
            }
        }

        return $vehicleData;
    }
public function getData ( ) { $ this -> performGetRequest ( '/search.php?vpn=' . $ this -> plateNumber ) ; $ html = ( string ) $ this -> response -> getBody ( ) ; $ crawler = new Crawler ( $ html ) ; $ rawVehicleData = [ ] ; $ nodeValues = $ crawler -> filter ( 'table > tbody > tr' ) -> each ( function ( $ node , $ i ) { // Remove double spaces, and newline(s) $ formData = trim ( preg_replace ( '/\s+/' , ' ' , $ node -> text ( ) ) ) ; return $ this -> processData ( $ formData ) ; } ) ; // Strip multi-dimensional data array into simple associative array. $ vehicleData = [ ] ; foreach ( $ nodeValues as $ index => $ value ) { foreach ( $ value as $ key => $ carData ) { $ vehicleData [ $ key ] = $ carData ; } } return $ vehicleData ; }
Get Raw Data
@param  none
@return array
Get Raw Data