From 2ceb453ee50e932fcb4c6c3fdbee7b2a4a50ce42 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 25 Aug 2019 11:16:57 +0200 Subject: [PATCH] [SecurityBundle] fix return type declarations --- .../DataCollector/SecurityDataCollector.php | 28 +++++++++++++------ .../Security/Factory/AbstractFactory.php | 4 +-- .../Factory/SecurityFactoryInterface.php | 8 +++--- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php b/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php index 937b34e42ae4..8bca2b2c19aa 100644 --- a/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php +++ b/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php @@ -231,7 +231,7 @@ public function getUser() /** * Gets the roles of the user. * - * @return array The roles + * @return array|Data */ public function getRoles() { @@ -241,7 +241,7 @@ public function getRoles() /** * Gets the inherited roles of the user. * - * @return array The inherited roles + * @return array|Data */ public function getInheritedRoles() { @@ -269,16 +269,25 @@ public function isAuthenticated() return $this->data['authenticated']; } + /** + * @return bool + */ public function isImpersonated() { return $this->data['impersonated']; } + /** + * @return string|null + */ public function getImpersonatorUser() { return $this->data['impersonator_user']; } + /** + * @return string|null + */ public function getImpersonationExitPath() { return $this->data['impersonation_exit_path']; @@ -287,7 +296,7 @@ public function getImpersonationExitPath() /** * Get the class name of the security token. * - * @return string The token + * @return string|Data|null The token */ public function getTokenClass() { @@ -297,7 +306,7 @@ public function getTokenClass() /** * Get the full security token class as Data object. * - * @return Data + * @return Data|null */ public function getToken() { @@ -307,7 +316,7 @@ public function getToken() /** * Get the logout URL. * - * @return string The logout URL + * @return string|null The logout URL */ public function getLogoutUrl() { @@ -317,7 +326,7 @@ public function getLogoutUrl() /** * Returns the FQCN of the security voters enabled in the application. * - * @return string[] + * @return string[]|Data */ public function getVoters() { @@ -337,7 +346,7 @@ public function getVoterStrategy() /** * Returns the log of the security decisions made by the access decision manager. * - * @return array + * @return array|Data */ public function getAccessDecisionLog() { @@ -347,13 +356,16 @@ public function getAccessDecisionLog() /** * Returns the configuration of the current firewall context. * - * @return array + * @return array|Data */ public function getFirewall() { return $this->data['firewall']; } + /** + * @return array|Data + */ public function getListeners() { return $this->data['listeners']; diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php index 3f7a51598352..5e07c6303f5a 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php @@ -130,9 +130,9 @@ abstract protected function getListenerId(); * @param ContainerBuilder $container * @param string $id * @param array $config - * @param string $defaultEntryPointId + * @param string|null $defaultEntryPointId * - * @return string the entry point id + * @return string|null the entry point id */ protected function createEntryPoint($container, $id, $config, $defaultEntryPointId) { diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php index 027fe6586896..533e8d0cfce1 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php @@ -24,10 +24,10 @@ interface SecurityFactoryInterface /** * Configures the container services required to use the authentication listener. * - * @param string $id The unique id of the firewall - * @param array $config The options array for the listener - * @param string $userProvider The service id of the user provider - * @param string $defaultEntryPoint + * @param string $id The unique id of the firewall + * @param array $config The options array for the listener + * @param string $userProvider The service id of the user provider + * @param string|null $defaultEntryPoint * * @return array containing three values: * - the provider id