Merge pull request #11 from SignpostMarv/fix/void-is-reserved-word

Fix/void is reserved word
This commit is contained in:
Bruce Weirdan 2019-02-14 07:10:52 +02:00 committed by GitHub
commit 707b2472ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 63 additions and 29 deletions

View File

@ -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

View File

@ -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": {

View File

@ -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 = '') {}
}

View File

@ -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 = '') {}
}

View File

@ -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");

View File

@ -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);