diff --git a/composer.json b/composer.json index 57ce310..153aa9d 100644 --- a/composer.json +++ b/composer.json @@ -40,6 +40,11 @@ } }, "scripts": { + "build": [ + "@static:analyze", + "@test", + "@test:mutation" + ], "test": [ "phpunit" ], diff --git a/composer.lock b/composer.lock index f6058f1..241ce35 100644 --- a/composer.lock +++ b/composer.lock @@ -12,7 +12,7 @@ "source": { "type": "git", "url": "git@github.com:aeon-php/calendar.git", - "reference": "32116e9f3fd7a893cb9b5cdb499660f2bcf0ac66" + "reference": "b19db0d696f866e392b977abab0649105e9bd08f" }, "require": { "php": ">=7.4.2", @@ -72,7 +72,7 @@ "immutable", "sleep" ], - "time": "2020-05-31T21:46:37+00:00" + "time": "2020-06-02T20:41:06+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2582,21 +2582,21 @@ }, { "name": "phpstan/phpstan-webmozart-assert", - "version": "0.12.4", + "version": "0.12.5", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-webmozart-assert.git", - "reference": "714e7a6b936931790855c8da958153dfb25fc953" + "reference": "d1644c76cefeec4cf12c609c75f60b0f11b511d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-webmozart-assert/zipball/714e7a6b936931790855c8da958153dfb25fc953", - "reference": "714e7a6b936931790855c8da958153dfb25fc953", + "url": "https://api.github.com/repos/phpstan/phpstan-webmozart-assert/zipball/d1644c76cefeec4cf12c609c75f60b0f11b511d7", + "reference": "d1644c76cefeec4cf12c609c75f60b0f11b511d7", "shasum": "" }, "require": { "php": "~7.1", - "phpstan/phpstan": "^0.12.6" + "phpstan/phpstan": "^0.12.24" }, "require-dev": { "consistence/coding-standard": "^3.7", @@ -2631,7 +2631,7 @@ "MIT" ], "description": "PHPStan webmozart/assert extension", - "time": "2020-05-04T08:30:18+00:00" + "time": "2020-06-02T20:02:11+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/src/Aeon/Calendar/Gregorian/Holidays.php b/src/Aeon/Calendar/Gregorian/Holidays.php index 9745ff5..982d973 100644 --- a/src/Aeon/Calendar/Gregorian/Holidays.php +++ b/src/Aeon/Calendar/Gregorian/Holidays.php @@ -6,6 +6,9 @@ use Aeon\Calendar\Gregorian\Holidays\Holiday; +/** + * @psalm-immutable + */ interface Holidays { public function isHoliday(Day $day) : bool; diff --git a/src/Aeon/Calendar/Gregorian/Holidays/GoogleCalendarRegionalHolidays.php b/src/Aeon/Calendar/Gregorian/Holidays/GoogleCalendarRegionalHolidays.php index f89fb53..71dc38e 100644 --- a/src/Aeon/Calendar/Gregorian/Holidays/GoogleCalendarRegionalHolidays.php +++ b/src/Aeon/Calendar/Gregorian/Holidays/GoogleCalendarRegionalHolidays.php @@ -9,6 +9,9 @@ use Aeon\Calendar\Gregorian\Holidays; use Webmozart\Assert\Assert; +/** + * @psalm-immutable + */ final class GoogleCalendarRegionalHolidays implements Holidays { /** @@ -38,6 +41,11 @@ function (string $countryCode) : string { $this->calendars = null; } + /** + * @param Day $day + * @return bool + * @throws HolidayYearException + */ public function isHoliday(Day $day) : bool { if ($this->calendars === null) { @@ -100,6 +108,7 @@ private function loadCalendars() : void } } + /** @psalm-suppress InaccessibleProperty */ private function loadCalendar(string $countryCode) : void { /**