From 06a9dba902f4cac0ba69d456c20cf176a01f4335 Mon Sep 17 00:00:00 2001 From: Alexey Kopytko Date: Wed, 7 Nov 2018 16:26:26 +0900 Subject: [PATCH 1/4] composer.json: relax requirements for PHP 7.0 --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index ed42592..59f6219 100644 --- a/composer.json +++ b/composer.json @@ -4,18 +4,18 @@ "version": "1.0.1", "type": "library", "require": { - "php": "^7.1", + "php": "^7.0", "nesbot/carbon": "^1.25" }, "require-dev": { - "phpunit/phpunit": "^7.0", + "phpunit/phpunit": "^6.5 || ^7.4", "phpmd/phpmd": "@stable", "squizlabs/php_codesniffer": "@stable", - "johnkary/phpunit-speedtrap": "^3.0", + "johnkary/phpunit-speedtrap": "^2.0 || ^3.0", "php-coveralls/php-coveralls": "^2.0", "guzzlehttp/guzzle": "^6.3", "psr/http-message": "^1.0", - "phpunit/phpunit-mock-objects": "^6.1", + "phpunit/phpunit-mock-objects": "^5.0 || ^6.1", "guzzlehttp/psr7": "^1.4" }, "suggest": { From f480b40c09b5005392c51f359f5e1a7c9ac890b9 Mon Sep 17 00:00:00 2001 From: Alexey Kopytko Date: Wed, 7 Nov 2018 16:26:57 +0900 Subject: [PATCH 2/4] PHP 7.0 can't bear optionals and void return type; work around them --- src/BusinessTime.php | 20 +++++++++---------- src/BusinessTimeFactory.php | 2 +- src/Constraint/Dates.php | 2 +- src/Constraint/DaysOfWeek.php | 2 +- src/Constraint/DaysOfYear.php | 2 +- src/Constraint/MonthsOfYear.php | 2 +- .../Narration/BusinessTimeNarrator.php | 4 ++-- src/Constraint/RangeConstraint.php | 2 +- src/Deadline/RecurringDeadline.php | 2 +- src/Remote/WebCalFi/WebCalFiConstraint.php | 4 ++-- .../Remote/WebCalFi/WebCalFiFactoryTest.php | 4 ++-- .../Unit/BusinessTime/AddBusinessDaysTest.php | 4 ++-- .../BusinessTime/AddBusinessHoursTest.php | 6 +++--- tests/Unit/BusinessTime/BusinessNameTest.php | 4 ++-- .../BusinessTime/DiffInBusinessDaysTest.php | 4 ++-- .../BusinessTime/DiffInBusinessHoursTest.php | 4 ++-- .../IsBusinessTimeDefaultTest.php | 2 +- .../BusinessTime/LengthOfBusinessDayTest.php | 10 +++++----- tests/Unit/BusinessTime/PrecisionTest.php | 6 +++--- tests/Unit/BusinessTime/RoundTest.php | 18 ++++++++--------- .../StartEndOfBusinessDayTest.php | 4 ++-- .../Unit/BusinessTime/SubBusinessDaysTest.php | 4 ++-- .../BusinessTime/SubBusinessHoursTest.php | 4 ++-- .../BusinessTimeFactoryTest.php | 6 +++--- .../BusinessTimePeriod/BusinessDaysTest.php | 6 +++--- .../BusinessTimePeriod/BusinessNameTest.php | 2 +- .../BusinessTimePeriod/SubPeriodsTest.php | 6 +++--- tests/Unit/Constraint/BetweenDatesTest.php | 2 +- .../Constraint/BetweenDaysOfMonthTest.php | 2 +- .../Unit/Constraint/BetweenDaysOfWeekTest.php | 2 +- .../Unit/Constraint/BetweenDaysOfYearTest.php | 2 +- .../Constraint/BetweenMonthsOfYearTest.php | 2 +- .../Unit/Constraint/BetweenTimesOfDayTest.php | 6 +++--- .../Composite/AndAlsoCombinationTest.php | 6 +++--- .../Constraint/Composite/CompositeAllTest.php | 6 +++--- .../Constraint/Composite/CompositeAnyTest.php | 6 +++--- .../Constraint/Composite/CompositeNotTest.php | 6 +++--- .../Composite/ExceptCombinationTest.php | 6 +++--- .../OrAlternativelyCombinationTest.php | 6 +++--- tests/Unit/Constraint/DatesTest.php | 2 +- tests/Unit/Constraint/DaysOfMonthTest.php | 2 +- tests/Unit/Constraint/DaysOfWeekTest.php | 2 +- tests/Unit/Constraint/DaysOfYearTest.php | 2 +- .../Unit/Constraint/FormatConstraintTest.php | 4 ++-- tests/Unit/Constraint/HoursOfDayTest.php | 2 +- tests/Unit/Constraint/MonthsOfYearTest.php | 2 +- .../Narration/DefaultNarratorTest.php | 4 ++-- tests/Unit/Constraint/WeekDaysTest.php | 2 +- tests/Unit/Constraint/WeekendsTest.php | 4 ++-- tests/Unit/Deadline/RecurringDeadlineTest.php | 8 ++++---- .../Remote/WebCalFi/WebCalFiFactoryTest.php | 8 ++++---- 51 files changed, 115 insertions(+), 115 deletions(-) diff --git a/src/BusinessTime.php b/src/BusinessTime.php index e7442c0..d383deb 100644 --- a/src/BusinessTime.php +++ b/src/BusinessTime.php @@ -265,7 +265,7 @@ public function subBusinessHours(float $businessHoursToSub): self * @return int */ public function diffInBusinessDays( - ?DateTimeInterface $time = null, + DateTimeInterface $time = null, bool $absolute = true ): int { return (int) $this->diffInPartialBusinessDays($time, $absolute); @@ -282,7 +282,7 @@ public function diffInBusinessDays( * @return int */ public function diffInBusinessHours( - ?DateTimeInterface $time = null, + DateTimeInterface $time = null, bool $absolute = true ): int { return (int) $this->diffInPartialBusinessHours($time, $absolute); @@ -302,7 +302,7 @@ public function diffInBusinessHours( * @return float */ public function diffInPartialBusinessDays( - ?DateTimeInterface $time = null, + DateTimeInterface $time = null, bool $absolute = true ): float { return $this->diffInBusinessTime($time, $absolute) @@ -321,7 +321,7 @@ public function diffInPartialBusinessDays( * @return float */ public function diffInPartialBusinessHours( - ?DateTimeInterface $time = null, + DateTimeInterface $time = null, bool $absolute = true ): float { return $this->diffInBusinessTime($time, $absolute) @@ -341,7 +341,7 @@ public function diffInPartialBusinessHours( * @return Interval */ public function diffBusiness( - ?DateTimeInterface $time = null, + DateTimeInterface $time = null, bool $absolute = true ): Interval { return Interval::seconds( @@ -404,7 +404,7 @@ public function endOfBusinessDay(): self * * @return BusinessTime */ - public function floor(?DateInterval $precision = null): self + public function floor(DateInterval $precision = null): self { $seconds = Interval::instance($precision ?: $this->precision()) ->inSeconds(); @@ -423,7 +423,7 @@ public function floor(?DateInterval $precision = null): self * * @return BusinessTime */ - public function round(?DateInterval $precision = null): self + public function round(DateInterval $precision = null): self { $seconds = Interval::instance($precision ?: $this->precision()) ->inSeconds(); @@ -445,7 +445,7 @@ public function round(?DateInterval $precision = null): self * * @return BusinessTime */ - public function ceil(?DateInterval $precision = null): self + public function ceil(DateInterval $precision = null): self { $seconds = Interval::instance($precision ?: $this->precision()) ->inSeconds(); @@ -509,7 +509,7 @@ public function setLengthOfBusinessDay(DateInterval $length): self * @return BusinessTime */ public function determineLengthOfBusinessDay( - ?DateTime $typicalDay = null + DateTime $typicalDay = null ): self { if ($typicalDay === null) { // Default to the length of a reasonable guess at a typical day. @@ -638,7 +638,7 @@ public static function fromDti(DateTimeInterface $dti): self * @return int */ private function diffInBusinessTime( - ?DateTimeInterface $time = null, + DateTimeInterface $time = null, bool $absolute = true ): int { // We're taking a basic approach with some variables and a loop here as diff --git a/src/BusinessTimeFactory.php b/src/BusinessTimeFactory.php index b50e946..ba7f675 100644 --- a/src/BusinessTimeFactory.php +++ b/src/BusinessTimeFactory.php @@ -22,7 +22,7 @@ class BusinessTimeFactory * @param BusinessTimeConstraint ...$constraints */ public function __construct( - ?Interval $precision = null, + Interval $precision = null, BusinessTimeConstraint ...$constraints ) { // Default to hour precision. diff --git a/src/Constraint/Dates.php b/src/Constraint/Dates.php index 7fd2cb8..b005a9c 100644 --- a/src/Constraint/Dates.php +++ b/src/Constraint/Dates.php @@ -17,7 +17,7 @@ */ class Dates extends FormatConstraint { - private const FORMAT = 'Y-m-d'; + const FORMAT = 'Y-m-d'; /** * @param string ...$dates e.g. '2018-05-23', '2019-04-01' diff --git a/src/Constraint/DaysOfWeek.php b/src/Constraint/DaysOfWeek.php index 15a76de..a46324c 100644 --- a/src/Constraint/DaysOfWeek.php +++ b/src/Constraint/DaysOfWeek.php @@ -9,7 +9,7 @@ */ class DaysOfWeek extends FormatConstraint { - public const NAME_INDEX = [ + const NAME_INDEX = [ 'Monday' => 1, 'Tuesday' => 2, 'Wednesday' => 3, diff --git a/src/Constraint/DaysOfYear.php b/src/Constraint/DaysOfYear.php index 610f934..c1ca372 100644 --- a/src/Constraint/DaysOfYear.php +++ b/src/Constraint/DaysOfYear.php @@ -19,7 +19,7 @@ */ class DaysOfYear extends FormatConstraint { - private const FORMAT = 'F j'; + const FORMAT = 'F j'; /** * @param string ...$daysOfYear e.g. "December 25th", "1st April" diff --git a/src/Constraint/MonthsOfYear.php b/src/Constraint/MonthsOfYear.php index 7bab109..55bb0c2 100644 --- a/src/Constraint/MonthsOfYear.php +++ b/src/Constraint/MonthsOfYear.php @@ -12,7 +12,7 @@ */ class MonthsOfYear extends FormatConstraint { - public const NAME_INDEX = [ + const NAME_INDEX = [ 'January' => 1, 'Jan' => 1, 'February' => 2, diff --git a/src/Constraint/Narration/BusinessTimeNarrator.php b/src/Constraint/Narration/BusinessTimeNarrator.php index 0a58622..eede31b 100644 --- a/src/Constraint/Narration/BusinessTimeNarrator.php +++ b/src/Constraint/Narration/BusinessTimeNarrator.php @@ -6,8 +6,8 @@ interface BusinessTimeNarrator { - public const DEFAULT_BUSINESS = 'business hours'; - public const DEFAULT_NON_BUSINESS = 'outside business hours'; + const DEFAULT_BUSINESS = 'business hours'; + const DEFAULT_NON_BUSINESS = 'outside business hours'; /** * Get a business-relevant description for the given time. diff --git a/src/Constraint/RangeConstraint.php b/src/Constraint/RangeConstraint.php index 48b345b..8991ef4 100644 --- a/src/Constraint/RangeConstraint.php +++ b/src/Constraint/RangeConstraint.php @@ -40,7 +40,7 @@ public function __construct(int $min, int $max) // Allow backwards order. if ($min > $max) { - [$min, $max] = [$max, $min]; + list ($min, $max) = [$max, $min]; } $this->min = $min; diff --git a/src/Deadline/RecurringDeadline.php b/src/Deadline/RecurringDeadline.php index 9c5fd1a..dead8e1 100644 --- a/src/Deadline/RecurringDeadline.php +++ b/src/Deadline/RecurringDeadline.php @@ -121,7 +121,7 @@ public function hasPassedBetween( public function firstTimePassedBetween( BusinessTime $start, BusinessTime $end - ): ?BusinessTime { + ) { $time = $start->copy(); while ($time->lte($end)) { if ($this->isDeadline($time)) { diff --git a/src/Remote/WebCalFi/WebCalFiConstraint.php b/src/Remote/WebCalFi/WebCalFiConstraint.php index e56040c..18690f2 100644 --- a/src/Remote/WebCalFi/WebCalFiConstraint.php +++ b/src/Remote/WebCalFi/WebCalFiConstraint.php @@ -12,7 +12,7 @@ */ class WebCalFiConstraint implements BusinessTimeConstraint, BusinessTimeNarrator { - private const FORMAT = 'Y-m-d'; + const FORMAT = 'Y-m-d'; /** @var WebCalFiDate[] */ private $dates = []; @@ -61,7 +61,7 @@ public function narrate(DateTimeInterface $time): string * * @return WebCalFiDate|null */ - private function dateFor(DateTimeInterface $time): ?WebCalFiDate + private function dateFor(DateTimeInterface $time) { if (isset($this->dates[$time->format(self::FORMAT)])) { return $this->dates[$time->format(self::FORMAT)]; diff --git a/tests/Functional/Remote/WebCalFi/WebCalFiFactoryTest.php b/tests/Functional/Remote/WebCalFi/WebCalFiFactoryTest.php index 734b348..92dff73 100644 --- a/tests/Functional/Remote/WebCalFi/WebCalFiFactoryTest.php +++ b/tests/Functional/Remote/WebCalFi/WebCalFiFactoryTest.php @@ -36,7 +36,7 @@ public function setUp() * * @throws \GuzzleHttp\Exception\GuzzleException */ - public function testUkHolidaysContainsChristmas(): void + public function testUkHolidaysContainsChristmas() { // Given we have a WebCalFiFactory; $factory = new WebCalFiFactory(new Client()); @@ -66,7 +66,7 @@ public function testUkHolidaysContainsChristmas(): void * * @throws \GuzzleHttp\Exception\GuzzleException */ - public function testUsHolidaysHolidaysContainsIndependenceDay(): void + public function testUsHolidaysHolidaysContainsIndependenceDay() { // Given we have a WebCalFiFactory; $factory = new WebCalFiFactory(new Client()); diff --git a/tests/Unit/BusinessTime/AddBusinessDaysTest.php b/tests/Unit/BusinessTime/AddBusinessDaysTest.php index 332cbc1..44bdcb8 100644 --- a/tests/Unit/BusinessTime/AddBusinessDaysTest.php +++ b/tests/Unit/BusinessTime/AddBusinessDaysTest.php @@ -22,7 +22,7 @@ class AddBusinessDaysTest extends TestCase public function testAddBusinessDayDefault( string $time, string $expectedNewTime - ): void { + ) { // Given we have a business time for a specific time; $businessTime = new BusinessTime($time); @@ -74,7 +74,7 @@ public function testAddBusinessDaysDefault( string $time, float $businessDaysToAdd, string $expectedNewTime - ): void { + ) { // Given we have a business time for a specific time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/BusinessTime/AddBusinessHoursTest.php b/tests/Unit/BusinessTime/AddBusinessHoursTest.php index eeae63e..d7a43a1 100644 --- a/tests/Unit/BusinessTime/AddBusinessHoursTest.php +++ b/tests/Unit/BusinessTime/AddBusinessHoursTest.php @@ -25,7 +25,7 @@ class AddBusinessHoursTest extends TestCase public function testAddBusinessHourDefault( string $time, string $expectedNewTime - ): void { + ) { // Given we have a business time for a specific time; $businessTime = new BusinessTime($time); @@ -88,7 +88,7 @@ public function testAddBusinessHoursDefault( string $time, float $businessHoursToAdd, string $expectedNewTime - ): void { + ) { // Given we have a business time for a specific time; $businessTime = new BusinessTime($time); @@ -162,7 +162,7 @@ public function testAddBusinessHoursConstraint( BusinessTimeConstraint $constraint, float $businessHoursToAdd, string $expectedNewTime - ): void { + ) { // Given we have a business time for a specific time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/BusinessTime/BusinessNameTest.php b/tests/Unit/BusinessTime/BusinessNameTest.php index 704bfbb..1a6231b 100644 --- a/tests/Unit/BusinessTime/BusinessNameTest.php +++ b/tests/Unit/BusinessTime/BusinessNameTest.php @@ -21,7 +21,7 @@ class BusinessNameTest extends TestCase public function testBusinessNameDefault( string $time, string $expectedBusinessName - ): void { + ) { // Given we have a business time for a particular time; $businessTime = new BusinessTime($time); @@ -58,7 +58,7 @@ public function businessNameDefaultProvider(): array * A fall-back business name should be used if there are no business time * constraints. */ - public function testFallBackBusinessName(): void + public function testFallBackBusinessName() { // Given we have a business time for a particular time; $businessTime = new BusinessTime('2018-05-23 13:00'); diff --git a/tests/Unit/BusinessTime/DiffInBusinessDaysTest.php b/tests/Unit/BusinessTime/DiffInBusinessDaysTest.php index dd9da69..b2ebd3a 100644 --- a/tests/Unit/BusinessTime/DiffInBusinessDaysTest.php +++ b/tests/Unit/BusinessTime/DiffInBusinessDaysTest.php @@ -23,7 +23,7 @@ public function testDiffInBusinessDaysDefault( string $day, string $otherDay, int $expectedDiff - ): void { + ) { // Given we have a business time for a particular day; $businessTime = new BusinessTime($day); @@ -100,7 +100,7 @@ public function testDiffInPartialBusinessDaysDefault( string $time, string $otherTime, float $expectedDiff - ): void { + ) { // Given we have a business time for a particular time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/BusinessTime/DiffInBusinessHoursTest.php b/tests/Unit/BusinessTime/DiffInBusinessHoursTest.php index 0a8f2d9..4c297c1 100644 --- a/tests/Unit/BusinessTime/DiffInBusinessHoursTest.php +++ b/tests/Unit/BusinessTime/DiffInBusinessHoursTest.php @@ -25,7 +25,7 @@ public function testDiffInBusinessHoursDefault( string $time, string $otherTime, int $expectedDiff - ): void { + ) { // Given we have a business time for a particular time; $businessTime = new BusinessTime($time); @@ -119,7 +119,7 @@ public function testDiffInPartialBusinessHoursDefault( string $time, string $otherTime, float $expectedDiff - ): void { + ) { // Given we have a business time for a particular time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/BusinessTime/IsBusinessTimeDefaultTest.php b/tests/Unit/BusinessTime/IsBusinessTimeDefaultTest.php index 9faf011..83c8466 100644 --- a/tests/Unit/BusinessTime/IsBusinessTimeDefaultTest.php +++ b/tests/Unit/BusinessTime/IsBusinessTimeDefaultTest.php @@ -19,7 +19,7 @@ class IsBusinessTimeDefaultTest extends TestCase public function testIsBusinessTimeDefault( string $time, bool $expectedToBeBusinessTime - ): void { + ) { // Given we have a time with default behaviour; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/BusinessTime/LengthOfBusinessDayTest.php b/tests/Unit/BusinessTime/LengthOfBusinessDayTest.php index dfbe915..655f936 100644 --- a/tests/Unit/BusinessTime/LengthOfBusinessDayTest.php +++ b/tests/Unit/BusinessTime/LengthOfBusinessDayTest.php @@ -19,7 +19,7 @@ class LengthOfBusinessDayTest extends TestCase /** * Test that the length of a business day is 8 hours by default. */ - public function testLengthOfBusinessDayDefault(): void + public function testLengthOfBusinessDayDefault() { // Given we have a business time with the default behaviour; $time = new BusinessTime(); @@ -44,7 +44,7 @@ public function testLengthOfBusinessDayDefault(): void public function testSetLengthOfBusinessDay( Interval $length, string $expectedDescription - ): void { + ) { // Given we have a business time; $time = new BusinessTime(); @@ -87,7 +87,7 @@ public function lengthOfBusinessDayProvider(): array public function testDetermineLengthOfBusinessDay( BusinessTimeConstraint $constraint, string $expectedDescription - ): void { + ) { // Given we have a business time with certain constraints; $time = new BusinessTime(); $time->setBusinessTimeConstraints($constraint); @@ -144,7 +144,7 @@ public function determineLengthOfBusinessDayProvider(): array /** * Should not be able to set a business day to zero length. */ - public function testCantSetZeroLengthBusinessDay(): void + public function testCantSetZeroLengthBusinessDay() { // We should get an error; $this->expectException(InvalidArgumentException::class); @@ -157,7 +157,7 @@ public function testCantSetZeroLengthBusinessDay(): void /** * Should not be able to set the length of a business day over one day. */ - public function testCantSetBusinessDayLengthOverOneDay(): void + public function testCantSetBusinessDayLengthOverOneDay() { // We should get an error; $this->expectException(InvalidArgumentException::class); diff --git a/tests/Unit/BusinessTime/PrecisionTest.php b/tests/Unit/BusinessTime/PrecisionTest.php index 902c9cf..45e20ba 100644 --- a/tests/Unit/BusinessTime/PrecisionTest.php +++ b/tests/Unit/BusinessTime/PrecisionTest.php @@ -15,7 +15,7 @@ class PrecisionTest extends TestCase /** * The default precision should be 1 hour. */ - public function testPrecisionDefault(): void + public function testPrecisionDefault() { // Given we have a business time with the default behaviour; $time = new BusinessTime(); @@ -36,7 +36,7 @@ public function testPrecisionDefault(): void public function testSetPrecision( DateInterval $precision, string $expectedDescription - ): void { + ) { // Given we have a business time instance; $time = new BusinessTime(); @@ -76,7 +76,7 @@ public function testPrecisionExamples( string $otherTime, DateInterval $precision, float $expectedHoursDiff - ): void { + ) { // Given we have a business time instance for a particular time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/BusinessTime/RoundTest.php b/tests/Unit/BusinessTime/RoundTest.php index b12bb20..c0a47ab 100644 --- a/tests/Unit/BusinessTime/RoundTest.php +++ b/tests/Unit/BusinessTime/RoundTest.php @@ -29,9 +29,9 @@ class RoundTest extends TestCase */ public function testFloor( string $time, - ?Interval $precision, - string $expectedFlooredTime - ): void { + Interval $precision = null, + string $expectedFlooredTime = '' + ) { // Given we have a business time instance for a specific time; $businessTime = new BusinessTime($time); @@ -88,9 +88,9 @@ public function floorProvider(): array */ public function testRound( string $time, - ?Interval $precision, - string $expectedRoundedTime - ): void { + Interval $precision = null, + string $expectedRoundedTime = '' + ) { // Given we have a business time instance for a specific time; $businessTime = new BusinessTime($time); @@ -147,9 +147,9 @@ public function roundProvider(): array */ public function testCeil( string $time, - ?Interval $precision, - string $expectedCeilTime - ): void { + Interval $precision = null, + string $expectedCeilTime = '' + ) { // Given we have a business time instance for a specific time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/BusinessTime/StartEndOfBusinessDayTest.php b/tests/Unit/BusinessTime/StartEndOfBusinessDayTest.php index 1e5bc92..e2402c4 100644 --- a/tests/Unit/BusinessTime/StartEndOfBusinessDayTest.php +++ b/tests/Unit/BusinessTime/StartEndOfBusinessDayTest.php @@ -23,7 +23,7 @@ class StartEndOfBusinessDayTest extends TestCase public function testStartOfBusinessDayDefault( string $time, string $expectedStartOfBusinessDay - ): void { + ) { // Given we have a business time for a particular time; $businessTime = new BusinessTime($time); @@ -79,7 +79,7 @@ public function startOfBusinessDayProvider(): array public function testEndOfBusinessDayDefault( string $time, string $expectedEndOfBusinessDay - ): void { + ) { // Given we have a business time for a particular time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/BusinessTime/SubBusinessDaysTest.php b/tests/Unit/BusinessTime/SubBusinessDaysTest.php index d56c13e..e08c466 100644 --- a/tests/Unit/BusinessTime/SubBusinessDaysTest.php +++ b/tests/Unit/BusinessTime/SubBusinessDaysTest.php @@ -22,7 +22,7 @@ class SubBusinessDaysTest extends TestCase public function testSubBusinessDayDefault( string $time, string $expectedNewTime - ): void { + ) { // Given we have a business time for a specific time; $businessTime = new BusinessTime($time); @@ -75,7 +75,7 @@ public function testSubBusinessDaysDefault( string $time, float $businessDaysToSub, string $expectedNewTime - ): void { + ) { // Given we have a business time for a specific time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/BusinessTime/SubBusinessHoursTest.php b/tests/Unit/BusinessTime/SubBusinessHoursTest.php index 5b29b17..8a4e3f8 100644 --- a/tests/Unit/BusinessTime/SubBusinessHoursTest.php +++ b/tests/Unit/BusinessTime/SubBusinessHoursTest.php @@ -23,7 +23,7 @@ class SubBusinessHoursTest extends TestCase public function testSubBusinessHourDefault( string $time, string $expectedNewTime - ): void { + ) { // Given we have a business time for a specific time; $businessTime = new BusinessTime($time); @@ -82,7 +82,7 @@ public function testSubBusinessHoursDefault( string $time, float $businessHoursToSub, string $expectedNewTime - ): void { + ) { // Given we have a business time for a specific time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/BusinessTimeFactory/BusinessTimeFactoryTest.php b/tests/Unit/BusinessTimeFactory/BusinessTimeFactoryTest.php index 02e5da2..c15e792 100644 --- a/tests/Unit/BusinessTimeFactory/BusinessTimeFactoryTest.php +++ b/tests/Unit/BusinessTimeFactory/BusinessTimeFactoryTest.php @@ -16,7 +16,7 @@ class BusinessTimeFactoryTest extends TestCase /** * Should be able to make a business time instance. */ - public function testMake(): void + public function testMake() { // Given we have a business time factory; $factory = new BusinessTimeFactory(); @@ -35,7 +35,7 @@ public function testMake(): void /** * Should be able to make a business time instance for the current time. */ - public function testNow(): void + public function testNow() { // Given we have a business time factory; $factory = new BusinessTimeFactory(); @@ -55,7 +55,7 @@ public function testNow(): void /** * Should be able to serialize and deserialize the factory. */ - public function testSerialization(): void + public function testSerialization() { // Given we have a business time factory; $factory = new BusinessTimeFactory(); diff --git a/tests/Unit/BusinessTimePeriod/BusinessDaysTest.php b/tests/Unit/BusinessTimePeriod/BusinessDaysTest.php index ac68fb9..b622d1c 100644 --- a/tests/Unit/BusinessTimePeriod/BusinessDaysTest.php +++ b/tests/Unit/BusinessTimePeriod/BusinessDaysTest.php @@ -23,7 +23,7 @@ public function testBusinessDaysDefault( string $startTime, string $endTime, array $expectedBusinessDays - ): void { + ) { // Given we have a business time period with a particular start and end; $timePeriod = BusinessTimePeriod::fromStrings($startTime, $endTime); @@ -76,7 +76,7 @@ public function testNonBusinessDaysDefault( string $startTime, string $endTime, array $expectedBusinessDays - ): void { + ) { // Given we have a business time period with a particular start and end; $timePeriod = BusinessTimePeriod::fromStrings($startTime, $endTime); @@ -120,7 +120,7 @@ public function testDays( string $startTime, string $endTime, array $expectedDays - ): void { + ) { // Given we have a business time period with a particular start and end; $timePeriod = BusinessTimePeriod::fromStrings($startTime, $endTime); diff --git a/tests/Unit/BusinessTimePeriod/BusinessNameTest.php b/tests/Unit/BusinessTimePeriod/BusinessNameTest.php index 21c1bf0..a286838 100644 --- a/tests/Unit/BusinessTimePeriod/BusinessNameTest.php +++ b/tests/Unit/BusinessTimePeriod/BusinessNameTest.php @@ -23,7 +23,7 @@ public function testBusinessNameDefault( string $startTime, string $endTime, string $expectedBusinessName - ): void { + ) { // Given we have a business time period with a particular start and end; $timePeriod = BusinessTimePeriod::fromStrings($startTime, $endTime); diff --git a/tests/Unit/BusinessTimePeriod/SubPeriodsTest.php b/tests/Unit/BusinessTimePeriod/SubPeriodsTest.php index 14a97f7..d842f01 100644 --- a/tests/Unit/BusinessTimePeriod/SubPeriodsTest.php +++ b/tests/Unit/BusinessTimePeriod/SubPeriodsTest.php @@ -21,7 +21,7 @@ public function testBusinessPeriodsDefault( string $startTime, string $endTime, array $expectedBusinessPeriodTimings - ): void { + ) { // Given we have a business time period with a start and end time; $timePeriod = BusinessTimePeriod::fromStrings($startTime, $endTime); @@ -100,7 +100,7 @@ public function testNonBusinessPeriodsDefault( string $startTime, string $endTime, array $expectedNonBusinessPeriodTimings - ): void { + ) { // Given we have a business time period with a start and end time; $timePeriod = BusinessTimePeriod::fromStrings($startTime, $endTime); @@ -179,7 +179,7 @@ public function testSubPeriodsDefault( string $startTime, string $endTime, array $expectedSubPeriodTimings - ): void { + ) { // Given we have a business time period with a start and end time; $timePeriod = BusinessTimePeriod::fromStrings($startTime, $endTime); diff --git a/tests/Unit/Constraint/BetweenDatesTest.php b/tests/Unit/Constraint/BetweenDatesTest.php index 0a1199d..f15a235 100644 --- a/tests/Unit/Constraint/BetweenDatesTest.php +++ b/tests/Unit/Constraint/BetweenDatesTest.php @@ -24,7 +24,7 @@ public function testBetweenDates( string $minDate, string $maxDate, bool $shouldMatch - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/Constraint/BetweenDaysOfMonthTest.php b/tests/Unit/Constraint/BetweenDaysOfMonthTest.php index 2375446..1e42b3c 100644 --- a/tests/Unit/Constraint/BetweenDaysOfMonthTest.php +++ b/tests/Unit/Constraint/BetweenDaysOfMonthTest.php @@ -24,7 +24,7 @@ public function testBetweenDaysOfMonth( int $maxDayOfMonth, string $time, bool $shouldMatch - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/Constraint/BetweenDaysOfWeekTest.php b/tests/Unit/Constraint/BetweenDaysOfWeekTest.php index a6c7f24..1e87b03 100644 --- a/tests/Unit/Constraint/BetweenDaysOfWeekTest.php +++ b/tests/Unit/Constraint/BetweenDaysOfWeekTest.php @@ -24,7 +24,7 @@ public function testBetweenDaysOfWeek( string $minDayOfWeek, string $maxDayOfWeek, bool $shouldMatch - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/Constraint/BetweenDaysOfYearTest.php b/tests/Unit/Constraint/BetweenDaysOfYearTest.php index 6e3de24..45a23cc 100644 --- a/tests/Unit/Constraint/BetweenDaysOfYearTest.php +++ b/tests/Unit/Constraint/BetweenDaysOfYearTest.php @@ -24,7 +24,7 @@ public function testBetweenDaysOfYear( string $minDayOfYear, string $maxDayOfYear, bool $shouldMatch - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/Constraint/BetweenMonthsOfYearTest.php b/tests/Unit/Constraint/BetweenMonthsOfYearTest.php index fe03afc..580c32c 100644 --- a/tests/Unit/Constraint/BetweenMonthsOfYearTest.php +++ b/tests/Unit/Constraint/BetweenMonthsOfYearTest.php @@ -24,7 +24,7 @@ public function testBetweenTimesOfYear( string $minMonthOfYear, string $maxMonthOfYear, bool $shouldMatch - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/Constraint/BetweenTimesOfDayTest.php b/tests/Unit/Constraint/BetweenTimesOfDayTest.php index 0827021..be36376 100644 --- a/tests/Unit/Constraint/BetweenTimesOfDayTest.php +++ b/tests/Unit/Constraint/BetweenTimesOfDayTest.php @@ -25,7 +25,7 @@ public function testBetweenTimesOfDay( string $maxTimeOfDay, string $time, bool $shouldMatch - ): void { + ) { // Given we have a constraint for between times of the day; $constraint = new BetweenTimesOfDay($minTimeOfDay, $maxTimeOfDay); @@ -73,7 +73,7 @@ public function betweenTimesOfDayProvider(): array public function testBetweenTimesOfDayNarration( string $time, string $expectedNarration - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); @@ -119,7 +119,7 @@ public function betweenTimesOfDayNarrationProvider(): array * @param string $time * @param int $expectedMinute */ - public function testMinuteOfDay(string $time, int $expectedMinute): void + public function testMinuteOfDay(string $time, int $expectedMinute) { // When we get the minute of the day; $minuteOfTheDay = (new BetweenTimesOfDay())->minuteOfDay( diff --git a/tests/Unit/Constraint/Composite/AndAlsoCombinationTest.php b/tests/Unit/Constraint/Composite/AndAlsoCombinationTest.php index b386c00..62cd5bb 100644 --- a/tests/Unit/Constraint/Composite/AndAlsoCombinationTest.php +++ b/tests/Unit/Constraint/Composite/AndAlsoCombinationTest.php @@ -23,7 +23,7 @@ class AndAlsoCombinationTest extends TestCase * * @param BusinessTimeConstraint[] $additional */ - public function testAndAlsoAllMatch(array $additional): void + public function testAndAlsoAllMatch(array $additional) { // Given we have a constraint which matches a business time; $time = $this->wednesdayOnePm(); @@ -49,7 +49,7 @@ public function testAndAlsoAllMatch(array $additional): void * * @param BusinessTimeConstraint[] $additional */ - public function testAndAlsoNoneMatch(array $additional): void + public function testAndAlsoNoneMatch(array $additional) { // Given we have a constraint which matches a business time; $time = $this->wednesdayOnePm(); @@ -75,7 +75,7 @@ public function testAndAlsoNoneMatch(array $additional): void * * @param BusinessTimeConstraint[] $additional */ - public function testAndAlsoSomeMatch(array $additional): void + public function testAndAlsoSomeMatch(array $additional) { // Given we have a constraint which matches a business time; $time = $this->wednesdayOnePm(); diff --git a/tests/Unit/Constraint/Composite/CompositeAllTest.php b/tests/Unit/Constraint/Composite/CompositeAllTest.php index eccd588..15b9547 100644 --- a/tests/Unit/Constraint/Composite/CompositeAllTest.php +++ b/tests/Unit/Constraint/Composite/CompositeAllTest.php @@ -21,7 +21,7 @@ class CompositeAllTest extends TestCase * * @param BusinessTimeConstraint[] $constraints */ - public function testAllMatch(array $constraints): void + public function testAllMatch(array $constraints) { // Given we have a set of constraints; @@ -49,7 +49,7 @@ public function testAllMatch(array $constraints): void * * @param BusinessTimeConstraint[] $constraints */ - public function testNoneMatch(array $constraints): void + public function testNoneMatch(array $constraints) { // Given we have a set of constraints; @@ -80,7 +80,7 @@ public function testNoneMatch(array $constraints): void * * @param BusinessTimeConstraint[] $constraints */ - public function testSomeMatch(array $constraints): void + public function testSomeMatch(array $constraints) { // Given we have a set of constraints; diff --git a/tests/Unit/Constraint/Composite/CompositeAnyTest.php b/tests/Unit/Constraint/Composite/CompositeAnyTest.php index f683917..e484acf 100644 --- a/tests/Unit/Constraint/Composite/CompositeAnyTest.php +++ b/tests/Unit/Constraint/Composite/CompositeAnyTest.php @@ -21,7 +21,7 @@ class CompositeAnyTest extends TestCase * * @param BusinessTimeConstraint[] $constraints */ - public function testAllMatch(array $constraints): void + public function testAllMatch(array $constraints) { // Given we have a set of constraints; @@ -49,7 +49,7 @@ public function testAllMatch(array $constraints): void * * @param BusinessTimeConstraint[] $constraints */ - public function testNoneMatch(array $constraints): void + public function testNoneMatch(array $constraints) { // Given we have a set of constraints; @@ -80,7 +80,7 @@ public function testNoneMatch(array $constraints): void * * @param BusinessTimeConstraint[] $constraints */ - public function testSomeMatch(array $constraints): void + public function testSomeMatch(array $constraints) { // Given we have a set of constraints; diff --git a/tests/Unit/Constraint/Composite/CompositeNotTest.php b/tests/Unit/Constraint/Composite/CompositeNotTest.php index 80ff5db..c4a91ae 100644 --- a/tests/Unit/Constraint/Composite/CompositeNotTest.php +++ b/tests/Unit/Constraint/Composite/CompositeNotTest.php @@ -21,7 +21,7 @@ class CompositeNotTest extends TestCase * * @param BusinessTimeConstraint[] $constraints */ - public function testAllMatch(array $constraints): void + public function testAllMatch(array $constraints) { // Given we have a set of constraints; @@ -49,7 +49,7 @@ public function testAllMatch(array $constraints): void * * @param BusinessTimeConstraint[] $constraints */ - public function testNoneMatch(array $constraints): void + public function testNoneMatch(array $constraints) { // Given we have a set of constraints; @@ -80,7 +80,7 @@ public function testNoneMatch(array $constraints): void * * @param BusinessTimeConstraint[] $constraints */ - public function testSomeMatch(array $constraints): void + public function testSomeMatch(array $constraints) { // Given we have a set of constraints; diff --git a/tests/Unit/Constraint/Composite/ExceptCombinationTest.php b/tests/Unit/Constraint/Composite/ExceptCombinationTest.php index 69e8d03..6cf3da7 100644 --- a/tests/Unit/Constraint/Composite/ExceptCombinationTest.php +++ b/tests/Unit/Constraint/Composite/ExceptCombinationTest.php @@ -23,7 +23,7 @@ class ExceptCombinationTest extends TestCase * * @param BusinessTimeConstraint[] $exceptions */ - public function testExceptAllMatch(array $exceptions): void + public function testExceptAllMatch(array $exceptions) { // Given we have a constraint which matches a business time; $time = $this->wednesdayOnePm(); @@ -49,7 +49,7 @@ public function testExceptAllMatch(array $exceptions): void * * @param BusinessTimeConstraint[] $exceptions */ - public function testExceptNoneMatch(array $exceptions): void + public function testExceptNoneMatch(array $exceptions) { // Given we have a constraint which matches a business time; $time = $this->wednesdayOnePm(); @@ -75,7 +75,7 @@ public function testExceptNoneMatch(array $exceptions): void * * @param BusinessTimeConstraint[] $exceptions */ - public function testExceptSomeMatch(array $exceptions): void + public function testExceptSomeMatch(array $exceptions) { // Given we have a constraint which matches a business time; $time = $this->wednesdayOnePm(); diff --git a/tests/Unit/Constraint/Composite/OrAlternativelyCombinationTest.php b/tests/Unit/Constraint/Composite/OrAlternativelyCombinationTest.php index cca58c8..9c8c345 100644 --- a/tests/Unit/Constraint/Composite/OrAlternativelyCombinationTest.php +++ b/tests/Unit/Constraint/Composite/OrAlternativelyCombinationTest.php @@ -23,7 +23,7 @@ class OrAlternativelyCombinationTest extends TestCase * * @param BusinessTimeConstraint[] $alternatives */ - public function testOrAlternativelyAllMatch(array $alternatives): void + public function testOrAlternativelyAllMatch(array $alternatives) { // Given we have a constraint which does not match a business time; $time = $this->wednesdayOnePm(); @@ -49,7 +49,7 @@ public function testOrAlternativelyAllMatch(array $alternatives): void * * @param BusinessTimeConstraint[] $alternatives */ - public function testOrAlternativelyNoneMatch(array $alternatives): void + public function testOrAlternativelyNoneMatch(array $alternatives) { // Given we have a constraint which does not match a business time; $time = $this->wednesdayOnePm(); @@ -75,7 +75,7 @@ public function testOrAlternativelyNoneMatch(array $alternatives): void * * @param BusinessTimeConstraint[] $alternatives */ - public function testOrAlternativelySomeMatch(array $alternatives): void + public function testOrAlternativelySomeMatch(array $alternatives) { // Given we have a constraint which does not match a business time; $time = $this->wednesdayOnePm(); diff --git a/tests/Unit/Constraint/DatesTest.php b/tests/Unit/Constraint/DatesTest.php index 4d3fc02..15bf653 100644 --- a/tests/Unit/Constraint/DatesTest.php +++ b/tests/Unit/Constraint/DatesTest.php @@ -22,7 +22,7 @@ public function testDates( string $time, array $dates, bool $shouldMatch - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/Constraint/DaysOfMonthTest.php b/tests/Unit/Constraint/DaysOfMonthTest.php index 4ce7ebb..8cd6496 100644 --- a/tests/Unit/Constraint/DaysOfMonthTest.php +++ b/tests/Unit/Constraint/DaysOfMonthTest.php @@ -22,7 +22,7 @@ public function testDaysOfMonth( string $time, array $daysOfMonth, bool $shouldMatch - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/Constraint/DaysOfWeekTest.php b/tests/Unit/Constraint/DaysOfWeekTest.php index 4a76aa8..d4d848c 100644 --- a/tests/Unit/Constraint/DaysOfWeekTest.php +++ b/tests/Unit/Constraint/DaysOfWeekTest.php @@ -22,7 +22,7 @@ public function testDaysOfWeek( string $time, array $daysOfWeek, bool $shouldMatch - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/Constraint/DaysOfYearTest.php b/tests/Unit/Constraint/DaysOfYearTest.php index c5cbbc7..ba57486 100644 --- a/tests/Unit/Constraint/DaysOfYearTest.php +++ b/tests/Unit/Constraint/DaysOfYearTest.php @@ -22,7 +22,7 @@ public function testDaysOfYear( string $time, array $daysOfYear, bool $shouldMatch - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/Constraint/FormatConstraintTest.php b/tests/Unit/Constraint/FormatConstraintTest.php index 2d52e59..27d3a54 100644 --- a/tests/Unit/Constraint/FormatConstraintTest.php +++ b/tests/Unit/Constraint/FormatConstraintTest.php @@ -24,7 +24,7 @@ public function testFormatConstraint( string $format, array $patterns, bool $shouldMatch - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); @@ -79,7 +79,7 @@ public function testFormatConstraintNarration( string $time, string $format, string $expectedNarration - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/Constraint/HoursOfDayTest.php b/tests/Unit/Constraint/HoursOfDayTest.php index e27b211..82b5633 100644 --- a/tests/Unit/Constraint/HoursOfDayTest.php +++ b/tests/Unit/Constraint/HoursOfDayTest.php @@ -22,7 +22,7 @@ public function testHoursOfDay( string $time, array $hoursOfDay, bool $shouldMatch - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/Constraint/MonthsOfYearTest.php b/tests/Unit/Constraint/MonthsOfYearTest.php index 8c1d72b..d1b9c25 100644 --- a/tests/Unit/Constraint/MonthsOfYearTest.php +++ b/tests/Unit/Constraint/MonthsOfYearTest.php @@ -22,7 +22,7 @@ public function testMonthsOfYear( string $time, array $monthsOfYear, bool $shouldMatch - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/Constraint/Narration/DefaultNarratorTest.php b/tests/Unit/Constraint/Narration/DefaultNarratorTest.php index cec7275..1c4fe93 100644 --- a/tests/Unit/Constraint/Narration/DefaultNarratorTest.php +++ b/tests/Unit/Constraint/Narration/DefaultNarratorTest.php @@ -18,7 +18,7 @@ class DefaultNarratorTest extends TestCase * When the decorated constraint implements the narrator interface, then * that should be used. */ - public function testUsesNarrator(): void + public function testUsesNarrator() { // Given we have a constraint with narration; $constraint = new FormatConstraint('l'); @@ -45,7 +45,7 @@ public function testUsesNarrator(): void public function testOffersDefault( string $time, string $expectedNarration - ): void { + ) { // Given we have a constraint without narration; $constraint = new class() implements BusinessTimeConstraint { public function isBusinessTime(DateTimeInterface $time): bool diff --git a/tests/Unit/Constraint/WeekDaysTest.php b/tests/Unit/Constraint/WeekDaysTest.php index f772739..a98a08d 100644 --- a/tests/Unit/Constraint/WeekDaysTest.php +++ b/tests/Unit/Constraint/WeekDaysTest.php @@ -17,7 +17,7 @@ class WeekDaysTest extends TestCase * @param string $time * @param bool $shouldMatch */ - public function testWeekends(string $time, bool $shouldMatch): void + public function testWeekends(string $time, bool $shouldMatch) { // Given we have a business time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/Constraint/WeekendsTest.php b/tests/Unit/Constraint/WeekendsTest.php index 273252f..965aeb6 100644 --- a/tests/Unit/Constraint/WeekendsTest.php +++ b/tests/Unit/Constraint/WeekendsTest.php @@ -17,7 +17,7 @@ class WeekendsTest extends TestCase * @param string $time * @param bool $shouldMatch */ - public function testWeekends(string $time, bool $shouldMatch): void + public function testWeekends(string $time, bool $shouldMatch) { // Given we have a business time; $businessTime = new BusinessTime($time); @@ -60,7 +60,7 @@ public function weekendsProvider(): array public function testWeekendsNarration( string $time, string $expectedNarration - ): void { + ) { // Given we have a business time; $businessTime = new BusinessTime($time); diff --git a/tests/Unit/Deadline/RecurringDeadlineTest.php b/tests/Unit/Deadline/RecurringDeadlineTest.php index b3e7b45..148f84f 100644 --- a/tests/Unit/Deadline/RecurringDeadlineTest.php +++ b/tests/Unit/Deadline/RecurringDeadlineTest.php @@ -28,7 +28,7 @@ class RecurringDeadlineTest extends TestCase public function testNextDeadlineWeekDays11am( string $time, string $expectedNextDeadline - ): void { + ) { // Given we have a recurring deadline for weekdays at 11am; $deadline = new RecurringDeadline(new WeekDays(), new HoursOfDay(11)); @@ -104,7 +104,7 @@ public function nextDeadlineWeekDays11amProvider(): array public function testPreviousDeadlineWeekDays11am( string $time, string $expectedNextDeadline - ): void { + ) { // Given we have a recurring deadline for weekdays at 11am; $deadline = new RecurringDeadline(new WeekDays(), new HoursOfDay(11)); @@ -182,7 +182,7 @@ public function testHasPassedToday( string $now, array $constraints, bool $shouldHavePassed - ): void { + ) { // Given we have a recurring deadline; $deadline = new RecurringDeadline(...$constraints); @@ -246,7 +246,7 @@ public function testHasPassedBetween( string $start, string $end, bool $shouldHavePassed - ): void { + ) { // Given we have a recurring deadline; $deadline = new RecurringDeadline(new WeekDays(), new HoursOfDay(11)); diff --git a/tests/Unit/Remote/WebCalFi/WebCalFiFactoryTest.php b/tests/Unit/Remote/WebCalFi/WebCalFiFactoryTest.php index 987c17d..4d46ac0 100644 --- a/tests/Unit/Remote/WebCalFi/WebCalFiFactoryTest.php +++ b/tests/Unit/Remote/WebCalFi/WebCalFiFactoryTest.php @@ -35,7 +35,7 @@ public function setUp() * * @throws \GuzzleHttp\Exception\GuzzleException */ - public function testGetConstraintMocked(): void + public function testGetConstraintMocked() { // Given we have a WebCalFi constraint factory; $factory = new WebCalFiFactory($this->client); @@ -87,7 +87,7 @@ public function testGetConstraintMocked(): void * * @throws \GuzzleHttp\Exception\GuzzleException */ - public function testGetDatesMocked(): void + public function testGetDatesMocked() { // Given we have a WebCalFi constraint factory; $factory = new WebCalFiFactory($this->client); @@ -142,7 +142,7 @@ public function testGetDatesMocked(): void /** * @throws \GuzzleHttp\Exception\GuzzleException */ - public function testHttpStatusError(): void + public function testHttpStatusError() { // Given we have a WebCalFi constraint factory; $factory = new WebCalFiFactory($this->client); @@ -162,7 +162,7 @@ public function testHttpStatusError(): void /** * @throws \GuzzleHttp\Exception\GuzzleException */ - public function testBadJsonError(): void + public function testBadJsonError() { // Given we have a WebCalFi constraint factory; $factory = new WebCalFiFactory($this->client); From 30afe25295db7c08e939606fe36dd87aa27647a8 Mon Sep 17 00:00:00 2001 From: Alexey Kopytko Date: Wed, 7 Nov 2018 16:31:00 +0900 Subject: [PATCH 3/4] styleci changes --- src/Constraint/RangeConstraint.php | 2 +- src/Deadline/RecurringDeadline.php | 2 -- src/Remote/WebCalFi/WebCalFiConstraint.php | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Constraint/RangeConstraint.php b/src/Constraint/RangeConstraint.php index 8991ef4..0c5c44e 100644 --- a/src/Constraint/RangeConstraint.php +++ b/src/Constraint/RangeConstraint.php @@ -40,7 +40,7 @@ public function __construct(int $min, int $max) // Allow backwards order. if ($min > $max) { - list ($min, $max) = [$max, $min]; + list($min, $max) = [$max, $min]; } $this->min = $min; diff --git a/src/Deadline/RecurringDeadline.php b/src/Deadline/RecurringDeadline.php index dead8e1..974b4d2 100644 --- a/src/Deadline/RecurringDeadline.php +++ b/src/Deadline/RecurringDeadline.php @@ -129,8 +129,6 @@ public function firstTimePassedBetween( } $time = $time->add($time->precision()); } - - return null; } /** diff --git a/src/Remote/WebCalFi/WebCalFiConstraint.php b/src/Remote/WebCalFi/WebCalFiConstraint.php index 18690f2..4240e16 100644 --- a/src/Remote/WebCalFi/WebCalFiConstraint.php +++ b/src/Remote/WebCalFi/WebCalFiConstraint.php @@ -66,7 +66,5 @@ private function dateFor(DateTimeInterface $time) if (isset($this->dates[$time->format(self::FORMAT)])) { return $this->dates[$time->format(self::FORMAT)]; } - - return null; } } From 60ed6583fcb8f1beceb2356b1342145a427b8e2e Mon Sep 17 00:00:00 2001 From: Alexey Kopytko Date: Wed, 7 Nov 2018 16:31:53 +0900 Subject: [PATCH 4/4] And test on PHP 7.0 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index faaed9c..688b8fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: php php: + - 7.0 - 7.1 - 7.2 - 7.3