8000 Merge branch '4.3' into 4.4 · symfony/symfony@0890970 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0890970

Browse files
Merge branch '4.3' into 4.4
* 4.3: (23 commits) fix merge [SecurityBundle] fix return type declarations [BrowserKit] fix return type declarations [PropertyInfo] fix return type declarations [Bridge/Doctrine] fix return type declarations [Form] fix return type declarations [Console] fix return type declarations [Intl] fix return type declarations [Templating] fix return type declarations [DomCrawler] fix return type declarations [Validator] fix return type declarations [Process] fix return type declarations [Workflow] fix return type declarations [Cache] fix return type declarations [Serializer] fix return type declarations [Translation] fix return type declarations [DI] fix return type declarations [Config] fix return type declarations [HttpKernel] Fix return type declarations [Security] Fix return type declarations ...
2 parents 6c9b87c + 9e154e7 commit 0890970

File tree

118 files changed

+494
-435
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+494
-435
lines changed

src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,6 @@ public function getEntitiesByIds($identifier, array $values)
8484
return $qb->andWhere($where)
8585
->getQuery()
8686
->setParameter($parameter, $values, $parameterType)
87-
->getResult();
87+
->getResult() ?: [];
8888
}
8989
}

src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ protected function doLeaveNode(Node $node, Environment $env)
113113

114114
/**
115115
* {@inheritdoc}
116+
*
117+
* @return int
116118
*/
117119
public function getPriority()
118120
{

src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ protected function doLeaveNode(Node $node, Environment $env)
103103

104104
/**
105105
* {@inheritdoc}
106+
*
107+
* @return int
106108
*/
107109
public function getPriority()
108110
{

src/Symfony/Bridge/Twig/Translation/TwigExtractor.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ protected function canBeExtracted($file)
106106
}
107107

108108
/**
109-
* @param string|array $directory
110-
*
111-
* @return array
109+
* {@inheritdoc}
112110
*/
113111
protected function extractFromDirectory($directory)
114112
{

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,9 +2003,7 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co
20032003
}
20042004

20052005
/**
2006-
* Returns the base path for the XSD files.
2007-
*
2008-
* @return string The XSD base path
2006+
* {@inheritdoc}
20092007
*/
20102008
public function getXsdValidationBasePath()
20112009
{

src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ public function registerContainerConfiguration(LoaderInterface $loader)
3636
$loader->load(__DIR__.\DIRECTORY_SEPARATOR.'config.yml');
3737
}
3838

39+
public function setAnnotatedClassCache(array $annotatedClasses)
40+
{
41+
$annotatedClasses = array_diff($annotatedClasses, ['Symfony\Bundle\WebProfilerBundle\Controller\ExceptionController', 'Symfony\Bundle\TwigBundle\Controller\ExceptionController']);
42+
43+
parent::setAnnotatedClassCache($annotatedClasses);
44+
}
45+
3946
protected function build(ContainerBuilder $container)
4047
{
4148
$container->register('logger', NullLogger::class);

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ public function testProfilerIsDisabled($insulate)
2424
}
2525

2626
$client->request('GET', '/profiler');
27-
$this->assertFalse($client->getProfile());
27+
$this->assertNull($client->getProfile());
2828

2929
// enable the profiler for the next request
3030
$client->enableProfiler();
31-
$this->assertFalse($client->getProfile());
31+
$this->assertNull($client->getProfile());
3232
$client->request('GET', '/profiler');
3333
$this->assertIsObject($client->getProfile());
3434

3535
$client->request('GET', '/profiler');
36-
$this->assertFalse($client->getProfile());
36+
$this->assertNull($client->getProfile());
3737
}
3838

3939
public function getConfigs()

src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public function getUser()
259259
/**
260260
* Gets the roles of the user.
261261
*
262-
* @return array The roles
262+
* @return array|Data
263263
*/
264264
public function getRoles()
265265
{
@@ -269,7 +269,7 @@ public function getRoles()
269269
/**
270270
* Gets the inherited roles of the user.
271271
*
272-
* @return array The inherited roles
272+
* @return array|Data
273273
*/
274274
public function getInheritedRoles()
275275
{
@@ -297,16 +297,25 @@ public function isAuthenticated()
297297
return $this->data['authenticated'];
298298
}
299299

300+
/**
301+
* @return bool
302+
*/
300303
public function isImpersonated()
301304
{
302305
return $this->data['impersonated'];
303306
}
304307

308+
/**
309+
* @return string|null
310+
*/
305311
public function getImpersonatorUser()
306312
{
307313
return $this->data['impersonator_user'];
308314
}
309315

316+
/**
317+
* @return string|null
318+
*/
310319
public function getImpersonationExitPath()
311320
{
312321
return $this->data['impersonation_exit_path'];
@@ -315,7 +324,7 @@ public function getImpersonationExitPath()
315324
/**
316325
* Get the class name of the security token.
317326
*
318-
* @return string The token
327+
* @return string|Data|null The token
319328
*/
320329
public function getTokenClass()
321330
{
@@ -325,7 +334,7 @@ public function getTokenClass()
325334
/**
326335
* Get the full security token class as Data object.
327336
*
328-
* @return Data
337+
* @return Data|null
329338
*/
330339
public function< 10000 /span> getToken()
331340
{
@@ -335,7 +344,7 @@ public function getToken()
335344
/**
336345
* Get the logout URL.
337346
*
338-
* @return string The logout URL
347+
* @return string|null The logout URL
339348
*/
340349
public function getLogoutUrl()
341350
{
@@ -345,7 +354,7 @@ public function getLogoutUrl()
345354
/**
346355
* Returns the FQCN of the security voters enabled in the application.
347356
*
348-
* @return string[]
357+
* @return string[]|Data
349358
*/
350359
public function getVoters()
351360
{
@@ -365,7 +374,7 @@ public function getVoterStrategy()
365374
/**
366375
* Returns the log of the security decisions made by the access decision manager.
367376
*
368-
* @return array
377+
* @return array|Data
369378
*/
370379
public function getAccessDecisionLog()
371380
{
@@ -375,13 +384,16 @@ public function getAccessDecisionLog()
375384
/**
376385
* Returns the configuration of the current firewall context.
377386
*
378-
* @return array
387+
* @return array|Data
379388
*/
380389
public function getFirewall()
381390
{
382391
return $this->data['firewall'];
383392
}
384393

394+
/**
395+
* @return array|Data
396+
*/
385397
public function getListeners()
386398
{
387399
return $this->data['listeners'];

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ abstract protected function getListenerId();
130130
* @param ContainerBuilder $container
131131
* @param string $id
132132
* @param array $config
133-
* @param string $defaultEntryPointId
133+
* @param string|null $defaultEntryPointId
134134
*
135-
* @return string the entry point id
135+
* @return string|null the entry point id
136136
*/
137137
protected function createEntryPoint($container, $id, $config, $defaultEntryPointId)
138138
{

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ interface SecurityFactoryInterface
2424
/**
2525
* Configures the container services required to use the authentication listener.
2626
*
27-
* @param string $id The unique id of the firewall
28-
* @param array $config The options array for the listener
29-
* @param string $userProvider The service id of the user provider
30-
* @param string $defaultEntryPoint
27+
* @param string $id The unique id of the firewall
28+
* @param array $config The options array for the listener
29+
* @param string $userProvider The service id of the user provider
30+
* @param string|null $defaultEntryPoint
3131
*
3232
* @return array containing three values:
3333
* - the provider id

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -787,9 +787,7 @@ public function addUserProviderFactory(UserProviderFactoryInterface $factory)
787787
}
788788

789789
/**
790-
* Returns the base path for the XSD files.
791-
*
792-
* @return string The XSD base path
790+
* {@inheritdoc}
793791
*/
794792
public function getXsdValidationBasePath()
795793
{

src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,7 @@ private function normalizeBundleName(string $name)
207207
}
208208

209209
/**
210-
* Returns the base path for the XSD files.
211-
*
212-
* @return string The XSD base path
210+
* {@inheritdoc}
213211
*/
214212
public function getXsdValidationBasePath()
215213
{

src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ public function load(array $configs, ContainerBuilder $container)
6161
}
6262

6363
/**
64-
* Returns the base path for the XSD files.
65-
*
66-
* @return string The XSD base path
64+
* {@inheritdoc}
6765
*/
6866
public function getXsdValidationBasePath()
6967
{

src/Symfony/Component/BrowserKit/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ public function setServerParameter($key, $value)
151151
* Gets single server parameter for specified key.
152152
*
153153
* @param string $key A key of the parameter to get
154-
* @param string $default A default value when key is undefined
154+
* @param mixed $default A default value when key is undefined
155155
*
156-
* @return string A value of the parameter
156+
* @return mixed A value of the parameter
157157
*/
158158
public function getServerParameter($key, $default = '')
159159
{

src/Symfony/Component/BrowserKit/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function getServer()
107107
/**
108108
* Gets the request raw body data.
109109
*
110-
* @return string The request raw body data
110+
* @return string|null The request raw body data
111111
*/
112112
public function getContent()
113113
{

src/Symfony/Component/Cache/DoctrineProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function doDelete($id)
9999
*/
100100
protected function doFlush()
101101
{
102-
$this->pool->clear();
102+
return $this->pool->clear();
103103
}
104104

105105
/**
@@ -109,5 +109,6 @@ protected function doFlush()
109109
*/
110110
protected function doGetStats()
111111
{
112+
return null;
112113
}
113114
}

src/Symfony/Component/Cache/Tests/Adapter/MaxIdLengthAdapterTest.php

Lines changed: 5 additions & 1 deletion
97AE
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public function testLongKeyVersioning()
4040
->setConstructorArgs([str_repeat('-', 26)])
4141
->getMock();
4242

43+
$cache
44+
->method('doFetch')
45+
->willReturn(['2:']);
46+
4347
$reflectionClass = new \ReflectionClass(AbstractAdapter::class);
4448

4549
$reflectionMethod = $reflectionClass->getMethod('getId');
@@ -56,7 +60,7 @@ public function testLongKeyVersioning()
5660
$reflectionProperty->setValue($cache, true);
5761

5862
// Versioning enabled
59-
$this->assertEquals('--------------------------:1:------------', $reflectionMethod->invokeArgs($cache, [str_repeat('-', 12)]));
63+
$this->assertEquals('--------------------------:2:------------', $reflectionMethod->invokeArgs($cache, [str_repeat('-', 12)]));
6064
$this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, [str_repeat('-', 12)])));
6165
$this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, [str_repeat('-', 23)])));
6266
$this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, [str_repeat('-', 40)])));

src/Symfony/Component/Config/Definition/ArrayNode.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,13 @@ public function setNormalizeKeys($normalizeKeys)
3838
}
3939

4040
/**
41-
* Normalizes keys between the different configuration formats.
41+
* {@inheritdoc}
4242
*
4343
* Namely, you mostly have foo_bar in YAML while you have foo-bar in XML.
4444
* After running this method, all keys are normalized to foo_bar.
4545
*
4646
* If you have a mixed key like foo-bar_moo, it will not be altered.
4747
* The key will also not be altered if the target key already exists.
48-
*
49-
* @param mixed $value
50-
*
51-
* @return array The value with normalized keys
5248
*/
5349
protected function preNormalize($value)
5450
{

src/Symfony/Component/Config/Definition/BaseNode.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,37 @@ public static function resetPlaceholders(): void
9797
self::$placeholders = [];
9898
}
9999

100+
/**
101+
* @param string $key
102+
*/
100103
public function setAttribute($key, $value)
101104
{
102105
$this->attributes[$key] = $value;
103106
}
104107

108+
/**
109+
* @param string $key
110+
*
111+
* @return mixed
112+
*/
105113
public function getAttribute($key, $default = null)
106114
{
107115
return isset($this->attributes[$key]) ? $this->attributes[$key] : $default;
108116
}
109117

118+
/**
119+
* @param string $key
120+
*
121+
* @return bool
122+
*/
110123
public function hasAttribute($key)
111124
{
112125
return isset($this->attributes[$key]);
113126
}
114127

128+
/**
129+
* @return array
130+
*/
115131
public function getAttributes()
116132
{
117133
return $this->attributes;
@@ -122,6 +138,9 @@ public function setAttributes(array $attributes)
122138
$this->attributes = $attributes;
123139
}
124140

141+
/**
142+
* @param string $key
143+
*/
125144
public function removeAttribute($key)
126145
{
127146
unset($this->attributes[$key]);
@@ -140,7 +159,7 @@ public function setInfo($info)
140159
/**
141160
* Returns info message.
142161
*
143-
* @return string The info text
162+
* @return string|null The info text
144163
*/
145164
public function getInfo()
146165
{
@@ -160,7 +179,7 @@ public function setExample($example)
160179
/**
161180
* Retrieves the example configuration for this node.
162181
*
163-
* @return string|array The example
182+
* @return string|array|null The example
164183
*/
165184
public function getExample()
166185
{

src/Symfony/Component/Config/Definition/PrototypedArrayNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function setKeyAttribute($attribute, $remove = true)
7878
/**
7979
* Retrieves the name of the attribute which value should be used as key.
8080
*
81-
* @return string The name of the attribute
81+
* @return string|null The name of the attribute
8282
*/
8383
public function getKeyAttribute()
8484
{

0 commit comments

Comments
 (0)
0