diff --git a/composer.json b/composer.json index 5ff53ea..63ecc17 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,8 @@ "phpstan/phpstan": "^0.12", "roave/security-advisories": "dev-latest", "infection/infection": "^0.21.0", - "bitexpert/captainhook-infection": "^0.1.0" + "bitexpert/captainhook-infection": "^0.1.0", + "phpstan/phpstan-strict-rules": "^0.12.9" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 61d2abd..3ecdd0e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d43eb9657658418d8d7bf05af6b234d5", + "content-hash": "a97cb9cd7ea666c7e1606f1febe1479e", "packages": [ { "name": "captainhook/captainhook", @@ -2346,6 +2346,57 @@ ], "time": "2021-01-24T14:55:37+00:00" }, + { + "name": "phpstan/phpstan-strict-rules", + "version": "0.12.9", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-strict-rules.git", + "reference": "0705fefc7c9168529fd130e341428f5f10f4f01d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/0705fefc7c9168529fd130e341428f5f10f4f01d", + "reference": "0705fefc7c9168529fd130e341428f5f10f4f01d", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "phpstan/phpstan": "^0.12.66" + }, + "require-dev": { + "phing/phing": "^2.16.3", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-phpunit": "^0.12.16", + "phpunit/phpunit": "^7.5.20" + }, + "type": "phpstan-extension", + "extra": { + "branch-alias": { + "dev-master": "0.12-dev" + }, + "phpstan": { + "includes": [ + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Extra strict and opinionated rules for PHPStan", + "support": { + "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/0.12.9" + }, + "time": "2021-01-13T08:50:28+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.5", diff --git a/phpstan.neon b/phpstan.neon index 97f8c70..29f9e4e 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,7 @@ parameters: - level: 7 + level: max + fileExtensions: + - php paths: - - src - + - src/bitExpert + - tests/bitExpert diff --git a/src/bitExpert/CaptainHook/ValidateAuthor/ValidateAuthorAction.php b/src/bitExpert/CaptainHook/ValidateAuthor/ValidateAuthorAction.php index b33f146..c24be40 100644 --- a/src/bitExpert/CaptainHook/ValidateAuthor/ValidateAuthorAction.php +++ b/src/bitExpert/CaptainHook/ValidateAuthor/ValidateAuthorAction.php @@ -28,7 +28,7 @@ class ValidateAuthorAction implements Action private $runner; /** - * Creates new {@link \bitExpert\CaptainHook\Validate\ValidateAuthorAction}. + * Creates new {@link \bitExpert\CaptainHook\ValidateAuthor\ValidateAuthorAction}. */ public function __construct() { diff --git a/tests/bitExpert/CaptainHook/ValidateAuthor/ValidateAuthorActionUnitTest.php b/tests/bitExpert/CaptainHook/ValidateAuthor/ValidateAuthorActionUnitTest.php index e159547..4430145 100644 --- a/tests/bitExpert/CaptainHook/ValidateAuthor/ValidateAuthorActionUnitTest.php +++ b/tests/bitExpert/CaptainHook/ValidateAuthor/ValidateAuthorActionUnitTest.php @@ -26,23 +26,23 @@ class ValidateAuthorActionUnitTest extends TestCase { /** - * @var Config|MockObject + * @var MockObject&Config */ private $config; /** - * @var IO|MockObject + * @var MockObject&IO */ private $io; /** - * @var Repository|MockObject + * @var MockObject&Repository */ private $repository; /** - * @var Action|MockObject + * @var MockObject&Action */ private $action; /** - * @var ValidateAuthorAction + * @var MockObject&ValidateAuthorAction */ private $hook; @@ -64,7 +64,7 @@ public function setUp(): void /** * @test */ - public function missingConfigurationStopsExecution() + public function missingConfigurationStopsExecution(): void { $this->action->expects(self::once()) ->method('getOptions') @@ -79,7 +79,7 @@ public function missingConfigurationStopsExecution() /** * @test */ - public function configuredNameRegexWillTriggerValidation() + public function configuredNameRegexWillTriggerValidation(): void { $this->action->expects(self::once()) ->method('getOptions') @@ -96,7 +96,7 @@ public function configuredNameRegexWillTriggerValidation() /** * @test */ - public function nameValidationWillNotThrowExceptionIfMatches() + public function nameValidationWillNotThrowExceptionIfMatches(): void { $this->action->expects(self::once()) ->method('getOptions') @@ -113,9 +113,9 @@ public function nameValidationWillNotThrowExceptionIfMatches() /** * @test */ - public function nameValidationWillThrowExceptionIfNotMatches() + public function nameValidationWillThrowExceptionIfNotMatches(): void { - self::expectException(RuntimeException::class); + $this->expectException(RuntimeException::class); $this->action->expects(self::once()) ->method('getOptions') @@ -132,7 +132,7 @@ public function nameValidationWillThrowExceptionIfNotMatches() /** * @test */ - public function configuredEmailRegexWillTriggerValidation() + public function configuredEmailRegexWillTriggerValidation(): void { $this->action->expects(self::once()) ->method('getOptions') @@ -149,7 +149,7 @@ public function configuredEmailRegexWillTriggerValidation() /** * @test */ - public function emailValidationWillNotThrowExceptionIfMatches() + public function emailValidationWillNotThrowExceptionIfMatches(): void { $this->action->expects(self::once()) ->method('getOptions') @@ -166,9 +166,9 @@ public function emailValidationWillNotThrowExceptionIfMatches() /** * @test */ - public function emailValidationWillThrowExceptionIfNotMatches() + public function emailValidationWillThrowExceptionIfNotMatches(): void { - self::expectException(RuntimeException::class); + $this->expectException(RuntimeException::class); $this->action->expects(self::once()) ->method('getOptions')