Skip to content

Commit 0bbbb01

Browse files
committed
Merge branch '2.3' into 2.7
* 2.3: [Process] Unset callback after stop to free memory Improve error message for undefined DIC aliases Fix typo CS: remove unneeded parentheses around control statements
2 parents 5549336 + 0310499 commit 0bbbb01

File tree

9 files changed

+16
-11
lines changed

9 files changed

+16
-11
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function getEntities()
8989
*/
9090
public function getEntitiesByIds($identifier, array $values)
9191
{
92-
$qb = clone ($this->queryBuilder);
92+
$qb = clone $this->queryBuilder;
9393
$alias = current($qb->getRootAliases());
9494
$parameter = 'ORMQueryBuilderLoader_getEntitiesByIds_'.$identifier;
9595
$where = $qb->expr()->in($alias.'.'.$identifier, ':'.$parameter);

src/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function process(ContainerBuilder $container)
4545
try {
4646
$definition = $container->getDefinition($aliasId);
4747
} catch (InvalidArgumentException $e) {
48-
throw new InvalidArgumentException(sprintf('Unable to replace alias "%s" with "%s".', $alias, $id), null, $e);
48+
throw new InvalidArgumentException(sprintf('Unable to replace alias "%s" with actual definition "%s".', $id, $alias), null, $e);
4949
}
5050

5151
if ($definition->isPublic()) {

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,13 +443,13 @@ public function mirror($originDir, $targetDir, \Traversable $iterator = null, $o
443443
*/
444444
public function isAbsolutePath($file)
445445
{
446-
return (strspn($file, '/\\', 0, 1)
446+
return strspn($file, '/\\', 0, 1)
447447
|| (strlen($file) > 3 && ctype_alpha($file[0])
448448
&& substr($file, 1, 1) === ':'
449449
&& (strspn($file, '/\\', 2, 1))
450450
)
451451
|| null !== parse_url($file, PHP_URL_SCHEME)
452-
);
452+
;
453453
}
454454

455455
/**

src/Symfony/Component/Finder/Iterator/SortableIterator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ public function __construct(\Traversable $iterator, $sort)
5555
};
5656
} elseif (self::SORT_BY_ACCESSED_TIME === $sort) {
5757
$this->sort = function ($a, $b) {
58-
return ($a->getATime() - $b->getATime());
58+
return $a->getATime() - $b->getATime();
5959
};
6060
} elseif (self::SORT_BY_CHANGED_TIME === $sort) {
6161
$this->sort = function ($a, $b) {
62-
return ($a->getCTime() - $b->getCTime());
62+
return $a->getCTime() - $b->getCTime();
6363
};
6464
} elseif (self::SORT_BY_MODIFIED_TIME === $sort) {
6565
$this->sort = function ($a, $b) {
66-
return ($a->getMTime() - $b->getMTime());
66+
return $a->getMTime() - $b->getMTime();
6767
};
6868
} elseif (is_callable($sort)) {
6969
$this->sort = $sort;

src/Symfony/Component/HttpFoundation/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ public function getVary()
972972
* Sets the Vary header.
973973
*
974974
* @param string|array $headers
975-
* @param bool $replace Whether to replace the actual value of not (true by default)
975+
* @param bool $replace Whether to replace the actual value or not (true by default)
976976
*
977977
* @return Response
978978
*/

src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function getSaveHandlerName()
5252
*/
5353
public function isSessionHandlerInterface()
5454
{
55-
return ($this instanceof \SessionHandlerInterface);
55+
return $this instanceof \SessionHandlerInterface;
5656
}
5757

5858
/**

src/Symfony/Component/Intl/DateFormatter/DateFormat/FullTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function getReverseMatchingRegExp($pattern)
214214
*/
215215
public function isQuoteMatch($quoteMatch)
216216
{
217-
return ("'" === $quoteMatch[0]);
217+
return "'" === $quoteMatch[0];
218218
}
219219

220220
/**

src/Symfony/Component/Process/Process.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,11 @@ private function close()
14091409
$this->exitcode = 128 + $this->processInformation['termsig'];
14101410
}
14111411

1412+
// Free memory from self-reference callback created by buildCallback
1413+
// Doing so in other contexts like __destruct or by garbage collector is ineffective
1414+
// Now pipes are closed, so the callback is no longer necessary
1415+
$this->callback = null;
1416+
14121417
return $this->exitcode;
14131418
}
14141419

src/Symfony/Component/Yaml/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,6 @@ private function isNextLineUnIndentedCollection()
707707
*/
708708
private function isStringUnIndentedCollectionItem()
709709
{
710-
return (0 === strpos($this->currentLine, '- '));
710+
return 0 === strpos($this->currentLine, '- ');
711711
}
712712
}

0 commit comments

Comments
 (0)