diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd00756..b5b9f8a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - php: [7.1, 7.2, 7.3, 7.4, 8.0] + php: [7.3, 7.4, 8.0] steps: - name: Checkout code diff --git a/.gitignore b/.gitignore index 87dc28f..ee17e23 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ vendor .idea .phpunit.result.cache +composer.lock composer.phar \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 018c1d5..ddda216 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.5 + +* Removed support for `PHP 7.1` and `PHP 7.2`. +* Use strict types in the source code. + ## 1.4 * Added **_Fluent Interface_** support, this allows you to add `it`'s and `should`'s chained to a `specify` or `describe`. diff --git a/LICENSE b/LICENSE index 525f855..01359eb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013-2020 Codeception PHP Testing Framework +Copyright (c) 2013-2021 Codeception PHP Testing Framework Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/README.md b/README.md index 393d193..74c4d2a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Inspired by MiniTest of Ruby now you combine BDD and classical TDD style in one ## Installation -*Requires PHP >= 7.1* +*Requires PHP >= 7.3* * Install with Composer: diff --git a/VERSION b/VERSION index 70d5b25..3e1ad72 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.3 \ No newline at end of file +1.5.0 \ No newline at end of file diff --git a/composer.json b/composer.json index a2821f2..4b9e0b6 100644 --- a/composer.json +++ b/composer.json @@ -14,9 +14,9 @@ } ], "require": { - "php": ">=7.1.0", - "myclabs/deep-copy": "~1.1", - "phpunit/phpunit": ">=7.0 <10.0" + "php": ">=7.3.0", + "myclabs/deep-copy": "^1.10", + "phpunit/phpunit": "^8.0|^9.0" }, "autoload": { "psr-0": { diff --git a/src/Codeception/Specify.php b/src/Codeception/Specify.php index 540a09c..81cfc72 100644 --- a/src/Codeception/Specify.php +++ b/src/Codeception/Specify.php @@ -1,4 +1,6 @@ -initValue = ($value === null ? $this->getValue() : $value); } - /** - * @return string - */ - public function getName() + public function getName(): string { return $this->property->getName(); } diff --git a/src/Codeception/Specify/ResultPrinter.php b/src/Codeception/Specify/ResultPrinter.php index e84a006..4ab43be 100644 --- a/src/Codeception/Specify/ResultPrinter.php +++ b/src/Codeception/Specify/ResultPrinter.php @@ -1,5 +1,7 @@ write($progress); $this->column++; @@ -25,6 +24,4 @@ protected function writeProgress(string $progress) : void } } } - - } diff --git a/src/Codeception/Specify/SpecifyHooks.php b/src/Codeception/Specify/SpecifyHooks.php index 5f7ab2d..6543c97 100644 --- a/src/Codeception/Specify/SpecifyHooks.php +++ b/src/Codeception/Specify/SpecifyHooks.php @@ -1,5 +1,7 @@ currentSpecifyTest; } + /** * @param string $specification * @param Closure|null $callable * @param callable|array $params */ - private function runSpec($specification, Closure $callable = null, $params = []) + private function runSpec(string $specification, Closure $callable = null, $params = []) { if (!$callable) { return; @@ -100,7 +100,7 @@ private function runSpec($specification, Closure $callable = null, $params = []) * @param $params * @return array */ - private function getSpecifyExamples($params) + private function getSpecifyExamples($params): array { if (isset($params['examples'])) { if (!is_array($params['examples'])) { @@ -111,10 +111,7 @@ private function getSpecifyExamples($params) return [[]]; } - /** - * @return ReflectionClass|null - */ - private function specifyGetPhpUnitReflection() + private function specifyGetPhpUnitReflection(): ?ReflectionClass { if ($this instanceof TestCase) { return new ReflectionClass(TestCase::class); @@ -137,7 +134,7 @@ private function specifyCheckMockObjects() /** * @param ObjectProperty[] $properties */ - private function specifyRestoreProperties($properties) + private function specifyRestoreProperties(array $properties) { foreach ($properties as $property) { $property->restoreValue(); @@ -147,7 +144,7 @@ private function specifyRestoreProperties($properties) /** * @return ObjectProperty[] */ - private function getSpecifyObjectProperties() + private function getSpecifyObjectProperties(): array { $objectReflection = new ReflectionObject($this); $properties = $objectReflection->getProperties(); @@ -184,7 +181,7 @@ private function getSpecifyObjectProperties() return $clonedProperties; } - private function specifyGetClassPrivateProperties() + private function specifyGetClassPrivateProperties(): array { static $properties = []; @@ -201,7 +198,7 @@ private function specifyGetClassPrivateProperties() /** * @param ObjectProperty[] $properties */ - private function specifyCloneProperties($properties) + private function specifyCloneProperties(array $properties) { foreach ($properties as $property) { $propertyValue = $property->getValue(); diff --git a/src/Codeception/Specify/SpecifyTest.php b/src/Codeception/Specify/SpecifyTest.php index b5b470b..383d011 100644 --- a/src/Codeception/Specify/SpecifyTest.php +++ b/src/Codeception/Specify/SpecifyTest.php @@ -1,5 +1,7 @@ name; } - public function getName($withDataSet = true) + public function getName($withDataSet = true): string { if ($withDataSet && !empty($this->example)) { $exporter = new Exporter(); @@ -52,7 +54,7 @@ public function getName($withDataSet = true) * The return value is cast to an integer. * @since 5.1.0 */ - public function count() + public function count(): int { return 1; } diff --git a/tests/ObjectPropertyTest.php b/tests/ObjectPropertyTest.php index 7cd3e8a..c7e07a6 100644 --- a/tests/ObjectPropertyTest.php +++ b/tests/ObjectPropertyTest.php @@ -1,8 +1,10 @@