-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #468 from yguedidi/add-phpstan
Add PHPStan
- Loading branch information
Showing
13 changed files
with
107 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
parameters: | ||
level: max | ||
paths: | ||
- src/ | ||
- tests/ | ||
|
||
includes: | ||
- vendor/phpstan/phpstan-deprecation-rules/rules.neon | ||
- vendor/phpstan/phpstan-phpunit/extension.neon | ||
- vendor/phpstan/phpstan-phpunit/rules.neon | ||
- vendor/phpstan/phpstan-strict-rules/rules.neon | ||
- vendor/phpstan/phpstan-symfony/extension.neon | ||
- vendor/phpstan/phpstan-symfony/rules.neon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
namespace Stof\DoctrineExtensionsBundle\EventListener; | ||
|
||
use Gedmo\Loggable\Loggable; | ||
use Gedmo\Loggable\LoggableListener; | ||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||
use Symfony\Component\HttpKernel\Event\RequestEvent; | ||
|
@@ -14,13 +15,21 @@ | |
* Sets the username from the security context by listening on kernel.request | ||
* | ||
* @author Christophe Coevoet <[email protected]> | ||
* | ||
* @phpstan-template T of Loggable|object | ||
*/ | ||
class LoggerListener implements EventSubscriberInterface | ||
{ | ||
/** @var AuthorizationCheckerInterface|null */ | ||
private $authorizationChecker; | ||
/** @var TokenStorageInterface|null */ | ||
private $tokenStorage; | ||
/** @var LoggableListener<T> */ | ||
private $loggableListener; | ||
|
||
/** | ||
* @param LoggableListener<T> $loggableListener | ||
*/ | ||
public function __construct(LoggableListener $loggableListener, TokenStorageInterface $tokenStorage = null, AuthorizationCheckerInterface $authorizationChecker = null) | ||
{ | ||
$this->loggableListener = $loggableListener; | ||
|
@@ -31,7 +40,7 @@ public function __construct(LoggableListener $loggableListener, TokenStorageInte | |
/** | ||
* @internal | ||
*/ | ||
public function onKernelRequest(RequestEvent $event) | ||
public function onKernelRequest(RequestEvent $event): void | ||
{ | ||
if (!$event->isMainRequest()) { | ||
return; | ||
|
@@ -48,9 +57,6 @@ public function onKernelRequest(RequestEvent $event) | |
} | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public static function getSubscribedEvents() | ||
{ | ||
return array( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.