Skip to content

Commit

Permalink
refactor: upgrade phpstan and fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
williarin committed Feb 11, 2022
1 parent 7d900c9 commit 41b6751
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "numberninecms/chapterone",
"type": "symfony-bundle",
"description": "ChapterOne is a full-featured starter theme for NumberNine CMS",
"license": "MIT",
"type": "symfony-bundle",
"keywords": [
"numbernine",
"theme",
Expand All @@ -10,7 +11,6 @@
"blogging",
"symfony"
],
"license": "MIT",
"authors": [
{
"name": "William Arin",
Expand All @@ -27,24 +27,24 @@
"nikic/php-parser": "^4.10",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpro/grumphp": "^1.0.0",
"phpstan/phpstan": "^0.12.25",
"phpstan/phpstan-doctrine": "^0.12.13",
"phpstan/phpstan-phpunit": "^0.12.8",
"phpstan/phpstan-symfony": "^0.12.6",
"phpstan/phpstan": "^1.4.6",
"phpstan/phpstan-doctrine": "^1.2.10",
"phpstan/phpstan-phpunit": "^1.0.0",
"phpstan/phpstan-symfony": "^1.1.5",
"phpunit/phpunit": "^9.4",
"roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "^3.5"
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"NumberNine\\ChapterOne\\": "src/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
},
"scripts": {
"test": "vendor/bin/grumphp run --no-interaction"
}
Expand Down
5 changes: 1 addition & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
includes:
- vendor/phpstan/phpstan-symfony/extension.neon
- vendor/phpstan/phpstan-symfony/rules.neon
- vendor/phpstan/phpstan-doctrine/extension.neon

parameters:
level: 8
paths:
- src
excludes_analyse:
excludePaths:
- src/Component/Product
- src/DataFixtures
doctrine:
objectManagerLoader: build/phpstan/doctrine-orm-bootstrap.php
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
7 changes: 5 additions & 2 deletions src/Component/Account/RegistrationForm/RegistrationForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ protected function handleSubmittedAndValidForm(Request $request): Response
$response = $this->userAuthenticator->authenticateUser($user);

/** @var RegistrationFormSuccessEvent $registrationFormSuccessEvent */
$registrationFormSuccessEvent = $this->eventDispatcher->dispatch(new RegistrationFormSuccessEvent($user, $response));
$registrationFormSuccessEvent = $this->eventDispatcher->dispatch(new RegistrationFormSuccessEvent(
$user,
$response,
));

return $registrationFormSuccessEvent->getResponse();
return $registrationFormSuccessEvent->getResponse() ?? throw new \Exception();
}
}
2 changes: 1 addition & 1 deletion src/Component/Content/Comments/Comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(
private FormFactoryInterface $formFactory,
private TokenStorageInterface $tokenStorage,
private EntityManagerInterface $entityManager,
private EventDispatcherInterface $eventDispatcher,
EventDispatcherInterface $eventDispatcher,
) {
parent::__construct($formFactory, $eventDispatcher);
}
Expand Down

0 comments on commit 41b6751

Please sign in to comment.