Skip to content

Commit

Permalink
Merge pull request #12 from shochdoerfer/feature/phpstan_strict
Browse files Browse the repository at this point in the history
Add phpstan/phpstan-strict-rules dependency
  • Loading branch information
shochdoerfer committed Feb 13, 2021
2 parents 80cc368 + 8c2e99b commit 5b75ee3
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 20 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
53 changes: 52 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
parameters:
level: 7
level: max
fileExtensions:
- php
paths:
- src

- src/bitExpert
- tests/bitExpert
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -64,7 +64,7 @@ public function setUp(): void
/**
* @test
*/
public function missingConfigurationStopsExecution()
public function missingConfigurationStopsExecution(): void
{
$this->action->expects(self::once())
->method('getOptions')
Expand All @@ -79,7 +79,7 @@ public function missingConfigurationStopsExecution()
/**
* @test
*/
public function configuredNameRegexWillTriggerValidation()
public function configuredNameRegexWillTriggerValidation(): void
{
$this->action->expects(self::once())
->method('getOptions')
Expand All @@ -96,7 +96,7 @@ public function configuredNameRegexWillTriggerValidation()
/**
* @test
*/
public function nameValidationWillNotThrowExceptionIfMatches()
public function nameValidationWillNotThrowExceptionIfMatches(): void
{
$this->action->expects(self::once())
->method('getOptions')
Expand All @@ -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')
Expand All @@ -132,7 +132,7 @@ public function nameValidationWillThrowExceptionIfNotMatches()
/**
* @test
*/
public function configuredEmailRegexWillTriggerValidation()
public function configuredEmailRegexWillTriggerValidation(): void
{
$this->action->expects(self::once())
->method('getOptions')
Expand All @@ -149,7 +149,7 @@ public function configuredEmailRegexWillTriggerValidation()
/**
* @test
*/
public function emailValidationWillNotThrowExceptionIfMatches()
public function emailValidationWillNotThrowExceptionIfMatches(): void
{
$this->action->expects(self::once())
->method('getOptions')
Expand All @@ -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')
Expand Down

0 comments on commit 5b75ee3

Please sign in to comment.