Skip to content

Commit 3bed1b7

Browse files
committed
Merge branch '2.3' into 2.4
* 2.3: (22 commits) Fix incorrect romanian plural translations fix axes handling in Crawler::filterXPath() fix some docblocks Fixed self-reference in 'service_container' service breaks garbage collection (and clone). [Process] Fix tests when pcntl is not available. [DependencyInjection] Roll back changes made to generated files. [Console] Roll back changes made to fixture files. [Validator] Added more detailed inline documentation [Validator] Removed information from the violation output if the value is an array, object or resource partially reverted previous commit fixed CS properly handle null data when denormalizing [Validator] Renamed valueToString() to formatValue(); added missing formatValue() calls [Validator] Fixed CS [Validator] Fixed date-to-string conversion tests to match ICU 51 [Validator] Added "{{ value }}" parameters where they were missing [Validator] Simplified and explained the LuhnValidator [Validator] Simplified IssnValidator [Validator] Fixed and simplified IsbnValidator [Validator] Simplified IBAN validation algorithm ... Conflicts: src/Symfony/Component/Console/Helper/DescriptorHelper.php src/Symfony/Component/DependencyInjection/Container.php src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php src/Symfony/Component/HttpFoundation/File/UploadedFile.php src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php src/Symfony/Component/Validator/Constraints/CollectionValidator.php src/Symfony/Component/Validator/Tests/Constraints/EqualToValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/NotEqualToValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/NotIdenticalToValidatorTest.php
2 parents 69e8100 + d754467 commit 3bed1b7

File tree

88 files changed

+751
-328
lines changed

Some content is hidden

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

88 files changed

+751
-328
lines changed

src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ abstract class RegisterMappingsPass implements CompilerPassInterface
7474
* @param string[] $managerParameters list of container parameters
7575
* that could hold the manager name
7676
* @param string $driverPattern pattern to get the metadata driver service names
77-
* @param string $enabledParameter service container parameter that must be
77+
* @param string|false $enabledParameter service container parameter that must be
7878
* present to enable the mapping. Set to false
7979
* to not do any check, optional.
8080
*/

src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ class ModelChoiceList extends ObjectChoiceList
8080
* Either an array if $choices is given,
8181
* or a ModelCriteria to be merged with the $queryObject.
8282
* @param PropertyAccessorInterface $propertyAccessor The reflection graph for reading property paths.
83+
*
84+
* @throws MissingOptionsException when no model class is given
85+
* @throws InvalidOptionsException when the model class cannot be found
8386
*/
8487
public function __construct($class, $labelPath = null, $choices = null, $queryObject = null, $groupPath = null, $preferred = array(), PropertyAccessorInterface $propertyAccessor = null)
8588
{

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ public function getParent()
292292
*
293293
* @return mixed The finalized value
294294
*
295+
* @throws Exception
295296
* @throws InvalidConfigurationException
296297
*/
297298
final public function finalize($value)

src/Symfony/Component/Console/Application.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,8 @@ protected function configureIO(InputInterface $input, OutputInterface $output)
872872
* @param OutputInterface $output An Output instance
873873
*
874874
* @return int 0 if everything went fine, or an error code
875+
*
876+
* @throws \Exception when the command being run threw an exception
875877
*/
876878
protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
877879
{

src/Symfony/Component/Console/Helper/DescriptorHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct()
5454
* @param object $object
5555
* @param array $options
5656
*
57-
* @throws \InvalidArgumentException
57+
* @throws \InvalidArgumentException when the given format is not supported
5858
*/
5959
public function describe(OutputInterface $output, $object, array $options = array())
6060
{

src/Symfony/Component/Console/Helper/DialogHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ public function askHiddenResponse(OutputInterface $output, $question, $fallback
325325
* @param OutputInterface $output An Output instance
326326
* @param string|array $question The question to ask
327327
* @param callable $validator A PHP callback
328-
* @param int $attempts Max number of times to ask before giving up (false by default, which means infinite)
328+
* @param int|false $attempts Max number of times to ask before giving up (false by default, which means infinite)
329329
* @param string $default The default answer if none is given by the user
330330
* @param array $autocomplete List of values to autocomplete
331331
*
@@ -354,7 +354,7 @@ public function askAndValidate(OutputInterface $output, $question, $validator, $
354354
* @param OutputInterface $output An Output instance
355355
* @param string|array $question The question to ask
356356
* @param callable $validator A PHP callback
357-
* @param int $attempts Max number of times to ask before giving up (false by default, which means infinite)
357+
* @param int|false $attempts Max number of times to ask before giving up (false by default, which means infinite)
358358
* @param bool $fallback In case the response can not be hidden, whether to fallback on non-hidden question or not
359359
*
360360
* @return string The response
@@ -448,7 +448,7 @@ private function hasSttyAvailable()
448448
* @param callable $interviewer A callable that will ask for a question and return the result
449449
* @param OutputInterface $output An Output instance
450450
* @param callable $validator A PHP callback
451-
* @param int $attempts Max number of times to ask before giving up ; false will ask infinitely
451+
* @param int|false $attempts Max number of times to ask before giving up ; false will ask infinitely
452452
*
453453
* @return string The validated response
454454
*

src/Symfony/Component/Console/Helper/TableHelper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public function __construct()
8080
* @param int $layout self::LAYOUT_*
8181
*
8282
* @return TableHelper
83+
*
84+
* @throws InvalidArgumentException when the table layout is not known
8385
*/
8486
public function setLayout($layout)
8587
{

src/Symfony/Component/Console/Tests/Command/ListCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testExecuteListsCommandsWithRawOption()
5050
public function testExecuteListsCommandsWithNamespaceArgument()
5151
{
5252

53-
require_once(realpath(__DIR__.'/../Fixtures/FooCommand.php'));
53+
require_once realpath(__DIR__.'/../Fixtures/FooCommand.php');
5454
$application = new Application();
5555
$application->add(new \FooCommand());
5656
$commandTester = new CommandTester($command = $application->get('list'));

src/Symfony/Component/DependencyInjection/Container.php

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ public function set($id, $service, $scope = self::SCOPE_CONTAINER)
197197

198198
$id = strtolower($id);
199199

200+
if ('service_container' === $id) {
201+
// BC: 'service_container' is no longer a self-reference but always
202+
// $this, so ignore this call.
203+
// @todo Throw InvalidArgumentException in next major release.
204+
return;
205+
}
200206
if (self::SCOPE_CONTAINER !== $scope) {
201207
if (!isset($this->scopedServices[$scope])) {
202208
throw new RuntimeException(sprintf('You cannot set service "%s" of inactive scope.', $id));
@@ -233,6 +239,10 @@ public function has($id)
233239
{
234240
$id = strtolower($id);
235241

242+
if ('service_container' === $id) {
243+
return true;
244+
}
245+
236246
return isset($this->services[$id])
237247
|| array_key_exists($id, $this->services)
238248
|| isset($this->aliases[$id])
@@ -251,9 +261,10 @@ public function has($id)
251261
*
252262
* @return object The associated service
253263
*
254-
* @throws InvalidArgumentException if the service is not defined
264+
* @throws InvalidArgumentException if the service is not defined
255265
* @throws ServiceCircularReferenceException When a circular reference is detected
256-
* @throws ServiceNotFoundException When the service is not defined
266+
* @throws ServiceNotFoundException When the service is not defined
267+
* @throws \Exception if an exception has been thrown when the service has been resolved
257268
*
258269
* @see Reference
259270
*
@@ -269,6 +280,9 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
269280
if ($strtolower) {
270281
$id = strtolower($id);
271282
}
283+
if ('service_container' === $id) {
284+
return $this;
285+
}
272286
if (isset($this->aliases[$id])) {
273287
$id = $this->aliases[$id];
274288
}
@@ -340,6 +354,12 @@ public function initialized($id)
340354
{
341355
$id = strtolower($id);
342356

357+
if ('service_container' === $id) {
358+
// BC: 'service_container' was a synthetic service previously.
359+
// @todo Change to false in next major release.
360+
return true;
361+
}
362+
343363
return isset($this->services[$id]) || array_key_exists($id, $this->services);
344364
}
345365

@@ -357,6 +377,7 @@ public function getServiceIds()
357377
$ids[] = self::underscore($match[1]);
358378
}
359379
}
380+
$ids[] = 'service_container';
360381

361382
return array_unique(array_merge($ids, array_keys($this->services)));
362383
}

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,10 @@ private function addServiceProperties($id, $definition, $variableName = 'instanc
428428
*
429429
* @param string $id
430430
* @param Definition $definition
431+
*
431432
* @return string
433+
*
434+
* @throws ServiceCircularReferenceException when the container contains a circular reference
432435
*/
433436
private function addServiceInlinedDefinitionsSetup($id, $definition)
434437
{
@@ -632,6 +635,8 @@ private function addServices()
632635
*
633636
* @param string $id A service identifier
634637
* @param Definition $definition A Definition instance
638+
*
639+
* @return string|null
635640
*/
636641
private function addServiceSynchronizer($id, Definition $definition)
637642
{

0 commit comments

Comments
 (0)