From 3510eef962cf18c5ac5bddcf5c2af21b588185cf Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Wed, 13 Feb 2019 20:54:38 +0000 Subject: [PATCH 1/4] before making change re: void is a reserved word, set package to be tested in the same environments as psalm in case anything else crops up --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index bfc6559..0768f45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,10 @@ language: php php: + - 7.0 + - 7.1 + - 7.2 - 7.3 + - 7.4snapshot before_install: - phpenv config-rm xdebug.ini || true From a7c87a2d0985b3819bcf2f21412c6c8d25cba2a9 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Wed, 13 Feb 2019 21:01:58 +0000 Subject: [PATCH 2/4] stripping trailing whitespace --- stubs/Assert.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/Assert.php b/stubs/Assert.php index 9bdd877..6d03be4 100644 --- a/stubs/Assert.php +++ b/stubs/Assert.php @@ -91,7 +91,7 @@ abstract class Assert * @psalm-assert !null $actual */ public static function assertNotNull($actual, $message = '') {} - + /** * Asserts that two variables are the same. * @@ -102,7 +102,7 @@ abstract class Assert * @psalm-assert =T $actual */ function assertSame($expected, $actual, $message = '') : void {} - + /** * Asserts that two variables are not the same. * From 3af740709d5f161138b236ebefecbffbf3ce35a6 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Wed, 13 Feb 2019 21:03:21 +0000 Subject: [PATCH 3/4] void is a reserved word --- stubs/Assert.php | 6 ++- stubs/Assert_75.php | 66 ++++++++++++++++++---------- tests/_support/Helper/Acceptance.php | 4 +- tests/acceptance/Assert.feature | 6 ++- 4 files changed, 56 insertions(+), 26 deletions(-) diff --git a/stubs/Assert.php b/stubs/Assert.php index 6d03be4..1b305dd 100644 --- a/stubs/Assert.php +++ b/stubs/Assert.php @@ -100,8 +100,9 @@ abstract class Assert * @param mixed $actual * @param string $message * @psalm-assert =T $actual + * @return void */ - function assertSame($expected, $actual, $message = '') : void {} + function assertSame($expected, $actual, $message = '') {} /** * Asserts that two variables are not the same. @@ -111,6 +112,7 @@ abstract class Assert * @param mixed $actual * @param string $message * @psalm-assert !=T $actual + * @return void */ - function assertNotSame($expected, $actual, $message = '') : void {} + function assertNotSame($expected, $actual, $message = '') {} } diff --git a/stubs/Assert_75.php b/stubs/Assert_75.php index cba3665..a69c05a 100644 --- a/stubs/Assert_75.php +++ b/stubs/Assert_75.php @@ -6,133 +6,155 @@ abstract class Assert /** * @param mixed $actual * @psalm-assert array $actual + * @return void */ - public static function assertIsArray($actual, string $message = ''): void {} + public static function assertIsArray($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert bool $actual + * @return void */ - public static function assertIsBool($actual, string $message = ''): void {} + public static function assertIsBool($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert float $actual + * @return void */ - public static function assertIsFloat($actual, string $message = ''): void {} + public static function assertIsFloat($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert int $actual + * @return void */ - public static function assertIsInt($actual, string $message = ''): void {} + public static function assertIsInt($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert numeric $actual + * @return void */ - public static function assertIsNumeric($actual, string $message = ''): void {} + public static function assertIsNumeric($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert object $actual + * @return void */ - public static function assertIsObject($actual, string $message = ''): void {} + public static function assertIsObject($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert resource $actual + * @return void */ - public static function assertIsResource($actual, string $message = ''): void {} + public static function assertIsResource($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert string $actual + * @return void */ - public static function assertIsString($actual, string $message = ''): void {} + public static function assertIsString($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert scalar $actual + * @return void */ - public static function assertIsScalar($actual, string $message = ''): void {} + public static function assertIsScalar($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert callable $actual + * @return void */ - public static function assertIsCallable($actual, string $message = ''): void {} + public static function assertIsCallable($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert iterable $actual + * @return void */ - public static function assertIsIterable($actual, string $message = ''): void {} + public static function assertIsIterable($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert !array $actual + * @return void */ - public static function assertIsNotArray($actual, string $message = ''): void {} + public static function assertIsNotArray($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert !bool $actual + * @return void */ - public static function assertIsNotBool($actual, string $message = ''): void {} + public static function assertIsNotBool($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert !float $actual + * @return void */ - public static function assertIsNotFloat($actual, string $message = ''): void {} + public static function assertIsNotFloat($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert !int $actual + * @return void */ - public static function assertIsNotInt($actual, string $message = ''): void {} + public static function assertIsNotInt($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert !numeric $actual + * @return void */ - public static function assertIsNotNumeric($actual, string $message = ''): void {} + public static function assertIsNotNumeric($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert !object $actual + * @return void */ - public static function assertIsNotObject($actual, string $message = ''): void {} + public static function assertIsNotObject($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert !resource $actual + * @return void */ - public static function assertIsNotResource($actual, string $message = ''): void {} + public static function assertIsNotResource($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert !string $actual + * @return void */ - public static function assertIsNotString($actual, string $message = ''): void {} + public static function assertIsNotString($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert !scalar $actual + * @return void */ - public static function assertIsNotScalar($actual, string $message = ''): void {} + public static function assertIsNotScalar($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert !callable $actual + * @return void */ - public static function assertIsNotCallable($actual, string $message = ''): void {} + public static function assertIsNotCallable($actual, string $message = '') {} /** * @param mixed $actual * @psalm-assert !iterable $actual + * @return void */ - public static function assertIsNotIterable($actual, string $message = ''): void {} + public static function assertIsNotIterable($actual, string $message = '') {} } diff --git a/tests/_support/Helper/Acceptance.php b/tests/_support/Helper/Acceptance.php index 7cc505a..1f457ad 100644 --- a/tests/_support/Helper/Acceptance.php +++ b/tests/_support/Helper/Acceptance.php @@ -20,8 +20,10 @@ class Acceptance extends \Codeception\Module /** * @Given /I have PHPUnit (newer than|older than) "([0-9.]+)" \(because of "([^"]+)"\)/ + * + * @return void */ - public function havePHPUnitOfACertainVersionRangeBecauseOf(string $operator, string $version, string $reason): void + public function havePHPUnitOfACertainVersionRangeBecauseOf(string $operator, string $version, string $reason) { if (!isset(self::VERSION_OPERATORS[$operator])) { throw new TestRuntimeException("Unknown operator: $operator"); diff --git a/tests/acceptance/Assert.feature b/tests/acceptance/Assert.feature index f71e149..9321dcc 100644 --- a/tests/acceptance/Assert.feature +++ b/tests/acceptance/Assert.feature @@ -18,7 +18,11 @@ Feature: Assert function f(): \Exception { return rand(0,1) ? new \RuntimeException : new \InvalidArgumentException; } - function acceptsRuntimeException(\RuntimeException $_e): void {} + + /** + * @return void + */ + function acceptsRuntimeException(\RuntimeException $_e) {} $e = f(); Assert::assertInstanceOf(\RuntimeException::class, $e); From 6fedf0633c4032743f53bc2f1ba1cef3aba74e0a Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Thu, 14 Feb 2019 07:01:11 +0200 Subject: [PATCH 4/4] depend on stable version of codeception module --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7cc55b2..c2ba005 100755 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "require-dev": { "squizlabs/php_codesniffer": "^3.3.1", "codeception/base": "^2.5", - "weirdan/codeception-psalm-module": "dev-master" + "weirdan/codeception-psalm-module": "^0.1.0" }, "extra": { "psalm": {