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

Skip to content

Commit 98c0621

Browse files
committed
Merge branch '2.4' into 2.5
* 2.4: (24 commits) [Validator] Added Swedish translations 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. Issue #11489 Added some CA and ES translations [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 ... Conflicts: src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php src/Symfony/Component/Validator/Constraints/ChoiceValidator.php src/Symfony/Component/Validator/Constraints/CollectionValidator.php src/Symfony/Component/Validator/Constraints/FileValidator.php src/Symfony/Component/Validator/Constraints/Isbn.php src/Symfony/Component/Validator/Constraints/IsbnValidator.php src/Symfony/Component/Validator/Constraints/LengthValidator.php src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php src/Symfony/Component/Validator/Tests/Constraints/BlankValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/DateTimeValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/DateValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/FalseValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/FileValidatorPathTest.php src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/IsbnValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/TimeValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/TrueValidatorTest.php src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php
2 parents a6a7f5d + a4ec72e commit 98c0621

File tree

98 files changed

+839
-404
lines changed

Some content is hidden

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

98 files changed

+839
-404
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/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
@@ -874,6 +874,8 @@ protected function configureIO(InputInterface $input, OutputInterface $output)
874874
* @param OutputInterface $output An Output instance
875875
*
876876
* @return int 0 if everything went fine, or an error code
877+
*
878+
* @throws \Exception when the command being run threw an exception
877879
*/
878880
protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
879881
{

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
@@ -328,7 +328,7 @@ public function askHiddenResponse(OutputInterface $output, $question, $fallback
328328
* @param OutputInterface $output An Output instance
329329
* @param string|array $question The question to ask
330330
* @param callable $validator A PHP callback
331-
* @param int $attempts Max number of times to ask before giving up (false by default, which means infinite)
331+
* @param int|false $attempts Max number of times to ask before giving up (false by default, which means infinite)
332332
* @param string $default The default answer if none is given by the user
333333
* @param array $autocomplete List of values to autocomplete
334334
*
@@ -357,7 +357,7 @@ public function askAndValidate(OutputInterface $output, $question, $validator, $
357357
* @param OutputInterface $output An Output instance
358358
* @param string|array $question The question to ask
359359
* @param callable $validator A PHP callback
360-
* @param int $attempts Max number of times to ask before giving up (false by default, which means infinite)
360+
* @param int|false $attempts Max number of times to ask before giving up (false by default, which means infinite)
361361
* @param bool $fallback In case the response can not be hidden, whether to fallback on non-hidden question or not
362362
*
363363
* @return string The response
@@ -451,7 +451,7 @@ private function hasSttyAvailable()
451451
* @param callable $interviewer A callable that will ask for a question and return the result
452452
* @param OutputInterface $output An Output instance
453453
* @param callable $validator A PHP callback
454-
* @param int $attempts Max number of times to ask before giving up ; false will ask infinitely
454+
* @param int|false $attempts Max number of times to ask before giving up ; false will ask infinitely
455455
*
456456
* @return string The validated response
457457
*

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public function __construct()
4444
* @param int $layout self::LAYOUT_*
4545
*
4646
* @return TableHelper
47+
*
48+
* @throws InvalidArgumentException when the table layout is not known
4749
*/
4850
public function setLayout($layout)
4951
{

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
@@ -429,7 +429,10 @@ private function addServiceProperties($id, $definition, $variableName = 'instanc
429429
*
430430
* @param string $id
431431
* @param Definition $definition
432+
*
432433
* @return string
434+
*
435+
* @throws ServiceCircularReferenceException when the container contains a circular reference
433436
*/
434437
private function addServiceInlinedDefinitionsSetup($id, $definition)
435438
{
@@ -640,6 +643,8 @@ private function addServices()
640643
*
641644
* @param string $id A service identifier
642645
* @param Definition $definition A Definition instance
646+
*
647+
* @return string|null
643648
*/
644649
private function addServiceSynchronizer($id, Definition $definition)
645650
{

src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ private function parseDefinition($id, $service, $file)
248248
* @param string $file
249249
*
250250
* @return array The file content
251+
*
252+
* @throws InvalidArgumentException when the given file is not a local file or when it does not exist
251253
*/
252254
protected function loadFile($file)
253255
{

0 commit comments

Comments
 (0)