Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fde09a2

Browse filesBrowse files
committed
add parameter type declarations where possible
1 parent be50e2e commit fde09a2
Copy full SHA for fde09a2
Expand file treeCollapse file tree

17 files changed

+31
-47
lines changed

‎src/Symfony/Bundle/SecurityBundle/CacheWarmer/ExpressionCacheWarmer.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/CacheWarmer/ExpressionCacheWarmer.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function isOptional()
3434
return true;
3535
}
3636

37-
public function warmUp($cacheDir)
37+
public function warmUp(string $cacheDir)
3838
{
3939
foreach ($this->expressions as $expression) {
4040
$this->expressionLanguage->parse($expression, ['token', 'user', 'object', 'subject', 'roles', 'request', 'trust_resolver']);

‎src/Symfony/Bundle/SecurityBundle/Debug/WrappedListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Debug/WrappedListener.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __invoke(RequestEvent $event)
4545
/**
4646
* Proxies all method calls to the original listener.
4747
*/
48-
public function __call($method, $arguments)
48+
public function __call(string $method, array $arguments)
4949
{
5050
return $this->listener->{$method}(...$arguments);
5151
}

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php
+11-21Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ abstract class AbstractFactory implements SecurityFactoryInterface
4747
'failure_path_parameter' => '_failure_path',
4848
];
4949

50-
public function create(ContainerBuilder $container, $id, $config, $userProviderId, $defaultEntryPointId)
50+
public function create(ContainerBuilder $container, string $id, array $config, string $userProviderId, ?string $defaultEntryPointId)
5151
{
5252
// authentication provider
5353
$authProviderId = $this->createAuthProvider($container, $id, $config, $userProviderId);
@@ -89,7 +89,7 @@ public function addConfiguration(NodeDefinition $node)
8989
}
9090
}
9191

92-
final public function addOption($name, $default = null)
92+
final public function addOption(string $name, $default = null)
9393
{
9494
$this->options[$name] = $default;
9595
}
@@ -98,14 +98,9 @@ final public function addOption($name, $default = null)
9898
* Subclasses must return the id of a service which implements the
9999
* AuthenticationProviderInterface.
100100
*
101-
* @param ContainerBuilder $container
102-
* @param string $id The unique id of the firewall
103-
* @param array $config The options array for this listener
104-
* @param string $userProviderId The id of the user provider
105-
*
106101
* @return string never null, the id of the authentication provider
107102
*/
108-
abstract protected function createAuthProvider(ContainerBuilder $container, $id, $config, $userProviderId);
103+
abstract protected function createAuthProvider(ContainerBuilder $container, string $id, array $config, string $userProviderId);
109104

110105
/**
111106
* Subclasses must return the id of the abstract listener template.
@@ -128,14 +123,9 @@ abstract protected function getListenerId();
128123
* Subclasses may create an entry point of their as they see fit. The
129124
* default implementation does not change the default entry point.
130125
*
131-
* @param ContainerBuilder $container
132-
* @param string $id
133-
* @param array $config
134-
* @param string $defaultEntryPointId
135-
*
136-
* @return string the entry point id
126+
* @return string|null the entry point id
137127
*/
138-
protected function createEntryPoint($container, $id, $config, $defaultEntryPointId)
128+
protected function createEntryPoint(ContainerBuilder $container, string $id, array $config, ?string $defaultEntryPointId)
139129
{
140130
return $defaultEntryPointId;
141131
}
@@ -146,12 +136,12 @@ protected function createEntryPoint($container, $id, $config, $defaultEntryPoint
146136
*
147137
* @return bool Whether a possibly configured RememberMeServices should be set for this listener
148138
*/
149-
protected function isRememberMeAware($config)
139+
protected function isRememberMeAware(array $config)
150140
{
151141
return $config['remember_me'];
152142
}
153143

154-
protected function createListener($container, $id, $config, $userProvider)
144+
protected function createListener(ContainerBuilder $container, string $id, array $config, string $userProvider)
155145
{
156146
$listenerId = $this->getListenerId();
157147
$listener = new ChildDefinition($listenerId);
@@ -166,7 +156,7 @@ protected function createListener($container, $id, $config, $userProvider)
166156
return $listenerId;
167157
}
168158

169-
protected function createAuthenticationSuccessHandler($container, $id, $config)
159+
protected function createAuthenticationSuccessHandler(ContainerBuilder $container, string $id, array $config)
170160
{
171161
$successHandlerId = $this->getSuccessHandlerId($id);
172162
$options = array_intersect_key($config, $this->defaultSuccessHandlerOptions);
@@ -185,7 +175,7 @@ protected function createAuthenticationSuccessHandler($container, $id, $config)
185175
return $successHandlerId;
186176
}
187177

188-
protected function createAuthenticationFailureHandler($container, $id, $config)
178+
protected function createAuthenticationFailureHandler(ContainerBuilder $container, string $id, array $config)
189179
{
190180
$id = $this->getFailureHandlerId($id);
191181
$options = array_intersect_key($config, $this->defaultFailureHandlerOptions);
@@ -202,12 +192,12 @@ protected function createAuthenticationFailureHandler($container, $id, $config)
202192
return $id;
203193
}
204194

205-
protected function getSuccessHandlerId($id)
195+
protected function getSuccessHandlerId(string $id)
206196
{
207197
return 'security.authentication.success_handler.'.$id.'.'.str_replace('-', '_', $this->getKey());
208198
}
209199

210-
protected function getFailureHandlerId($id)
200+
protected function getFailureHandlerId(string $id)
211201
{
212202
return 'security.authentication.failure_handler.'.$id.'.'.str_replace('-', '_', $this->getKey());
213203
}

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginFactory.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function getListenerId()
5959
return 'security.authentication.listener.form';
6060
}
6161

62-
protected function createAuthProvider(ContainerBuilder $container, $id, $config, $userProviderId)
62+
protected function createAuthProvider(ContainerBuilder $container, string $id, array $config, string $userProviderId)
6363
{
6464
$provider = 'security.authentication.provider.dao.'.$id;
6565
$container
@@ -72,7 +72,7 @@ protected function createAuthProvider(ContainerBuilder $container, $id, $config,
7272
return $provider;
7373
}
7474

75-
protected function createListener($container, $id, $config, $userProvider)
75+
protected function createListener(ContainerBuilder $container, string $id, array $config, string $userProvider)
7676
{
7777
$listenerId = parent::createListener($container, $id, $config, $userProvider);
7878

@@ -84,7 +84,7 @@ protected function createListener($container, $id, $config, $userProvider)
8484
return $listenerId;
8585
}
8686

87-
protected function createEntryPoint($container, $id, $config, $defaultEntryPoint)
87+
protected function createEntryPoint(ContainerBuilder $container, string $id, array $config, ?string $defaultEntryPoint)
8888
{
8989
$entryPointId = 'security.authentication.form_entry_point.'.$id;
9090
$container

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginLdapFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginLdapFactory.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626
class FormLoginLdapFactory extends FormLoginFactory
2727
{
28-
protected function createAuthProvider(ContainerBuilder $container, $id, $config, $userProviderId)
28+
protected function createAuthProvider(ContainerBuilder $container, string $id, array $config, string $userProviderId)
2929
{
3030
$provider = 'security.authentication.provider.ldap_bind.'.$id;
3131
$definition = $container

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function addConfiguration(NodeDefinition $node)
5555
;
5656
}
5757

58-
public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint)
58+
public function create(ContainerBuilder $container, string $id, array $config, string $userProvider, ?string $defaultEntryPoint)
5959
{
6060
$authenticatorIds = $config['authenticators'];
6161
$authenticatorReferences = [];

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicFactory.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
class HttpBasicFactory implements SecurityFactoryInterface
2525
{
26-
public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint)
26+
public function create(ContainerBuilder $container, string $id, array $config, string $userProvider, ?string $defaultEntryPoint)
2727
{
2828
$provider = 'security.authentication.provider.dao.'.$id;
2929
$container
@@ -66,7 +66,7 @@ public function addConfiguration(NodeDefinition $node)
6666
;
6767
}
6868

69-
protected function createEntryPoint($container, $id, $config, $defaultEntryPoint)
69+
protected function createEntryPoint(ContainerBuilder $container, string $id, array $config, ?string $defaultEntryPoint)
7070
{
7171
if (null !== $defaultEntryPoint) {
7272
return $defaultEntryPoint;

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicLdapFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicLdapFactory.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
class HttpBasicLdapFactory extends HttpBasicFactory
2828
{
29-
public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint)
29+
public function create(ContainerBuilder $container, string $id, array $config, string $userProvider, ?string $defaultEntryPoint)
3030
{
3131
$provider = 'security.authentication.provider.ldap_bind.'.$id;
3232
$definition = $container

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/JsonLoginFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/JsonLoginFactory.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function getKey()
4949
/**
5050
* {@inheritdoc}
5151
*/
52-
protected function createAuthProvider(ContainerBuilder $container, $id, $config, $userProviderId)
52+
protected function createAuthProvider(ContainerBuilder $container, string $id, array $config, string $userProviderId)
5353
{
5454
$provider = 'security.authentication.provider.dao.'.$id;
5555
$container
@@ -81,7 +81,7 @@ protected function isRememberMeAware($config)
8181
/**
8282
* {@inheritdoc}
8383
*/
84-
protected function createListener($container, $id, $config, $userProvider)
84+
protected function createListener(ContainerBuilder $container, string $id, array $config, string $userProvider)
8585
{
8686
$listenerId = $this->getListenerId();
8787
$listener = new ChildDefinition($listenerId);

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/JsonLoginLdapFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/JsonLoginLdapFactory.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function getKey()
2727
return 'json-login-ldap';
2828
}
2929

30-
protected function createAuthProvider(ContainerBuilder $container, $id, $config, $userProviderId)
30+
protected function createAuthProvider(ContainerBuilder $container, string $id, array $config, string $userProviderId)
3131
{
3232
$provider = 'security.authentication.provider.ldap_bind.'.$id;
3333
$definition = $container

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class RememberMeFactory implements SecurityFactoryInterface
3131
'remember_me_parameter' => '_remember_me',
3232
];
3333

34-
public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint)
34+
public function create(ContainerBuilder $container, string $id, array $config, ?string $userProvider, ?string $defaultEntryPoint)
3535
{
3636
// authentication provider
3737
$authProviderId = 'security.authentication.provider.rememberme.'.$id;

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RemoteUserFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RemoteUserFactory.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
class RemoteUserFactory implements SecurityFactoryInterface
2626
{
27-
public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint)
27+
public function create(ContainerBuilder $container, string $id, array $config, string $userProvider, ?string $defaultEntryPoint)
2828
{
2929
$providerId = 'security.authentication.provider.pre_authenticated.'.$id;
3030
$container

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php
+1-7Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,12 @@ interface SecurityFactoryInterface
2424
/**
2525
* Configures the container services required to use the authentication listener.
2626
*
27-
* @param ContainerBuilder $container
28-
* @param string $id The unique id of the firewall
29-
* @param array $config The options array for the listener
30-
* @param string $userProvider The service id of the user provider
31-
* @param string $defaultEntryPoint
32-
*
3327
* @return array containing three values:
3428
* - the provider id
3529
* - the listener id
3630
* - the entry point id
3731
*/
38-
public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint);
32+
public function create(ContainerBuilder $container, string $id, array $config, string $userProvider, ?string $defaultEntryPoint);
3933

4034
/**
4135
* Defines the position at which the provider is called.

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/X509Factory.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/X509Factory.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
class X509Factory implements SecurityFactoryInterface
2525
{
26-
public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint)
26+
public function create(ContainerBuilder $container, string $id, array $config, string $userProvider, ?string $defaultEntryPoint)
2727
{
2828
$providerId = 'security.authentication.provider.pre_authenticated.'.$id;
2929
$container

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/InMemoryFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/InMemoryFactory.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
class InMemoryFactory implements UserProviderFactoryInterface
2626
{
27-
public function create(ContainerBuilder $container, $id, $config)
27+
public function create(ContainerBuilder $container, string $id, array $config)
2828
{
2929
$definition = $container->setDefinition($id, new ChildDefinition('security.user.provider.in_memory'));
3030
$defaultPassword = new Parameter('container.build_id');

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/LdapFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/LdapFactory.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
class LdapFactory implements UserProviderFactoryInterface
2626
{
27-
public function create(ContainerBuilder $container, $id, $config)
27+
public function create(ContainerBuilder $container, string $id, array $config)
2828
{
2929
$container
3030
->setDefinition($id, new ChildDefinition('security.user.provider.ldap'))

‎src/Symfony/Bundle/SecurityBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"ext-xml": "*",
2121
"symfony/config": "^4.4|^5.0",
2222
"symfony/dependency-injection": "^4.4|^5.0",
23-
"symfony/http-kernel": "^4.4|^5.0",
23+
"symfony/http-kernel": "^5.0",
2424
"symfony/security-core": "^4.4|^5.0",
2525
"symfony/security-csrf": "^4.4|^5.0",
2626
"symfony/security-guard": "^4.4|^5.0",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.