Skip to content

Commit

Permalink
Modify code to meet standards
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Feb 1, 2024
1 parent 2e9f885 commit a6c4dbf
Show file tree
Hide file tree
Showing 41 changed files with 102 additions and 21 deletions.
4 changes: 3 additions & 1 deletion src/AbstractZodiac.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac;

use Carbon\Carbon;
Expand Down Expand Up @@ -39,7 +41,7 @@ abstract class AbstractZodiac
/**
* Determine if given date matches the current zodiac sign
*
* @param Carbon $date
* @param Carbon $date
* @return bool
*/
public function match(Carbon $date): bool
Expand Down
8 changes: 5 additions & 3 deletions src/Calculator.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac;

use Carbon\Carbon;
Expand All @@ -12,7 +14,7 @@ class Calculator
/**
* Get zodiac for given date
*
* @param mixed $date
* @param mixed $date
* @return AbstractZodiac
*/
public static function make($date): AbstractZodiac
Expand All @@ -23,7 +25,7 @@ public static function make($date): AbstractZodiac
/**
* Get zodiac for given date
*
* @param mixed $date
* @param mixed $date
* @return AbstractZodiac
*/
public function getZodiac($date): AbstractZodiac
Expand All @@ -45,7 +47,7 @@ protected function normalizeDate($date): Carbon
{
try {
return Carbon::parse($date);
} catch (InvalidFormatException $e) {
} catch (InvalidFormatException) {
throw new Exceptions\NotReadableException(
'Unable to create zodiac from value (' . $date . ')'
);
Expand Down
2 changes: 2 additions & 0 deletions src/Exceptions/NotReadableException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Exceptions;

class NotReadableException extends \RuntimeException
Expand Down
5 changes: 3 additions & 2 deletions src/Laravel/Traits/CanResolveZodiac.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Laravel\Traits;

use Intervention\Zodiac\AbstractZodiac;
use Intervention\Zodiac\Calculator as ZodiacCalculator;
use Intervention\Zodiac\Exceptions\NotReadableException;
use Intervention\Zodiac\Laravel\ZodiacFacade;

Expand All @@ -17,7 +18,7 @@ public function getZodiacAttribute(): ?AbstractZodiac

try {
return ZodiacFacade::make($birthday);
} catch (NotReadableException $e) {
} catch (NotReadableException) {
return null;
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/Laravel/ZodiacBridge.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Laravel;

use Illuminate\Contracts\Foundation\Application;
Expand All @@ -23,7 +25,7 @@ public function __construct(Application $app)
/**
* Make zodiac from input date
*
* @param mixed $date
* @param mixed $date
* @return AbstractZodiac
*/
public function make($date): AbstractZodiac
Expand Down
2 changes: 2 additions & 0 deletions src/Laravel/ZodiacFacade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Laravel;

use Illuminate\Support\Facades\Facade;
Expand Down
2 changes: 2 additions & 0 deletions src/Laravel/ZodiacServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Laravel;

use Illuminate\Support\ServiceProvider;
Expand Down
2 changes: 2 additions & 0 deletions src/Traits/CanTranslate.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Traits;

use Illuminate\Filesystem\Filesystem;
Expand Down
2 changes: 2 additions & 0 deletions src/Zodiacs/Aquarius.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Zodiacs;

use Intervention\Zodiac\AbstractZodiac;
Expand Down
2 changes: 2 additions & 0 deletions src/Zodiacs/Aries.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Zodiacs;

use Intervention\Zodiac\AbstractZodiac;
Expand Down
2 changes: 2 additions & 0 deletions src/Zodiacs/Cancer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Zodiacs;

use Intervention\Zodiac\AbstractZodiac;
Expand Down
4 changes: 3 additions & 1 deletion src/Zodiacs/Capricorn.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Zodiacs;

use Carbon\Carbon;
Expand Down Expand Up @@ -41,7 +43,7 @@ class Capricorn extends AbstractZodiac
* Since Capricorn extends over two different
* years we need some special logic
*
* @param Carbon $date
* @param Carbon $date
* @return bool
*/
public function match(Carbon $date): bool
Expand Down
2 changes: 2 additions & 0 deletions src/Zodiacs/Gemini.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Zodiacs;

use Intervention\Zodiac\AbstractZodiac;
Expand Down
2 changes: 2 additions & 0 deletions src/Zodiacs/Leo.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Zodiacs;

use Intervention\Zodiac\AbstractZodiac;
Expand Down
2 changes: 2 additions & 0 deletions src/Zodiacs/Libra.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Zodiacs;

use Intervention\Zodiac\AbstractZodiac;
Expand Down
2 changes: 2 additions & 0 deletions src/Zodiacs/Pisces.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Zodiacs;

use Intervention\Zodiac\AbstractZodiac;
Expand Down
2 changes: 2 additions & 0 deletions src/Zodiacs/Sagittarius.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Zodiacs;

use Intervention\Zodiac\AbstractZodiac;
Expand Down
2 changes: 2 additions & 0 deletions src/Zodiacs/Scorpio.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Zodiacs;

use Intervention\Zodiac\AbstractZodiac;
Expand Down
2 changes: 2 additions & 0 deletions src/Zodiacs/Taurus.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Zodiacs;

use Intervention\Zodiac\AbstractZodiac;
Expand Down
2 changes: 2 additions & 0 deletions src/Zodiacs/Virgo.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Intervention\Zodiac\Zodiacs;

use Intervention\Zodiac\AbstractZodiac;
Expand Down
24 changes: 13 additions & 11 deletions src/lang/bg/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Овен',
'taurus' => 'Телец',
'gemini' => 'Близнаци',
'cancer' => 'Рак',
'leo' => 'Лъв',
'virgo' => 'Дева',
'libra' => 'Везни',
'scorpio' => 'Скорпион',
'aries' => 'Овен',
'taurus' => 'Телец',
'gemini' => 'Близнаци',
'cancer' => 'Рак',
'leo' => 'Лъв',
'virgo' => 'Дева',
'libra' => 'Везни',
'scorpio' => 'Скорпион',
'sagittarius' => 'Стрелец',
'capricorn' => 'Козирог',
'aquarius' => 'Водолей',
'pisces' => 'Риби',
'capricorn' => 'Козирог',
'aquarius' => 'Водолей',
'pisces' => 'Риби',
];
2 changes: 2 additions & 0 deletions src/lang/de/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Widder',
'taurus' => 'Stier',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/dk/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Vædderen',
'taurus' => 'Tyren',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/en/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Aries',
'taurus' => 'Taurus',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/es/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Aries',
'taurus' => 'Tauro',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/fr/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Bélier',
'taurus' => 'Taureau',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/hr/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Ovan',
'taurus' => 'Bik',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/hu/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Kos',
'taurus' => 'Bika',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/it/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Ariete',
'taurus' => 'Toro',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/ja/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => '牡羊座',
'taurus' => '牡牛座',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/nl/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Ram',
'taurus' => 'Stier',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/pl/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Baran',
'taurus' => 'Byk',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/pt-BR/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Áries',
'taurus' => 'Touro',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/ru/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Овен',
'taurus' => 'Телец',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/sr/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Ovan',
'taurus' => 'Bik',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/tr/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Koç',
'taurus' => 'Boğa',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/uk/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Овен',
'taurus' => 'Телець',
Expand Down
2 changes: 2 additions & 0 deletions src/lang/vi/zodiacs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'aries' => 'Bạch Dương',
'taurus' => 'Kim Ngưu',
Expand Down

0 comments on commit a6c4dbf

Please sign in to comment.