Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0bdf10a

Browse files
Merge branch '4.3' into 4.4
* 4.3: cs fix Partially Revert "Remove trailing space in all markdown files" [Intl] Explicit check Fix getMaxFilesize() returning zero [DI] fix docblocks in Container* Fixed markdown file [TwigBridge] Replaced plain doc block copies with inheritdoc. [DomCrawler] Fixed CHANGELOG markup [Intl] Cleanup unused language aliases entry
2 parents c65dc15 + cda8a67 commit 0bdf10a

File tree

16 files changed

+39
-52
lines changed

16 files changed

+39
-52
lines changed

CONTRIBUTORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ Symfony is the result of the work of many people who made the code better
760760
- Thomas Ploch
761761
- Benjamin Grandfond (benjamin)
762762
- Tiago Brito (blackmx)
763-
-
763+
-
764764
- Richard van den Brand (ricbra)
765765
- develop
766766
- flip111

src/Symfony/Bridge/Twig/Extension/RoutingExtension.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ public function __construct(UrlGeneratorInterface $generator)
3333
}
3434

3535
/**
36-
* Returns a list of functions to add to the existing list.
37-
*
38-
* @return array An array of functions
36+
* {@inheritdoc}
3937
*/
4038
public function getFunctions()
4139
{

src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@
2929
class TransChoiceTokenParser extends TransTokenParser
3030
{
3131
/**
32-
* Parses a token and returns a node.
33-
*
34-
* @return Node
35-
*
36-
* @throws SyntaxError
32+
* {@inheritdoc}
3733
*/
3834
public function parse(Token $token)
3935
{
@@ -86,9 +82,7 @@ public function decideTransChoiceFork($token)
8682
}
8783

8884
/**
89-
* Gets the tag name associated with this token parser.
90-
*
91-
* @return string The tag name
85+
* {@inheritdoc}
9286
*/
9387
public function getTag()
9488
{

src/Symfony/Bridge/Twig/TokenParser/TransDefaultDomainTokenParser.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
class TransDefaultDomainTokenParser extends AbstractTokenParser
2525
{
2626
/**
27-
* Parses a token and returns a node.
28-
*
29-
* @return Node
27+
* {@inheritdoc}
3028
*/
3129
public function parse(Token $token)
3230
{
@@ -38,9 +36,7 @@ public function parse(Token $token)
3836
}
3937

4038
/**
41-
* Gets the tag name associated with this token parser.
42-
*
43-
* @return string The tag name
39+
* {@inheritdoc}
4440
*/
4541
public function getTag()
4642
{

src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@
2828
class TransTokenParser extends AbstractTokenParser
2929
{
3030
/**
31-
* Parses a token and returns a node.
32-
*
33-
* @return Node
34-
*
35-
* @throws SyntaxError
31+
* {@inheritdoc}
3632
*/
3733
public function parse(Token $token)
3834
{
@@ -90,9 +86,7 @@ public function decideTransFork($token)
9086
}
9187

9288
/**
93-
* Gets the tag name associated with this token parser.
94-
*
95-
* @return string The tag name
89+
* {@inheritdoc}
9690
*/
9791
public function getTag()
9892
{

src/Symfony/Bundle/WebServerBundle/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ CHANGELOG
1414
3.4.0
1515
-----
1616

17-
* WebServer can now use '*' as a wildcard to bind to 0.0.0.0 (INADDR_ANY)
17+
* WebServer can now use `*` as a wildcard to bind to 0.0.0.0 (INADDR_ANY)
1818

1919
3.3.0
2020
-----

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ public function findDefinition($id)
10741074
/**
10751075
* Creates a service for a service definition.
10761076
*
1077-
* @return object The service described by the service definition
1077+
* @return mixed The service described by the service definition
10781078
*
10791079
* @throws RuntimeException When the factory definition is incomplete
10801080
* @throws RuntimeException When the service is a synthetic service
@@ -1639,7 +1639,7 @@ private function callMethod($service, array $call, array &$inlineServices)
16391639
/**
16401640
* Shares a given service in the container.
16411641
*
1642-
* @param object $service
1642+
* @param mixed $service
16431643
*/
16441644
private function shareService(Definition $definition, $service, ?string $id, array &$inlineServices)
16451645
{

src/Symfony/Component/DependencyInjection/ContainerInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ interface ContainerInterface extends PsrContainerInterface
3333
/**
3434
* Sets a service.
3535
*
36-
* @param string $id The service identifier
37-
* @param object $service The service instance
36+
* @param string $id The service identifier
37+
* @param object|null $service The service instance
3838
*/
3939
public function set($id, $service);
4040

@@ -44,7 +44,7 @@ public function set($id, $service);
4444
* @param string $id The service identifier
4545
* @param int $invalidBehavior The behavior when the service does not exist
4646
*
47-
* @return object The associated service
47+
* @return object|null The associated service
4848
*
4949
* @throws ServiceCircularReferenceException When a circular reference is detected
5050
* @throws ServiceNotFoundException When the service is not defined

src/Symfony/Component/DomCrawler/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CHANGELOG
99
4.3.0
1010
-----
1111

12-
* Added PHPUnit constraints: `CrawlerSelectorAttributeValueSame`, `CrawlerSelectorExists`, `CrawlerSelectorTextContains``
12+
* Added PHPUnit constraints: `CrawlerSelectorAttributeValueSame`, `CrawlerSelectorExists`, `CrawlerSelectorTextContains`
1313
and `CrawlerSelectorTextSame`
1414
* Added return of element name (`_name`) in `extract()` method.
1515
* Added ability to return a default value in `text()` and `html()` instead of throwing an exception when node is empty.
@@ -21,7 +21,7 @@ CHANGELOG
2121

2222
* The `$currentUri` constructor argument of the `AbstractUriElement`, `Link` and
2323
`Image` classes is now optional.
24-
* The `Crawler::children()` method will have a new `$selector` argument in version 5.0,
24+
* The `Crawler::children()` method will have a new `$selector` argument in version 5.0,
2525
not defining it is deprecated.
2626

2727
3.1.0

src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ protected function assertOrderedIterator($expected, \Traversable $iterator)
4444
* $a and $b such that $a goes before $b in $expected, the method
4545
* asserts that any element of $a goes before any element of $b
4646
* in the sequence generated by $iterator
47-
* @param \Traversable $iterator
4847
*/
49-
protected function assertOrderedIteratorForGroups($expected, \Traversable $iterator)
48+
protected function assertOrderedIteratorForGroups(array $expected, \Traversable $iterator)
5049
{
5150
$values = array_values(array_map(function (\SplFileInfo $fileinfo) { return $fileinfo->getPathname(); }, iterator_to_array($iterator)));
5251

@@ -63,11 +62,8 @@ protected function assertOrderedIteratorForGroups($expected, \Traversable $itera
6362

6463
/**
6564
* Same as IteratorTestCase::assertIterator with foreach usage.
66-
*
67-
* @param array $expected
68-
* @param \Traversable $iterator
6965
*/
70-
protected function assertIteratorInForeach($expected, \Traversable $iterator)
66+
protected function assertIteratorInForeach(array $expected, \Traversable $iterator)
7167
{
7268
$values = [];
7369
foreach ($iterator as $file) {
@@ -83,11 +79,8 @@ protected function assertIteratorInForeach($expected, \Traversable $iterator)
8379

8480
/**
8581
* Same as IteratorTestCase::assertOrderedIterator with foreach usage.
86-
*
87-
* @param array $expected
88-
* @param \Traversable $iterator
8982
*/
90-
protected function assertOrderedIteratorInForeach($expected, \Traversable $iterator)
83+
protected function assertOrderedIteratorInForeach(array $expected, \Traversable $iterator)
9184
{
9285
$values = [];
9386
foreach ($iterator as $file) {

src/Symfony/Component/HttpFoundation/File/UploadedFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public static function getMaxFilesize()
246246
$sizePostMax = self::parseFilesize(ini_get('post_max_size'));
247247
$sizeUploadMax = self::parseFilesize(ini_get('upload_max_filesize'));
248248

249-
return min([$sizePostMax, $sizeUploadMax]);
249+
return min($sizePostMax ?: PHP_INT_MAX, $sizeUploadMax ?: PHP_INT_MAX);
250250
}
251251

252252
/**

src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,4 +353,18 @@ public function testIsInvalidIfNotHttpUpload()
353353

354354
$this->assertFalse($file->isValid());
355355
}
356+
357+
public function testGetMaxFilesize()
358+
{
359+
$size = UploadedFile::getMaxFilesize();
360+
361+
$this->assertIsInt($size);
362+
$this->assertGreaterThan(0, $size);
363+
364+
if (0 === (int) ini_get('post_max_size') && 0 === (int) ini_get('upload_max_filesize')) {
365+
$this->assertSame(PHP_INT_MAX, $size);
366+
} else {
367+
$this->assertLessThan(PHP_INT_MAX, $size);
368+
}
369+
}
356370
}

src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ protected function generateDataForMeta(BundleEntryReaderInterface $reader, $temp
169169
return [
170170
'Version' => $rootBundle['Version'],
171171
'Languages' => $this->languageCodes,
172-
'Aliases' => array_column(iterator_to_array($metadataBundle['alias']['language']), 'replacement'),
173172
'Alpha2ToAlpha3' => $alpha2ToAlpha3,
174173
'Alpha3ToAlpha2' => $alpha3ToAlpha2,
175174
];
@@ -185,9 +184,9 @@ private function generateAlpha2ToAlpha3Mapping(ArrayAccessibleResourceBundle $me
185184
$aliases = iterator_to_array($metadataBundle['alias']['language']);
186185
$alpha2ToAlpha3 = [];
187186

188-
foreach ($aliases as $alias => $language) {
189-
$language = $language['replacement'];
190-
if (2 === \strlen($language) && 3 === \strlen($alias)) {
187+
foreach ($aliases as $alias => $data) {
188+
$language = $data['replacement'];
189+
if (2 === \strlen($language) && 3 === \strlen($alias) && 'overlong' === $data['reason']) {
191190
if (isset(self::$preferredAlpha2ToAlpha3Mapping[$language])) {
192191
// Validate to prevent typos
193192
if (!isset($aliases[self::$preferredAlpha2ToAlpha3Mapping[$language]])) {

src/Symfony/Component/Intl/Resources/data/languages/meta.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,6 @@
618618
"zun",
619619
"zza"
620620
],
621-
"Aliases": [],
622621
"Alpha2ToAlpha3": {
623622
"aa": "aar",
624623
"ab": "abk",

src/Symfony/Component/Ldap/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A Ldap client for PHP on top of PHP's ldap extension.
66
Disclaimer
77
----------
88

9-
This component is only stable since Symfony 3.1. Earlier versions
9+
This component is only stable since Symfony 3.1. Earlier versions
1010
have been marked as internal as they still needed some work.
1111
Breaking changes were introduced in Symfony 3.1, so code relying on
1212
previous version of the component will break with this version.

src/Symfony/Component/Serializer/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ CHANGELOG
138138

139139
* added `$context` support for XMLEncoder.
140140
* [DEPRECATION] JsonEncode and JsonDecode where modified to throw
141-
an exception if error found. No need for get*Error() functions
141+
an exception if error found. No need for `get*Error()` functions
142142

143143
2.3.0
144144
-----

0 commit comments

Comments
 (0)