Skip to content

Commit

Permalink
Merge branch '4.3' into 4.4
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nicolas-grekas committed Aug 14, 2019
2 parents c65dc15 + cda8a67 commit 0bdf10a
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 52 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ Symfony is the result of the work of many people who made the code better
- Thomas Ploch
- Benjamin Grandfond (benjamin)
- Tiago Brito (blackmx)
-
-
- Richard van den Brand (ricbra)
- develop
- flip111
Expand Down
4 changes: 1 addition & 3 deletions src/Symfony/Bridge/Twig/Extension/RoutingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ public function __construct(UrlGeneratorInterface $generator)
}

/**
* Returns a list of functions to add to the existing list.
*
* @return array An array of functions
* {@inheritdoc}
*/
public function getFunctions()
{
Expand Down
10 changes: 2 additions & 8 deletions src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@
class TransChoiceTokenParser extends TransTokenParser
{
/**
* Parses a token and returns a node.
*
* @return Node
*
* @throws SyntaxError
* {@inheritdoc}
*/
public function parse(Token $token)
{
Expand Down Expand Up @@ -86,9 +82,7 @@ public function decideTransChoiceFork($token)
}

/**
* Gets the tag name associated with this token parser.
*
* @return string The tag name
* {@inheritdoc}
*/
public function getTag()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
class TransDefaultDomainTokenParser extends AbstractTokenParser
{
/**
* Parses a token and returns a node.
*
* @return Node
* {@inheritdoc}
*/
public function parse(Token $token)
{
Expand All @@ -38,9 +36,7 @@ public function parse(Token $token)
}

/**
* Gets the tag name associated with this token parser.
*
* @return string The tag name
* {@inheritdoc}
*/
public function getTag()
{
Expand Down
10 changes: 2 additions & 8 deletions src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@
class TransTokenParser extends AbstractTokenParser
{
/**
* Parses a token and returns a node.
*
* @return Node
*
* @throws SyntaxError
* {@inheritdoc}
*/
public function parse(Token $token)
{
Expand Down Expand Up @@ -90,9 +86,7 @@ public function decideTransFork($token)
}

/**
* Gets the tag name associated with this token parser.
*
* @return string The tag name
* {@inheritdoc}
*/
public function getTag()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/WebServerBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CHANGELOG
3.4.0
-----

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

3.3.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ public function findDefinition($id)
/**
* Creates a service for a service definition.
*
* @return object The service described by the service definition
* @return mixed The service described by the service definition
*
* @throws RuntimeException When the factory definition is incomplete
* @throws RuntimeException When the service is a synthetic service
Expand Down Expand Up @@ -1639,7 +1639,7 @@ private function callMethod($service, array $call, array &$inlineServices)
/**
* Shares a given service in the container.
*
* @param object $service
* @param mixed $service
*/
private function shareService(Definition $definition, $service, ?string $id, array &$inlineServices)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ interface ContainerInterface extends PsrContainerInterface
/**
* Sets a service.
*
* @param string $id The service identifier
* @param object $service The service instance
* @param string $id The service identifier
* @param object|null $service The service instance
*/
public function set($id, $service);

Expand All @@ -44,7 +44,7 @@ public function set($id, $service);
* @param string $id The service identifier
* @param int $invalidBehavior The behavior when the service does not exist
*
* @return object The associated service
* @return object|null The associated service
*
* @throws ServiceCircularReferenceException When a circular reference is detected
* @throws ServiceNotFoundException When the service is not defined
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/DomCrawler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CHANGELOG
4.3.0
-----

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

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

3.1.0
Expand Down
13 changes: 3 additions & 10 deletions src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ protected function assertOrderedIterator($expected, \Traversable $iterator)
* $a and $b such that $a goes before $b in $expected, the method
* asserts that any element of $a goes before any element of $b
* in the sequence generated by $iterator
* @param \Traversable $iterator
*/
protected function assertOrderedIteratorForGroups($expected, \Traversable $iterator)
protected function assertOrderedIteratorForGroups(array $expected, \Traversable $iterator)
{
$values = array_values(array_map(function (\SplFileInfo $fileinfo) { return $fileinfo->getPathname(); }, iterator_to_array($iterator)));

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

/**
* Same as IteratorTestCase::assertIterator with foreach usage.
*
* @param array $expected
* @param \Traversable $iterator
*/
protected function assertIteratorInForeach($expected, \Traversable $iterator)
protected function assertIteratorInForeach(array $expected, \Traversable $iterator)
{
$values = [];
foreach ($iterator as $file) {
Expand All @@ -83,11 +79,8 @@ protected function assertIteratorInForeach($expected, \Traversable $iterator)

/**
* Same as IteratorTestCase::assertOrderedIterator with foreach usage.
*
* @param array $expected
* @param \Traversable $iterator
*/
protected function assertOrderedIteratorInForeach($expected, \Traversable $iterator)
protected function assertOrderedIteratorInForeach(array $expected, \Traversable $iterator)
{
$values = [];
foreach ($iterator as $file) {
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/File/UploadedFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public static function getMaxFilesize()
$sizePostMax = self::parseFilesize(ini_get('post_max_size'));
$sizeUploadMax = self::parseFilesize(ini_get('upload_max_filesize'));

return min([$sizePostMax, $sizeUploadMax]);
return min($sizePostMax ?: PHP_INT_MAX, $sizeUploadMax ?: PHP_INT_MAX);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,4 +353,18 @@ public function testIsInvalidIfNotHttpUpload()

$this->assertFalse($file->isValid());
}

public function testGetMaxFilesize()
{
$size = UploadedFile::getMaxFilesize();

$this->assertIsInt($size);
$this->assertGreaterThan(0, $size);

if (0 === (int) ini_get('post_max_size') && 0 === (int) ini_get('upload_max_filesize')) {
$this->assertSame(PHP_INT_MAX, $size);
} else {
$this->assertLessThan(PHP_INT_MAX, $size);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ protected function generateDataForMeta(BundleEntryReaderInterface $reader, $temp
return [
'Version' => $rootBundle['Version'],
'Languages' => $this->languageCodes,
'Aliases' => array_column(iterator_to_array($metadataBundle['alias']['language']), 'replacement'),
'Alpha2ToAlpha3' => $alpha2ToAlpha3,
'Alpha3ToAlpha2' => $alpha3ToAlpha2,
];
Expand All @@ -185,9 +184,9 @@ private function generateAlpha2ToAlpha3Mapping(ArrayAccessibleResourceBundle $me
$aliases = iterator_to_array($metadataBundle['alias']['language']);
$alpha2ToAlpha3 = [];

foreach ($aliases as $alias => $language) {
$language = $language['replacement'];
if (2 === \strlen($language) && 3 === \strlen($alias)) {
foreach ($aliases as $alias => $data) {
$language = $data['replacement'];
if (2 === \strlen($language) && 3 === \strlen($alias) && 'overlong' === $data['reason']) {
if (isset(self::$preferredAlpha2ToAlpha3Mapping[$language])) {
// Validate to prevent typos
if (!isset($aliases[self::$preferredAlpha2ToAlpha3Mapping[$language]])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,6 @@
"zun",
"zza"
],
"Aliases": [],
"Alpha2ToAlpha3": {
"aa": "aar",
"ab": "abk",
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Ldap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A Ldap client for PHP on top of PHP's ldap extension.
Disclaimer
----------

This component is only stable since Symfony 3.1. Earlier versions
This component is only stable since Symfony 3.1. Earlier versions
have been marked as internal as they still needed some work.
Breaking changes were introduced in Symfony 3.1, so code relying on
previous version of the component will break with this version.
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Serializer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ CHANGELOG

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

2.3.0
-----
Expand Down

0 comments on commit 0bdf10a

Please sign in to comment.