Skip to content

Commit

Permalink
Apply fixes from StyleCI (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
xnekv03 committed Sep 14, 2021
1 parent 3f8b2d7 commit 1a47b6b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions src/ApiNamedayClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,22 @@ public function searchByName(string $name, string $country): array
$response = $this->callApi(
'getdate',
[
'name' => $name,
'name' => $name,
'country' => $countryCode,
]
);

foreach ($response['data']['namedays'] as $nd) {
$results[] = [
'day' => $nd['day'],
'day' => $nd['day'],
'month' => $nd['month'],
'name' => $nd['name'],
'name' => $nd['name'],
];
}

return [
'calendar' => $countryCode,
'results' => $results ?? [],
'results' => $results ?? [],
];
}

Expand All @@ -80,7 +80,7 @@ private function countryCodeCheck(string $country): ?string

foreach ($this->countryList as $item) {
if (
! (
!(
strcasecmp($country, $item->countrycode)
&& strcasecmp($country, $item->name)
&& strcasecmp($country, $item->alpha3)
Expand Down Expand Up @@ -130,7 +130,7 @@ private function callApi(string $urlParameter, array $formParams = null): array
*/
public function specificDay(int $day, int $month, string $country): array
{
if (! checkdate($month, $day, 2016)) {
if (!checkdate($month, $day, 2016)) {
throw new InvalidArgumentException('Invalid date');
}

Expand All @@ -144,16 +144,16 @@ public function specificDay(int $day, int $month, string $country): array
$response = $this->callApi(
'namedays',
[
'day' => $date->day,
'month' => $date->month,
'day' => $date->day,
'month' => $date->month,
'country' => $countryCode,
]
);

return [
'data' => [
'day' => $date->day,
'month' => $date->month,
'day' => $date->day,
'month' => $date->month,
'name_'.$countryCode => $response['data']['namedays'][$countryCode],
],
];
Expand All @@ -176,7 +176,7 @@ public function tomorrow(string $country = null): array

private function todayTomorrowYesterday(Carbon $date, string $country = null): array
{
if (! is_null($country)) {
if (!is_null($country)) {
$countryCode = $this->countryCodeCheck($country);
if (is_null($countryCode)) {
throw new InvalidArgumentException('Invalid country code');
Expand All @@ -186,7 +186,7 @@ private function todayTomorrowYesterday(Carbon $date, string $country = null): a
$response = $this->callApi(
'namedays',
[
'day' => $date->day,
'day' => $date->day,
'month' => $date->month,
]
)['data']['namedays'];
Expand Down
24 changes: 12 additions & 12 deletions tests/SearchByNameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ public function simpleCallDataProvider()
'cz',
[
[
'day' => 24,
'day' => 24,
'month' => 5,
'name' => 'Jana',
'name' => 'Jana',
],
[
'day' => 24,
'day' => 24,
'month' => 6,
'name' => 'Jan',
'name' => 'Jan',
],
[
'day' => 6,
'day' => 6,
'month' => 7,
'name' => 'Upálení mistra Jana Husa',
'name' => 'Upálení mistra Jana Husa',
],
],
],
Expand All @@ -105,9 +105,9 @@ public function simpleCallDataProvider()
'sk',
[
[
'day' => 2,
'day' => 2,
'month' => 4,
'name' => 'Zita',
'name' => 'Zita',
],
],
],
Expand All @@ -116,15 +116,15 @@ public function simpleCallDataProvider()
'us',
[
[
'day' => 24,
'day' => 24,
'month' => 6,
'name' => 'Hans, Giovanna, Giovanni, Ian, Ivan, Jan, Jana, Jean, Jeanette, Jeannette,'
'name' => 'Hans, Giovanna, Giovanni, Ian, Ivan, Jan, Jana, Jean, Jeanette, Jeannette,'
.' Johan, John, Johnnie, Johnny, Juan, Juana, Juanita, Sean, Shana, Shane, Shanna, Yancy',
],
[
'day' => 11,
'day' => 11,
'month' => 11,
'name' => 'Chandler, Dallas, Jalen, Johnathan, Johnathon, '
'name' => 'Chandler, Dallas, Jalen, Johnathan, Johnathon, '
.'Jon, Jonatan, Jonathan, Jonathon, Jonte, Jorel, Jorrell, Lincoln',
],
],
Expand Down

0 comments on commit 1a47b6b

Please sign in to comment.