💚 Corrige via PHPCS
This commit is contained in:
parent
49248fb16b
commit
2decec3fab
@ -30,7 +30,8 @@ class Pap extends Parser
|
|||||||
$parsedHome = new ParsedHome();
|
$parsedHome = new ParsedHome();
|
||||||
$parsedHome->city = $annonce['_embedded']['place'][0]['title'];
|
$parsedHome->city = $annonce['_embedded']['place'][0]['title'];
|
||||||
//ex: Vente maison 110 m² Tréguier (22220)
|
//ex: Vente maison 110 m² Tréguier (22220)
|
||||||
$parsedHome->title = sprintf('%s %s %s m² %s',
|
$parsedHome->title = sprintf(
|
||||||
|
'%s %s %s m² %s',
|
||||||
ucfirst($annonce['produit']),
|
ucfirst($annonce['produit']),
|
||||||
$annonce['typebien'],
|
$annonce['typebien'],
|
||||||
$annonce['surface'],
|
$annonce['surface'],
|
||||||
@ -43,7 +44,7 @@ class Pap extends Parser
|
|||||||
$parsedHome->description = $annonce['texte'];
|
$parsedHome->description = $annonce['texte'];
|
||||||
$parsedHome->pictures = collect(
|
$parsedHome->pictures = collect(
|
||||||
$annonce['_embedded']['photo']
|
$annonce['_embedded']['photo']
|
||||||
)->map(static function($photo) {
|
)->map(static function ($photo) {
|
||||||
return $photo['_links']['self']['href'];
|
return $photo['_links']['self']['href'];
|
||||||
});
|
});
|
||||||
$location = $annonce['marker'];
|
$location = $annonce['marker'];
|
||||||
@ -53,7 +54,7 @@ class Pap extends Parser
|
|||||||
return $parsedHome;
|
return $parsedHome;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getIdAnnonceFromUrl($url)
|
private function getIdAnnonceFromUrl($url)
|
||||||
{
|
{
|
||||||
//ex: https://www.pap.fr/annonces/maison-treguier-22220-r432301732
|
//ex: https://www.pap.fr/annonces/maison-treguier-22220-r432301732
|
||||||
return substr(collect(explode('-', collect(array_filter(explode('/', $url)))->last()))->last(), 1);
|
return substr(collect(explode('-', collect(array_filter(explode('/', $url)))->last()))->last(), 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user