private function generateImageLine(array $data): string
    {
        $images = '';

        if (\count($data['images']) > 1000) {
            $data['images'] = array_splice($data['images'], 1000);
        }

        $builder = [
            'url' => 'loc',
            'location' => 'geo_location',
        ];

        foreach ($data['images'] as $image) {
            $images .= '<image:image>';

            foreach ($image as $key => $element) {
                $images .= sprintf('<image:%1$s>%2$s</image:%1$s>', ($builder[$key] ?? $key), $element);
            }

            $images .= '</image:image>';
        }

        return sprintf('    '.'<url><loc>%s</loc>%s</url>'."\n", $data['url'], $images);
    }
private function generateImageLine(array $data): string
    {
        $images = '';

        if (\count($data['images']) > 1000) {
            $data['images'] = array_splice($data['images'], 1000);
        }

        $builder = [
            'url' => 'loc',
            'location' => 'geo_location',
        ];

        foreach ($data['images'] as $image) {
            $images .= '<image:image>';

            foreach ($image as $key => $element) {
                $images .= sprintf('<image:%1$s>%2$s</image:%1$s>', ($builder[$key] ?? $key), $element);
            }

            $images .= '</image:image>';
        }

        return sprintf('    '.'<url><loc>%s</loc>%s</url>'."\n", $data['url'], $images);
    }
private function generateImageLine ( array $ data ) : string { $ images = '' ; if ( \ count ( $ data [ 'images' ] ) > 1000 ) { $ data [ 'images' ] = array_splice ( $ data [ 'images' ] , 1000 ) ; } $ builder = [ 'url' => 'loc' , 'location' => 'geo_location' , ] ; foreach ( $ data [ 'images' ] as $ image ) { $ images .= '<image:image>' ; foreach ( $ image as $ key => $ element ) { $ images .= sprintf ( '<image:%1$s>%2$s</image:%1$s>' , ( $ builder [ $ key ] ?? $ key ) , $ element ) ; } $ images .= '</image:image>' ; } return sprintf ( '    ' . '<url><loc>%s</loc>%s</url>' . "\n" , $ data [ 'url' ] , $ images ) ; }
Generate image line of sitemap.

@param array $data List of parameters
Generate image line of sitemap .