diff --git a/.gitignore b/.gitignore index ea7c474c..830fae86 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /.phpcs.cache /infection-log.txt /phpstan.neon +/.phpunit.result.cache diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 53e89b0d..a6619605 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -8,7 +8,7 @@ build: rabbitmq: false mongodb: false php: - version: 7.2 + version: 7.4 cache: disabled: false directories: diff --git a/.travis.yml b/.travis.yml index 12ae7f13..a29a95f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ language: php sudo: false php: - - 7.2 + - 7.4 - nightly cache: diff --git a/README.md b/README.md index 8856d787..31160e83 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Latest Stable Version](https://img.shields.io/packagist/v/lcobucci/clock.svg?style=flat-square)](https://packagist.org/packages/lcobucci/clock) ![Branch master](https://img.shields.io/badge/branch-master-brightgreen.svg?style=flat-square) -[![Build Status](https://img.shields.io/travis/lcobucci/clock/master.svg?style=flat-square)](http://travis-ci.org/#!/lcobucci/clock) +[![Build Status](https://img.shields.io/travis/lcobucci/clock/master.svg?style=flat-square)](http://travis-ci.org/lcobucci/clock) [![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/lcobucci/clock/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/lcobucci/clock/?branch=master) [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/lcobucci/clock/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/lcobucci/clock/?branch=master) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/50e3ef67-0f42-48fe-ace5-0beb9f78d117/mini.png)](https://insight.sensiolabs.com/projects/50e3ef67-0f42-48fe-ace5-0beb9f78d117) diff --git a/composer.json b/composer.json index 55f9fc37..31051de8 100644 --- a/composer.json +++ b/composer.json @@ -10,16 +10,17 @@ } ], "require": { - "php": "^7.2" + "php": "^7.4" }, "require-dev": { - "infection/infection": "^0.13", - "lcobucci/coding-standard": "^1.0", - "phpstan/phpstan": "^0.10", - "phpstan/phpstan-deprecation-rules": "^0.10", - "phpstan/phpstan-phpunit": "^0.10", - "phpstan/phpstan-strict-rules": "^0.10", - "phpunit/phpunit": "^8.5.2" + "infection/infection": "^0.15", + "lcobucci/coding-standard": "^4.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^9.0" }, "autoload": { "psr-4": { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 52d355a4..673b56c6 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,9 +1,3 @@ -includes: - - vendor/phpstan/phpstan-phpunit/extension.neon - - vendor/phpstan/phpstan-phpunit/rules.neon - - vendor/phpstan/phpstan-strict-rules/rules.neon - - vendor/phpstan/phpstan-deprecation-rules/rules.neon - parameters: level: 7 paths: diff --git a/src/FrozenClock.php b/src/FrozenClock.php index 4de161a5..c6b90cb4 100644 --- a/src/FrozenClock.php +++ b/src/FrozenClock.php @@ -7,10 +7,7 @@ final class FrozenClock implements Clock { - /** - * @var DateTimeImmutable - */ - private $now; + private DateTimeImmutable $now; public function __construct(DateTimeImmutable $now) { diff --git a/src/SystemClock.php b/src/SystemClock.php index 3d38ef4c..460d5bc1 100644 --- a/src/SystemClock.php +++ b/src/SystemClock.php @@ -9,14 +9,11 @@ final class SystemClock implements Clock { - /** - * @var DateTimeZone - */ - private $timezone; + private DateTimeZone $timezone; public function __construct(?DateTimeZone $timezone = null) { - $this->timezone = $timezone ?: new DateTimeZone(date_default_timezone_get()); + $this->timezone = $timezone ?? new DateTimeZone(date_default_timezone_get()); } public function now(): DateTimeImmutable diff --git a/test/FrozenClockTest.php b/test/FrozenClockTest.php index 6b85fbae..fa168094 100644 --- a/test/FrozenClockTest.php +++ b/test/FrozenClockTest.php @@ -27,6 +27,7 @@ public function nowShouldReturnAlwaysTheSameObject(): void * @test * * @covers \Lcobucci\Clock\FrozenClock::setTo + * * @uses \Lcobucci\Clock\FrozenClock::__construct() * @uses \Lcobucci\Clock\FrozenClock::now */