diff --git a/plugins/OAuth2/Entity/Client.php b/plugins/OAuth2/Entity/Client.php index 27ef342a6e..be3c188f20 100644 --- a/plugins/OAuth2/Entity/Client.php +++ b/plugins/OAuth2/Entity/Client.php @@ -187,7 +187,7 @@ class Client extends Entity implements ClientEntityInterface // @codeCoverageIgnoreEnd // }}} Autocode - public function getIdentifier() + public function getIdentifier(): string { return $this->getId(); } diff --git a/plugins/OAuth2/Repository/Client.php b/plugins/OAuth2/Repository/Client.php index d0e396c1c3..dda5fa55c4 100644 --- a/plugins/OAuth2/Repository/Client.php +++ b/plugins/OAuth2/Repository/Client.php @@ -35,6 +35,7 @@ namespace Plugin\OAuth2\Repository; use App\Core\DB\DB; use App\Util\Exception\NotFoundException; +use League\OAuth2\Server\Entities\ClientEntityInterface; use League\OAuth2\Server\Repositories\ClientRepositoryInterface; use Plugin\OAuth2\Entity; @@ -63,7 +64,7 @@ class Client implements ClientRepositoryInterface * @throws \App\Util\Exception\DuplicateFoundException * @throws NotFoundException */ - public function getClientEntity($clientIdentifier) + public function getClientEntity($clientIdentifier): ?ClientEntityInterface { return DB::findOneBy(Entity\Client::class, ['id' => $clientIdentifier]); } diff --git a/src/Core/Form/FormTypeNonceExtension.php b/src/Core/Form/FormTypeNonceExtension.php index 0d5e5ca804..f4461068df 100644 --- a/src/Core/Form/FormTypeNonceExtension.php +++ b/src/Core/Form/FormTypeNonceExtension.php @@ -36,7 +36,7 @@ class FormTypeNonceExtension extends AbstractTypeExtension implements EventSubsc $builder->addEventSubscriber($this); } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [FormEvents::PRE_SUBMIT => 'preSubmit']; } diff --git a/src/Core/I18n/TransExtractor.php b/src/Core/I18n/TransExtractor.php index 04ee67aa19..71db8ba237 100644 --- a/src/Core/I18n/TransExtractor.php +++ b/src/Core/I18n/TransExtractor.php @@ -187,7 +187,7 @@ class TransExtractor extends AbstractFileExtractor implements ExtractorInterface /** * {@inheritDoc} */ - protected function extractFromDirectory($directory) + protected function extractFromDirectory($directory): iterable { $finder = new Finder(); return $finder->files()->name('*.php')->in($directory); diff --git a/src/DependencyInjection/Compiler/SchemaDefDriver.php b/src/DependencyInjection/Compiler/SchemaDefDriver.php index 351db20acf..ad4d41f9b3 100644 --- a/src/DependencyInjection/Compiler/SchemaDefDriver.php +++ b/src/DependencyInjection/Compiler/SchemaDefDriver.php @@ -96,7 +96,7 @@ class SchemaDefDriver extends StaticPHPDriver implements CompilerPassInterface * @param class-string $class_name * @param ClassMetadataInfo $metadata ClassMetadataInfo is the real type, but we need to override the method */ - public function loadMetadataForClass($class_name, ClassMetadata $metadata) + public function loadMetadataForClass($class_name, ClassMetadata $metadata): void { $schema = $class_name::schemaDef(); diff --git a/src/Entity/LocalUser.php b/src/Entity/LocalUser.php index 7db1a1fcf6..7cd27dfd66 100644 --- a/src/Entity/LocalUser.php +++ b/src/Entity/LocalUser.php @@ -408,7 +408,7 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs /** * Returns the roles granted to the user */ - public function getRoles() + public function getRoles(): array { return ActorLocalRoles::toArray($this->getActor()->getRoles()); } diff --git a/src/Security/Authenticator.php b/src/Security/Authenticator.php index a6de495cd5..faff3cc8ab 100644 --- a/src/Security/Authenticator.php +++ b/src/Security/Authenticator.php @@ -194,7 +194,7 @@ class Authenticator extends AbstractFormLoginAuthenticator implements Authentica ); } - protected function getLoginUrl() + protected function getLoginUrl(): string { return Router::url(self::LOGIN_ROUTE); } diff --git a/src/Twig/Extension.php b/src/Twig/Extension.php index 71493d98dd..e184eae9eb 100644 --- a/src/Twig/Extension.php +++ b/src/Twig/Extension.php @@ -38,14 +38,14 @@ use Twig\TwigTest; class Extension extends AbstractExtension { - public function getFilters() + public function getFilters(): array { return [ // new TwigFilter('foo', [GSRuntime::class, 'foo']), ]; } - public function getTests() + public function getTests(): array { return [ new TwigTest('instanceof', [Runtime::class, 'isInstanceOf']), diff --git a/src/Twig/Runtime.php b/src/Twig/Runtime.php index bb1007141e..cff8b79365 100644 --- a/src/Twig/Runtime.php +++ b/src/Twig/Runtime.php @@ -219,16 +219,17 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface /** * @codeCoverageIgnore */ - public function onKernelRequest(RequestEvent $event) + public function onKernelRequest(RequestEvent $event): RequestEvent { // Request is not a service, can't find a better way to get it $this->request = $event->getRequest(); + return $event; } /** * @codeCoverageIgnore */ - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [KernelEvents::REQUEST => 'onKernelRequest']; }