Skip to content

Commit

Permalink
- update composer (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandraKozubal authored Aug 24, 2023
1 parent 0edd0d9 commit 2629936
Show file tree
Hide file tree
Showing 8 changed files with 249 additions and 189 deletions.
4 changes: 3 additions & 1 deletion app/Importers/BinBinDataImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ public function transform(): void

$provider = $this->load($cityName, $countryName);

if ($provider !== "") $existingCityProviders[] = $provider;
if ($provider !== "") {
$existingCityProviders[] = $provider;
}
}

$this->deleteMissingProviders(self::getProviderName(), $existingCityProviders);
Expand Down
2 changes: 1 addition & 1 deletion app/Importers/DataImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected function load(string $cityName, string $countryName, string $lat = "",
$cityId = $alternativeCityName->city_id;
$city = City::query()->where("id", $cityId)->first();

if ($city->country_id === $country->id){
if ($city->country_id === $country->id) {
$this->createProvider($cityId, self::getProviderName());
}
}
Expand Down
13 changes: 7 additions & 6 deletions app/Importers/RydeDataImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ public function transform(): void
if ($node->nodeName === "div") {
foreach ($node->childNodes as $div) {
if ($div->nodeName === "div") {
foreach ($div->childNodes as $city)
if ($city->nodeName === "h1") {
$cityName = trim($city->nodeValue);
$provider = $this->load($cityName, $this->countryName);
foreach ($div->childNodes as $city) {
if ($city->nodeName === "h1") {
$cityName = trim($city->nodeValue);
$provider = $this->load($cityName, $this->countryName);

if ($provider !== "") {
$existingCityProviders[] = $provider;
if ($provider !== "") {
$existingCityProviders[] = $provider;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/Importers/TierDataImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function transform(): void
}

foreach ($node->childNodes as $childNode) {
if (trim($childNode->nodeValue) !== ""){
if (trim($childNode->nodeValue) !== "") {
$cityName = trim($childNode->nodeValue);
$provider = $this->load($cityName, $this->countryName);

Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"require": {
"php": "^8.2",
"ext-pdo": "*",
"ammarfaizi2/googletranslate": "*",
"guzzlehttp/guzzle": "^7.7",
"inertiajs/inertia-laravel": "^0.6.9",
"laravel/framework": "^10.13.0",
Expand All @@ -18,7 +17,7 @@
"symfony/dom-crawler": "^6.3"
},
"require-dev": {
"blumilksoftware/codestyle": "^2.3.0",
"blumilksoftware/codestyle": "v2.5.0",
"fakerphp/faker": "^1.22.0",
"laravel/telescope": "^4.14",
"mockery/mockery": "^1.5.1",
Expand Down
Loading

0 comments on commit 2629936

Please sign in to comment.