diff --git a/src/Symfony/Bridge/Twig/composer.json b/src/Symfony/Bridge/Twig/composer.json
index fd73a7ea3d..aa5b70fc1d 100644
--- a/src/Symfony/Bridge/Twig/composer.json
+++ b/src/Symfony/Bridge/Twig/composer.json
@@ -22,7 +22,7 @@
"require-dev": {
"symfony/asset": "~2.8|~3.0",
"symfony/finder": "~2.8|~3.0",
- "symfony/form": "~3.0.4",
+ "symfony/form": "~3.1.9|^3.2.2",
"symfony/http-kernel": "~3.2",
"symfony/polyfill-intl-icu": "~1.0",
"symfony/routing": "~2.8|~3.0",
diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json
index 7f608d6fd7..9a50aad5e6 100644
--- a/src/Symfony/Bundle/FrameworkBundle/composer.json
+++ b/src/Symfony/Bundle/FrameworkBundle/composer.json
@@ -39,7 +39,7 @@
"symfony/dom-crawler": "~2.8|~3.0",
"symfony/polyfill-intl-icu": "~1.0",
"symfony/security": "~2.8|~3.0",
- "symfony/form": "~2.8|~3.0",
+ "symfony/form": "~2.8.16|~3.1.9|^3.2.2",
"symfony/expression-language": "~2.8|~3.0",
"symfony/process": "~2.8|~3.0",
"symfony/security-core": "~3.2",
diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php
index fc008a9fbd..f20f8c2e70 100644
--- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php
+++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php
@@ -97,7 +97,8 @@ class RememberMeFactory implements SecurityFactoryInterface
if (count($userProviders) === 0) {
throw new \RuntimeException('You must configure at least one remember-me aware listener (such as form-login) for each firewall that has remember-me enabled.');
}
- $rememberMeServices->replaceArgument(0, $userProviders);
+
+ $rememberMeServices->replaceArgument(0, array_unique($userProviders));
// remember-me listener
$listenerId = 'security.authentication.listener.rememberme.'.$id;
diff --git a/src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php b/src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php
index 5be4519513..5fd1d31a45 100644
--- a/src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php
+++ b/src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php
@@ -77,6 +77,10 @@ class FilesystemAdapter extends AbstractAdapter
$ok = $this->write($this->getFile($id, true), $expiresAt."\n".rawurlencode($id)."\n".serialize($value), $expiresAt) && $ok;
}
+ if (!$ok && !is_writable($this->directory)) {
+ throw new CacheException(sprintf('Cache directory is not writable (%s)', $this->directory));
+ }
+
return $ok;
}
}
diff --git a/src/Symfony/Component/Cache/Adapter/FilesystemAdapterTrait.php b/src/Symfony/Component/Cache/Adapter/FilesystemAdapterTrait.php
index 2f6e43e637..34ed20e6d2 100644
--- a/src/Symfony/Component/Cache/Adapter/FilesystemAdapterTrait.php
+++ b/src/Symfony/Component/Cache/Adapter/FilesystemAdapterTrait.php
@@ -11,6 +11,7 @@
namespace Symfony\Component\Cache\Adapter;
+use Symfony\Component\Cache\Exception\CacheException;
use Symfony\Component\Cache\Exception\InvalidArgumentException;
/**
@@ -40,9 +41,7 @@ trait FilesystemAdapterTrait
if (false === $dir = realpath($dir) ?: (file_exists($dir) ? $dir : false)) {
throw new InvalidArgumentException(sprintf('Cache directory does not exist (%s)', $directory));
}
- if (!is_writable($dir .= DIRECTORY_SEPARATOR)) {
- throw new InvalidArgumentException(sprintf('Cache directory is not writable (%s)', $directory));
- }
+ $dir .= DIRECTORY_SEPARATOR;
// On Windows the whole path is limited to 258 chars
if ('\\' === DIRECTORY_SEPARATOR && strlen($dir) > 234) {
throw new InvalidArgumentException(sprintf('Cache directory too long (%s)', $directory));
diff --git a/src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php b/src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php
index 590325dd22..befa38d8d4 100644
--- a/src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php
+++ b/src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php
@@ -122,6 +122,10 @@ class PhpFilesAdapter extends AbstractAdapter
}
}
+ if (!$ok && !is_writable($this->directory)) {
+ throw new CacheException(sprintf('Cache directory is not writable (%s)', $this->directory));
+ }
+
return $ok;
}
}
diff --git a/src/Symfony/Component/Cache/Adapter/RedisAdapter.php b/src/Symfony/Component/Cache/Adapter/RedisAdapter.php
index fccfb92631..7fd6921e3f 100644
--- a/src/Symfony/Component/Cache/Adapter/RedisAdapter.php
+++ b/src/Symfony/Component/Cache/Adapter/RedisAdapter.php
@@ -26,7 +26,7 @@ class RedisAdapter extends AbstractAdapter
'class' => null,
'persistent' => 0,
'persistent_id' => null,
- 'timeout' => 0,
+ 'timeout' => 30,
'read_timeout' => 0,
'retry_interval' => 0,
);
diff --git a/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php b/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php
index e05fd1b941..150a2ec9ab 100644
--- a/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php
+++ b/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php
@@ -210,7 +210,7 @@ class ExprBuilder
/**
* Returns the related node.
*
- * @return NodeDefinition
+ * @return NodeDefinition|ArrayNodeDefinition|VariableNodeDefinition
*
* @throws \RuntimeException
*/
diff --git a/src/Symfony/Component/Config/Definition/Builder/MergeBuilder.php b/src/Symfony/Component/Config/Definition/Builder/MergeBuilder.php
index 14240f5251..1d24953df5 100644
--- a/src/Symfony/Component/Config/Definition/Builder/MergeBuilder.php
+++ b/src/Symfony/Component/Config/Definition/Builder/MergeBuilder.php
@@ -63,7 +63,7 @@ class MergeBuilder
/**
* Returns the related node.
*
- * @return NodeDefinition
+ * @return NodeDefinition|ArrayNodeDefinition|VariableNodeDefinition
*/
public function end()
{
diff --git a/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php b/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
index c8a3a248b4..1b712a3150 100644
--- a/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
+++ b/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
@@ -107,7 +107,7 @@ abstract class NodeDefinition implements NodeParentInterface
/**
* Returns the parent node.
*
- * @return NodeParentInterface|NodeBuilder|NodeDefinition|null The builder of the parent node
+ * @return NodeParentInterface|NodeBuilder|NodeDefinition|ArrayNodeDefinition|VariableNodeDefinition|null The builder of the parent node
*/
public function end()
{
diff --git a/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php b/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php
index e885823892..12aa59a4fd 100644
--- a/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php
+++ b/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php
@@ -36,7 +36,7 @@ class ValidationBuilder
*
* @param \Closure $closure
*
- * @return ExprBuilder|ValidationBuilder
+ * @return ExprBuilder|$this
*/
public function rule(\Closure $closure = null)
{
diff --git a/src/Symfony/Component/Console/Command/Command.php b/src/Symfony/Component/Console/Command/Command.php
index b673b100a3..2aca302a1e 100644
--- a/src/Symfony/Component/Console/Command/Command.php
+++ b/src/Symfony/Component/Console/Command/Command.php
@@ -228,7 +228,14 @@ class Command
if (null !== $this->processTitle) {
if (function_exists('cli_set_process_title')) {
- cli_set_process_title($this->processTitle);
+ if (false === @cli_set_process_title($this->processTitle)) {
+ if ('Darwin' === PHP_OS) {
+ $output->writeln('Running "cli_get_process_title" as an unprivileged user is not supported on MacOS.');
+ } else {
+ $error = error_get_last();
+ trigger_error($error['message'], E_USER_WARNING);
+ }
+ }
} elseif (function_exists('setproctitle')) {
setproctitle($this->processTitle);
} elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) {
diff --git a/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php b/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php
index 2eb9944d62..c2d6243e28 100644
--- a/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php
+++ b/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php
@@ -13,6 +13,7 @@ namespace Symfony\Component\Console\Descriptor;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Helper\Helper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
@@ -94,7 +95,7 @@ class MarkdownDescriptor extends Descriptor
$this->write(
$command->getName()."\n"
- .str_repeat('-', strlen($command->getName()))."\n\n"
+ .str_repeat('-', Helper::strlen($command->getName()))."\n\n"
.'* Description: '.($command->getDescription() ?: '')."\n"
.'* Usage:'."\n\n"
.array_reduce(array_merge(array($command->getSynopsis()), $command->getAliases(), $command->getUsages()), function ($carry, $usage) {
@@ -121,7 +122,7 @@ class MarkdownDescriptor extends Descriptor
$describedNamespace = isset($options['namespace']) ? $options['namespace'] : null;
$description = new ApplicationDescription($application, $describedNamespace);
- $this->write($application->getName()."\n".str_repeat('=', strlen($application->getName())));
+ $this->write($application->getName()."\n".str_repeat('=', Helper::strlen($application->getName())));
foreach ($description->getNamespaces() as $namespace) {
if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) {
diff --git a/src/Symfony/Component/Console/Descriptor/TextDescriptor.php b/src/Symfony/Component/Console/Descriptor/TextDescriptor.php
index fe4fa502c6..81710046c6 100644
--- a/src/Symfony/Component/Console/Descriptor/TextDescriptor.php
+++ b/src/Symfony/Component/Console/Descriptor/TextDescriptor.php
@@ -13,6 +13,8 @@ namespace Symfony\Component\Console\Descriptor;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Formatter\OutputFormatter;
+use Symfony\Component\Console\Helper\Helper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
@@ -37,7 +39,7 @@ class TextDescriptor extends Descriptor
$default = '';
}
- $totalWidth = isset($options['total_width']) ? $options['total_width'] : strlen($argument->getName());
+ $totalWidth = isset($options['total_width']) ? $options['total_width'] : Helper::strlen($argument->getName());
$spacingWidth = $totalWidth - strlen($argument->getName());
$this->writeText(sprintf(' %s %s%s%s',
@@ -75,7 +77,7 @@ class TextDescriptor extends Descriptor
sprintf('--%s%s', $option->getName(), $value)
);
- $spacingWidth = $totalWidth - strlen($synopsis);
+ $spacingWidth = $totalWidth - Helper::strlen($synopsis);
$this->writeText(sprintf(' %s %s%s%s%s',
$synopsis,
@@ -94,7 +96,7 @@ class TextDescriptor extends Descriptor
{
$totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions());
foreach ($definition->getArguments() as $argument) {
- $totalWidth = max($totalWidth, strlen($argument->getName()));
+ $totalWidth = max($totalWidth, Helper::strlen($argument->getName()));
}
if ($definition->getArguments()) {
@@ -209,7 +211,7 @@ class TextDescriptor extends Descriptor
foreach ($namespace['commands'] as $name) {
if (isset($commands[$name])) {
$this->writeText("\n");
- $spacingWidth = $width - strlen($name);
+ $spacingWidth = $width - Helper::strlen($name);
$command = $commands[$name];
$commandAliases = $this->getCommandAliasesText($command);
$this->writeText(sprintf(' %s%s%s', $name, str_repeat(' ', $spacingWidth), $commandAliases.$command->getDescription()), $options);
@@ -260,6 +262,16 @@ class TextDescriptor extends Descriptor
*/
private function formatDefaultValue($default)
{
+ if (is_string($default)) {
+ $default = OutputFormatter::escape($default);
+ } elseif (is_array($default)) {
+ foreach ($default as $key => $value) {
+ if (is_string($value)) {
+ $default[$key] = OutputFormatter::escape($value);
+ }
+ }
+ }
+
return str_replace('\\\\', '\\', json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
}
@@ -273,9 +285,9 @@ class TextDescriptor extends Descriptor
$widths = array();
foreach ($commands as $command) {
- $widths[] = strlen($command->getName());
+ $widths[] = Helper::strlen($command->getName());
foreach ($command->getAliases() as $alias) {
- $widths[] = strlen($alias);
+ $widths[] = Helper::strlen($alias);
}
}
@@ -292,10 +304,10 @@ class TextDescriptor extends Descriptor
$totalWidth = 0;
foreach ($options as $option) {
// "-" + shortcut + ", --" + name
- $nameLength = 1 + max(strlen($option->getShortcut()), 1) + 4 + strlen($option->getName());
+ $nameLength = 1 + max(Helper::strlen($option->getShortcut()), 1) + 4 + Helper::strlen($option->getName());
if ($option->acceptValue()) {
- $valueLength = 1 + strlen($option->getName()); // = + value
+ $valueLength = 1 + Helper::strlen($option->getName()); // = + value
$valueLength += $option->isValueOptional() ? 2 : 0; // [ + ]
$nameLength += $valueLength;
diff --git a/src/Symfony/Component/Console/Helper/Table.php b/src/Symfony/Component/Console/Helper/Table.php
index d58b424c76..37ba3f5323 100644
--- a/src/Symfony/Component/Console/Helper/Table.php
+++ b/src/Symfony/Component/Console/Helper/Table.php
@@ -152,7 +152,7 @@ class Table
* @param int $columnIndex Column index
* @param TableStyle|string $name The style name or a TableStyle instance
*
- * @return Table
+ * @return $this
*/
public function setColumnStyle($columnIndex, $name)
{
@@ -187,7 +187,7 @@ class Table
* @param int $columnIndex Column index
* @param int $width Minimum column width in characters
*
- * @return Table
+ * @return $this
*/
public function setColumnWidth($columnIndex, $width)
{
@@ -201,7 +201,7 @@ class Table
*
* @param array $widths
*
- * @return Table
+ * @return $this
*/
public function setColumnWidths(array $widths)
{
diff --git a/src/Symfony/Component/Console/Tests/Command/CommandTest.php b/src/Symfony/Component/Console/Tests/Command/CommandTest.php
index d60f071519..135e6f3d7e 100644
--- a/src/Symfony/Component/Console/Tests/Command/CommandTest.php
+++ b/src/Symfony/Component/Console/Tests/Command/CommandTest.php
@@ -335,6 +335,9 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$command->setProcessTitle('foo');
$this->assertSame(0, $command->run(new StringInput(''), new NullOutput()));
if (function_exists('cli_set_process_title')) {
+ if (null === @cli_get_process_title() && 'Darwin' === PHP_OS) {
+ $this->markTestSkipped('Running "cli_get_process_title" as an unprivileged user is not supported on MacOS.');
+ }
$this->assertEquals('foo', cli_get_process_title());
}
}
diff --git a/src/Symfony/Component/Console/Tests/Descriptor/AbstractDescriptorTest.php b/src/Symfony/Component/Console/Tests/Descriptor/AbstractDescriptorTest.php
index c36c4a8e5e..74e95b7569 100644
--- a/src/Symfony/Component/Console/Tests/Descriptor/AbstractDescriptorTest.php
+++ b/src/Symfony/Component/Console/Tests/Descriptor/AbstractDescriptorTest.php
@@ -86,7 +86,7 @@ abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase
abstract protected function getFormat();
- private function getDescriptionTestData(array $objects)
+ protected function getDescriptionTestData(array $objects)
{
$data = array();
foreach ($objects as $name => $object) {
diff --git a/src/Symfony/Component/Console/Tests/Descriptor/MarkdownDescriptorTest.php b/src/Symfony/Component/Console/Tests/Descriptor/MarkdownDescriptorTest.php
index c85e8a594b..eb80f58b1c 100644
--- a/src/Symfony/Component/Console/Tests/Descriptor/MarkdownDescriptorTest.php
+++ b/src/Symfony/Component/Console/Tests/Descriptor/MarkdownDescriptorTest.php
@@ -12,9 +12,27 @@
namespace Symfony\Component\Console\Tests\Descriptor;
use Symfony\Component\Console\Descriptor\MarkdownDescriptor;
+use Symfony\Component\Console\Tests\Fixtures\DescriptorApplicationMbString;
+use Symfony\Component\Console\Tests\Fixtures\DescriptorCommandMbString;
class MarkdownDescriptorTest extends AbstractDescriptorTest
{
+ public function getDescribeCommandTestData()
+ {
+ return $this->getDescriptionTestData(array_merge(
+ ObjectsProvider::getCommands(),
+ array('command_mbstring' => new DescriptorCommandMbString())
+ ));
+ }
+
+ public function getDescribeApplicationTestData()
+ {
+ return $this->getDescriptionTestData(array_merge(
+ ObjectsProvider::getApplications(),
+ array('application_mbstring' => new DescriptorApplicationMbString())
+ ));
+ }
+
protected function getDescriptor()
{
return new MarkdownDescriptor();
diff --git a/src/Symfony/Component/Console/Tests/Descriptor/ObjectsProvider.php b/src/Symfony/Component/Console/Tests/Descriptor/ObjectsProvider.php
index 45b3b2fff9..8f825ecb68 100644
--- a/src/Symfony/Component/Console/Tests/Descriptor/ObjectsProvider.php
+++ b/src/Symfony/Component/Console/Tests/Descriptor/ObjectsProvider.php
@@ -31,6 +31,7 @@ class ObjectsProvider
'input_argument_2' => new InputArgument('argument_name', InputArgument::IS_ARRAY, 'argument description'),
'input_argument_3' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', 'default_value'),
'input_argument_4' => new InputArgument('argument_name', InputArgument::REQUIRED, "multiline\nargument description"),
+ 'input_argument_with_style' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', 'style>'),
);
}
@@ -43,6 +44,8 @@ class ObjectsProvider
'input_option_4' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'option description', array()),
'input_option_5' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, "multiline\noption description"),
'input_option_6' => new InputOption('option_name', array('o', 'O'), InputOption::VALUE_REQUIRED, 'option with multiple shortcuts'),
+ 'input_option_with_style' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description', 'style>'),
+ 'input_option_with_style_array' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'option description', array('Hello', 'world')),
);
}
diff --git a/src/Symfony/Component/Console/Tests/Descriptor/TextDescriptorTest.php b/src/Symfony/Component/Console/Tests/Descriptor/TextDescriptorTest.php
index 350b67950d..364e29c026 100644
--- a/src/Symfony/Component/Console/Tests/Descriptor/TextDescriptorTest.php
+++ b/src/Symfony/Component/Console/Tests/Descriptor/TextDescriptorTest.php
@@ -12,9 +12,27 @@
namespace Symfony\Component\Console\Tests\Descriptor;
use Symfony\Component\Console\Descriptor\TextDescriptor;
+use Symfony\Component\Console\Tests\Fixtures\DescriptorApplicationMbString;
+use Symfony\Component\Console\Tests\Fixtures\DescriptorCommandMbString;
class TextDescriptorTest extends AbstractDescriptorTest
{
+ public function getDescribeCommandTestData()
+ {
+ return $this->getDescriptionTestData(array_merge(
+ ObjectsProvider::getCommands(),
+ array('command_mbstring' => new DescriptorCommandMbString())
+ ));
+ }
+
+ public function getDescribeApplicationTestData()
+ {
+ return $this->getDescriptionTestData(array_merge(
+ ObjectsProvider::getApplications(),
+ array('application_mbstring' => new DescriptorApplicationMbString())
+ ));
+ }
+
protected function getDescriptor()
{
return new TextDescriptor();
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/DescriptorApplicationMbString.php b/src/Symfony/Component/Console/Tests/Fixtures/DescriptorApplicationMbString.php
new file mode 100644
index 0000000000..bf170c449f
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/DescriptorApplicationMbString.php
@@ -0,0 +1,24 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests\Fixtures;
+
+use Symfony\Component\Console\Application;
+
+class DescriptorApplicationMbString extends Application
+{
+ public function __construct()
+ {
+ parent::__construct('MbString åpplicätion');
+
+ $this->add(new DescriptorCommandMbString());
+ }
+}
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/DescriptorCommandMbString.php b/src/Symfony/Component/Console/Tests/Fixtures/DescriptorCommandMbString.php
new file mode 100644
index 0000000000..66de917e29
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/DescriptorCommandMbString.php
@@ -0,0 +1,32 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests\Fixtures;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+
+class DescriptorCommandMbString extends Command
+{
+ protected function configure()
+ {
+ $this
+ ->setName('descriptor:åèä')
+ ->setDescription('command åèä description')
+ ->setHelp('command åèä help')
+ ->addUsage('-o|--option_name ')
+ ->addUsage('')
+ ->addArgument('argument_åèä', InputArgument::REQUIRED)
+ ->addOption('option_åèä', 'o', InputOption::VALUE_NONE)
+ ;
+ }
+}
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md b/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md
new file mode 100644
index 0000000000..ef81f86972
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md
@@ -0,0 +1,309 @@
+MbString åpplicätion
+====================
+
+* help
+* list
+
+**descriptor:**
+
+* descriptor:åèä
+
+help
+----
+
+* Description: Displays help for a command
+* Usage:
+
+ * `help [--xml] [--format FORMAT] [--raw] [--] []`
+
+The help command displays help for a given command:
+
+ php app/console help list
+
+You can also output the help in other formats by using the --format option:
+
+ php app/console help --format=xml list
+
+To display the list of available commands, please use the list command.
+
+### Arguments:
+
+**command_name:**
+
+* Name: command_name
+* Is required: no
+* Is array: no
+* Description: The command name
+* Default: `'help'`
+
+### Options:
+
+**xml:**
+
+* Name: `--xml`
+* Shortcut:
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: To output help as XML
+* Default: `false`
+
+**format:**
+
+* Name: `--format`
+* Shortcut:
+* Accept value: yes
+* Is value required: yes
+* Is multiple: no
+* Description: The output format (txt, xml, json, or md)
+* Default: `'txt'`
+
+**raw:**
+
+* Name: `--raw`
+* Shortcut:
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: To output raw command help
+* Default: `false`
+
+**help:**
+
+* Name: `--help`
+* Shortcut: `-h`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Display this help message
+* Default: `false`
+
+**quiet:**
+
+* Name: `--quiet`
+* Shortcut: `-q`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Do not output any message
+* Default: `false`
+
+**verbose:**
+
+* Name: `--verbose`
+* Shortcut: `-v|-vv|-vvv`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
+* Default: `false`
+
+**version:**
+
+* Name: `--version`
+* Shortcut: `-V`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Display this application version
+* Default: `false`
+
+**ansi:**
+
+* Name: `--ansi`
+* Shortcut:
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Force ANSI output
+* Default: `false`
+
+**no-ansi:**
+
+* Name: `--no-ansi`
+* Shortcut:
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Disable ANSI output
+* Default: `false`
+
+**no-interaction:**
+
+* Name: `--no-interaction`
+* Shortcut: `-n`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Do not ask any interactive question
+* Default: `false`
+
+list
+----
+
+* Description: Lists commands
+* Usage:
+
+ * `list [--xml] [--raw] [--format FORMAT] [--] []`
+
+The list command lists all commands:
+
+ php app/console list
+
+You can also display the commands for a specific namespace:
+
+ php app/console list test
+
+You can also output the information in other formats by using the --format option:
+
+ php app/console list --format=xml
+
+It's also possible to get raw list of commands (useful for embedding command runner):
+
+ php app/console list --raw
+
+### Arguments:
+
+**namespace:**
+
+* Name: namespace
+* Is required: no
+* Is array: no
+* Description: The namespace name
+* Default: `NULL`
+
+### Options:
+
+**xml:**
+
+* Name: `--xml`
+* Shortcut:
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: To output list as XML
+* Default: `false`
+
+**raw:**
+
+* Name: `--raw`
+* Shortcut:
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: To output raw command list
+* Default: `false`
+
+**format:**
+
+* Name: `--format`
+* Shortcut:
+* Accept value: yes
+* Is value required: yes
+* Is multiple: no
+* Description: The output format (txt, xml, json, or md)
+* Default: `'txt'`
+
+descriptor:åèä
+--------------
+
+* Description: command åèä description
+* Usage:
+
+ * `descriptor:åèä [-o|--option_åèä] [--] `
+ * `descriptor:åèä -o|--option_name `
+ * `descriptor:åèä `
+
+command åèä help
+
+### Arguments:
+
+**argument_åèä:**
+
+* Name: argument_åèä
+* Is required: yes
+* Is array: no
+* Description:
+* Default: `NULL`
+
+### Options:
+
+**option_åèä:**
+
+* Name: `--option_åèä`
+* Shortcut: `-o`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description:
+* Default: `false`
+
+**help:**
+
+* Name: `--help`
+* Shortcut: `-h`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Display this help message
+* Default: `false`
+
+**quiet:**
+
+* Name: `--quiet`
+* Shortcut: `-q`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Do not output any message
+* Default: `false`
+
+**verbose:**
+
+* Name: `--verbose`
+* Shortcut: `-v|-vv|-vvv`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
+* Default: `false`
+
+**version:**
+
+* Name: `--version`
+* Shortcut: `-V`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Display this application version
+* Default: `false`
+
+**ansi:**
+
+* Name: `--ansi`
+* Shortcut:
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Force ANSI output
+* Default: `false`
+
+**no-ansi:**
+
+* Name: `--no-ansi`
+* Shortcut:
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Disable ANSI output
+* Default: `false`
+
+**no-interaction:**
+
+* Name: `--no-interaction`
+* Shortcut: `-n`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Do not ask any interactive question
+* Default: `false`
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.txt
new file mode 100644
index 0000000000..9d21f829d5
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.txt
@@ -0,0 +1,19 @@
+MbString åpplicätion
+
+Usage:
+ command [options] [arguments]
+
+Options:
+ -h, --help Display this help message
+ -q, --quiet Do not output any message
+ -V, --version Display this application version
+ --ansi Force ANSI output
+ --no-ansi Disable ANSI output
+ -n, --no-interaction Do not ask any interactive question
+ -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
+
+Available commands:
+ help Displays help for a command
+ list Lists commands
+ descriptor
+ descriptor:åèä command åèä description
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/command_mbstring.md b/src/Symfony/Component/Console/Tests/Fixtures/command_mbstring.md
new file mode 100644
index 0000000000..2adac53f05
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/command_mbstring.md
@@ -0,0 +1,33 @@
+descriptor:åèä
+--------------
+
+* Description: command åèä description
+* Usage:
+
+ * `descriptor:åèä [-o|--option_åèä] [--] `
+ * `descriptor:åèä -o|--option_name `
+ * `descriptor:åèä `
+
+command åèä help
+
+### Arguments:
+
+**argument_åèä:**
+
+* Name: argument_åèä
+* Is required: yes
+* Is array: no
+* Description:
+* Default: `NULL`
+
+### Options:
+
+**option_åèä:**
+
+* Name: `--option_åèä`
+* Shortcut: `-o`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description:
+* Default: `false`
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/command_mbstring.txt b/src/Symfony/Component/Console/Tests/Fixtures/command_mbstring.txt
new file mode 100644
index 0000000000..969a065242
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/command_mbstring.txt
@@ -0,0 +1,13 @@
+Usage:
+ descriptor:åèä [options] [--]
+ descriptor:åèä -o|--option_name
+ descriptor:åèä
+
+Arguments:
+ argument_åèä
+
+Options:
+ -o, --option_åèä
+
+Help:
+ command åèä help
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/input_argument_with_style.json b/src/Symfony/Component/Console/Tests/Fixtures/input_argument_with_style.json
new file mode 100644
index 0000000000..9334235109
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/input_argument_with_style.json
@@ -0,0 +1,7 @@
+{
+ "name": "argument_name",
+ "is_required": false,
+ "is_array": false,
+ "description": "argument description",
+ "default": "style>"
+}
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/input_argument_with_style.md b/src/Symfony/Component/Console/Tests/Fixtures/input_argument_with_style.md
new file mode 100644
index 0000000000..45adf2f488
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/input_argument_with_style.md
@@ -0,0 +1,7 @@
+**argument_name:**
+
+* Name: argument_name
+* Is required: no
+* Is array: no
+* Description: argument description
+* Default: `'style>'`
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/input_argument_with_style.txt b/src/Symfony/Component/Console/Tests/Fixtures/input_argument_with_style.txt
new file mode 100644
index 0000000000..35384a6be8
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/input_argument_with_style.txt
@@ -0,0 +1 @@
+ argument_name argument description [default: "\style\>"]
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/input_argument_with_style.xml b/src/Symfony/Component/Console/Tests/Fixtures/input_argument_with_style.xml
new file mode 100644
index 0000000000..73332c796e
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/input_argument_with_style.xml
@@ -0,0 +1,7 @@
+
+
+ argument description
+
+ <comment>style</>
+
+
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style.json b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style.json
new file mode 100644
index 0000000000..df328bf824
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style.json
@@ -0,0 +1,9 @@
+{
+ "name": "--option_name",
+ "shortcut": "-o",
+ "accept_value": true,
+ "is_value_required": true,
+ "is_multiple": false,
+ "description": "option description",
+ "default": "style>"
+}
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style.md b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style.md
new file mode 100644
index 0000000000..3f6dd2369a
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style.md
@@ -0,0 +1,9 @@
+**option_name:**
+
+* Name: `--option_name`
+* Shortcut: `-o`
+* Accept value: yes
+* Is value required: yes
+* Is multiple: no
+* Description: option description
+* Default: `'style>'`
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style.txt b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style.txt
new file mode 100644
index 0000000000..880a53518e
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style.txt
@@ -0,0 +1 @@
+ -o, --option_name=OPTION_NAME option description [default: "\style\>"]
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style.xml b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style.xml
new file mode 100644
index 0000000000..764b9e6521
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style.xml
@@ -0,0 +1,7 @@
+
+
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style_array.json b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style_array.json
new file mode 100644
index 0000000000..b1754550b5
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style_array.json
@@ -0,0 +1,12 @@
+{
+ "name": "--option_name",
+ "shortcut": "-o",
+ "accept_value": true,
+ "is_value_required": true,
+ "is_multiple": true,
+ "description": "option description",
+ "default": [
+ "Hello",
+ "world"
+ ]
+}
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style_array.md b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style_array.md
new file mode 100644
index 0000000000..24e58b5302
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style_array.md
@@ -0,0 +1,9 @@
+**option_name:**
+
+* Name: `--option_name`
+* Shortcut: `-o`
+* Accept value: yes
+* Is value required: yes
+* Is multiple: yes
+* Description: option description
+* Default: `array ( 0 => 'Hello', 1 => 'world',)`
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style_array.txt b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style_array.txt
new file mode 100644
index 0000000000..265c18c5a4
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style_array.txt
@@ -0,0 +1 @@
+ -o, --option_name=OPTION_NAME option description [default: ["\Hello\","\world\"]] (multiple values allowed)
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style_array.xml b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style_array.xml
new file mode 100644
index 0000000000..09dc865830
--- /dev/null
+++ b/src/Symfony/Component/Console/Tests/Fixtures/input_option_with_style_array.xml
@@ -0,0 +1,8 @@
+
+
diff --git a/src/Symfony/Component/Debug/ErrorHandler.php b/src/Symfony/Component/Debug/ErrorHandler.php
index 5728b5d010..f03a93d682 100644
--- a/src/Symfony/Component/Debug/ErrorHandler.php
+++ b/src/Symfony/Component/Debug/ErrorHandler.php
@@ -529,7 +529,11 @@ class ErrorHandler
}
}
if ($this->loggedErrors & $type) {
- $this->loggers[$type][0]->log($this->loggers[$type][1], $message, array('exception' => $exception));
+ try {
+ $this->loggers[$type][0]->log($this->loggers[$type][1], $message, array('exception' => $exception));
+ } catch (\Exception $handlerException) {
+ } catch (\Throwable $handlerException) {
+ }
}
if ($exception instanceof FatalErrorException && !$exception instanceof OutOfMemoryException && $error) {
foreach ($this->getFatalErrorHandlers() as $handler) {
diff --git a/src/Symfony/Component/Debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php b/src/Symfony/Component/Debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php
index f734d6bb7d..6fa62b6f24 100644
--- a/src/Symfony/Component/Debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php
+++ b/src/Symfony/Component/Debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php
@@ -36,8 +36,13 @@ class UndefinedMethodFatalErrorHandler implements FatalErrorHandlerInterface
$message = sprintf('Attempted to call an undefined method named "%s" of class "%s".', $methodName, $className);
+ if (!class_exists($className) || null === $methods = get_class_methods($className)) {
+ // failed to get the class or its methods on which an unknown method was called (for example on an anonymous class)
+ return new UndefinedMethodException($message, $exception);
+ }
+
$candidates = array();
- foreach (get_class_methods($className) as $definedMethodName) {
+ foreach ($methods as $definedMethodName) {
$lev = levenshtein($methodName, $definedMethodName);
if ($lev <= strlen($methodName) / 3 || false !== strpos($definedMethodName, $methodName)) {
$candidates[] = $definedMethodName;
@@ -52,6 +57,7 @@ class UndefinedMethodFatalErrorHandler implements FatalErrorHandlerInterface
} else {
$candidates = '"'.$last;
}
+
$message .= "\nDid you mean to call ".$candidates;
}
diff --git a/src/Symfony/Component/Debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php b/src/Symfony/Component/Debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php
index de7b21c699..22cbc3033b 100644
--- a/src/Symfony/Component/Debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php
+++ b/src/Symfony/Component/Debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php
@@ -61,6 +61,15 @@ class UndefinedMethodFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase
),
"Attempted to call an undefined method named \"offsetFet\" of class \"SplObjectStorage\".\nDid you mean to call e.g. \"offsetGet\", \"offsetSet\" or \"offsetUnset\"?",
),
+ array(
+ array(
+ 'type' => 1,
+ 'message' => 'Call to undefined method class@anonymous::test()',
+ 'file' => '/home/possum/work/symfony/test.php',
+ 'line' => 11,
+ ),
+ 'Attempted to call an undefined method named "test" of class "class@anonymous".',
+ ),
);
}
}
diff --git a/src/Symfony/Component/DependencyInjection/Definition.php b/src/Symfony/Component/DependencyInjection/Definition.php
index 6770fec4f2..9692814226 100644
--- a/src/Symfony/Component/DependencyInjection/Definition.php
+++ b/src/Symfony/Component/DependencyInjection/Definition.php
@@ -437,7 +437,7 @@ class Definition
*
* @param bool $shared Whether the service must be shared or not
*
- * @return Definition The current instance
+ * @return $this
*/
public function setShared($shared)
{
@@ -563,7 +563,7 @@ class Definition
* @param bool $status
* @param string $template Template message to use if the definition is deprecated
*
- * @return Definition the current instance
+ * @return $this
*
* @throws InvalidArgumentException When the message template is invalid.
*/
@@ -642,7 +642,7 @@ class Definition
*
* @param string[] $types
*
- * @return Definition The current instance
+ * @return $this
*/
public function setAutowiringTypes(array $types)
{
@@ -670,7 +670,7 @@ class Definition
*
* @param bool $autowired
*
- * @return Definition The current instance
+ * @return $this
*/
public function setAutowired($autowired)
{
@@ -694,7 +694,7 @@ class Definition
*
* @param string $type
*
- * @return Definition The current instance
+ * @return $this
*/
public function addAutowiringType($type)
{
@@ -708,7 +708,7 @@ class Definition
*
* @param string $type
*
- * @return Definition The current instance
+ * @return $this
*/
public function removeAutowiringType($type)
{
diff --git a/src/Symfony/Component/DomCrawler/Crawler.php b/src/Symfony/Component/DomCrawler/Crawler.php
index 70ca6e66d0..0b0d0dadb2 100644
--- a/src/Symfony/Component/DomCrawler/Crawler.php
+++ b/src/Symfony/Component/DomCrawler/Crawler.php
@@ -724,7 +724,7 @@ class Crawler implements \Countable, \IteratorAggregate
*
* @param string $value The image alt
*
- * @return Crawler A new instance of Crawler with the filtered list of nodes
+ * @return self A new instance of Crawler with the filtered list of nodes
*/
public function selectImage($value)
{
diff --git a/src/Symfony/Component/Form/ChoiceList/View/ChoiceGroupView.php b/src/Symfony/Component/Form/ChoiceList/View/ChoiceGroupView.php
index 9e648cc360..f3eae3762a 100644
--- a/src/Symfony/Component/Form/ChoiceList/View/ChoiceGroupView.php
+++ b/src/Symfony/Component/Form/ChoiceList/View/ChoiceGroupView.php
@@ -48,7 +48,7 @@ class ChoiceGroupView implements \IteratorAggregate
/**
* {@inheritdoc}
*
- * @return ChoiceGroupView[]|ChoiceView[]
+ * @return self[]|ChoiceView[]
*/
public function getIterator()
{
diff --git a/src/Symfony/Component/Form/ResolvedFormTypeInterface.php b/src/Symfony/Component/Form/ResolvedFormTypeInterface.php
index 7d7647728f..dc3b81d2fa 100644
--- a/src/Symfony/Component/Form/ResolvedFormTypeInterface.php
+++ b/src/Symfony/Component/Form/ResolvedFormTypeInterface.php
@@ -30,7 +30,7 @@ interface ResolvedFormTypeInterface
/**
* Returns the parent type.
*
- * @return ResolvedFormTypeInterface|null The parent type or null
+ * @return self|null The parent type or null
*/
public function getParent();
diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php
index c2c3ad21b2..09138b1da7 100644
--- a/src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php
+++ b/src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php
@@ -1364,7 +1364,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testDateTime()
{
- $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', array(
+ $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', date('Y').'-02-03 04:05:06', array(
'input' => 'string',
'with_seconds' => false,
));
@@ -1383,7 +1383,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
/following-sibling::select
[@id="name_date_year"]
[@class="form-control"]
- [./option[@value="2011"][@selected="selected"]]
+ [./option[@value="'.date('Y').'"][@selected="selected"]]
/following-sibling::select
[@id="name_time_hour"]
[@class="form-control"]
@@ -1438,7 +1438,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testDateTimeWithHourAndMinute()
{
- $data = array('year' => '2011', 'month' => '2', 'day' => '3', 'hour' => '4', 'minute' => '5');
+ $data = array('year' => date('Y'), 'month' => '2', 'day' => '3', 'hour' => '4', 'minute' => '5');
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', $data, array(
'input' => 'array',
@@ -1460,7 +1460,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
/following-sibling::select
[@id="name_date_year"]
[@class="form-control"]
- [./option[@value="2011"][@selected="selected"]]
+ [./option[@value="'.date('Y').'"][@selected="selected"]]
/following-sibling::select
[@id="name_time_hour"]
[@class="form-control"]
@@ -1477,7 +1477,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testDateTimeWithSeconds()
{
- $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', array(
+ $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', date('Y').'-02-03 04:05:06', array(
'input' => 'string',
'with_seconds' => true,
));
@@ -1497,7 +1497,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
/following-sibling::select
[@id="name_date_year"]
[@class="form-control"]
- [./option[@value="2011"][@selected="selected"]]
+ [./option[@value="'.date('Y').'"][@selected="selected"]]
/following-sibling::select
[@id="name_time_hour"]
[@class="form-control"]
@@ -1587,7 +1587,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testDateChoice()
{
- $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', '2011-02-03', array(
+ $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', date('Y').'-02-03', array(
'input' => 'string',
'widget' => 'choice',
));
@@ -1607,7 +1607,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
/following-sibling::select
[@id="name_year"]
[@class="form-control"]
- [./option[@value="2011"][@selected="selected"]]
+ [./option[@value="'.date('Y').'"][@selected="selected"]]
]
[count(./select)=3]
'
diff --git a/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
index 069b57b357..31372ebef9 100644
--- a/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
+++ b/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
@@ -1233,7 +1233,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testDateTime()
{
- $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', array(
+ $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', date('Y').'-02-03 04:05:06', array(
'input' => 'string',
'with_seconds' => false,
));
@@ -1252,7 +1252,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
[./option[@value="3"][@selected="selected"]]
/following-sibling::select
[@id="name_date_year"]
- [./option[@value="2011"][@selected="selected"]]
+ [./option[@value="'.date('Y').'"][@selected="selected"]]
]
/following-sibling::div
[@id="name_time"]
@@ -1312,7 +1312,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testDateTimeWithHourAndMinute()
{
- $data = array('year' => '2011', 'month' => '2', 'day' => '3', 'hour' => '4', 'minute' => '5');
+ $data = array('year' => date('Y'), 'month' => '2', 'day' => '3', 'hour' => '4', 'minute' => '5');
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', $data, array(
'input' => 'array',
@@ -1333,7 +1333,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
[./option[@value="3"][@selected="selected"]]
/following-sibling::select
[@id="name_date_year"]
- [./option[@value="2011"][@selected="selected"]]
+ [./option[@value="'.date('Y').'"][@selected="selected"]]
]
/following-sibling::div
[@id="name_time"]
@@ -1353,7 +1353,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testDateTimeWithSeconds()
{
- $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', array(
+ $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', date('Y').'-02-03 04:05:06', array(
'input' => 'string',
'with_seconds' => true,
));
@@ -1372,7 +1372,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
[./option[@value="3"][@selected="selected"]]
/following-sibling::select
[@id="name_date_year"]
- [./option[@value="2011"][@selected="selected"]]
+ [./option[@value="'.date('Y').'"][@selected="selected"]]
]
/following-sibling::div
[@id="name_time"]
@@ -1459,7 +1459,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testDateChoice()
{
- $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', '2011-02-03', array(
+ $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', date('Y').'-02-03', array(
'input' => 'string',
'widget' => 'choice',
));
@@ -1475,7 +1475,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
[./option[@value="3"][@selected="selected"]]
/following-sibling::select
[@id="name_year"]
- [./option[@value="2011"][@selected="selected"]]
+ [./option[@value="'.date('Y').'"][@selected="selected"]]
]
[count(./select)=3]
'
diff --git a/src/Symfony/Component/HttpFoundation/JsonResponse.php b/src/Symfony/Component/HttpFoundation/JsonResponse.php
index dacc5193f2..cf1a11ea2c 100644
--- a/src/Symfony/Component/HttpFoundation/JsonResponse.php
+++ b/src/Symfony/Component/HttpFoundation/JsonResponse.php
@@ -117,7 +117,7 @@ class JsonResponse extends Response
*
* @param string $json
*
- * @return JsonResponse
+ * @return $this
*
* @throws \InvalidArgumentException
*/
diff --git a/src/Symfony/Component/PropertyInfo/Type.php b/src/Symfony/Component/PropertyInfo/Type.php
index 8a55a7cbc2..ad21f91724 100644
--- a/src/Symfony/Component/PropertyInfo/Type.php
+++ b/src/Symfony/Component/PropertyInfo/Type.php
@@ -148,7 +148,7 @@ class Type
*
* Only applicable for a collection type.
*
- * @return Type|null
+ * @return self|null
*/
public function getCollectionKeyType()
{
@@ -160,7 +160,7 @@ class Type
*
* Only applicable for a collection type.
*
- * @return Type|null
+ * @return self|null
*/
public function getCollectionValueType()
{
diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php b/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php
index 2bfdb2e882..b24c8512ce 100644
--- a/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php
+++ b/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php
@@ -38,7 +38,7 @@ class DumperCollection implements \IteratorAggregate
/**
* Returns the children routes and collections.
*
- * @return DumperCollection[]|DumperRoute[] Array of DumperCollection|DumperRoute
+ * @return self[]|DumperRoute[]
*/
public function all()
{
@@ -96,7 +96,7 @@ class DumperCollection implements \IteratorAggregate
/**
* Returns the parent collection.
*
- * @return DumperCollection|null The parent collection or null if the collection has no parent
+ * @return self|null The parent collection or null if the collection has no parent
*/
protected function getParent()
{
diff --git a/src/Symfony/Component/Routing/RouteCollectionBuilder.php b/src/Symfony/Component/Routing/RouteCollectionBuilder.php
index 5f0256ac00..726dfa9022 100644
--- a/src/Symfony/Component/Routing/RouteCollectionBuilder.php
+++ b/src/Symfony/Component/Routing/RouteCollectionBuilder.php
@@ -55,7 +55,7 @@ class RouteCollectionBuilder
* @param string|null $prefix
* @param string $type
*
- * @return RouteCollectionBuilder
+ * @return self
*
* @throws FileLoaderLoadException
*/
@@ -101,7 +101,7 @@ class RouteCollectionBuilder
/**
* Returns a RouteCollectionBuilder that can be configured and then added with mount().
*
- * @return RouteCollectionBuilder
+ * @return self
*/
public function createBuilder()
{
diff --git a/src/Symfony/Component/Stopwatch/Section.php b/src/Symfony/Component/Stopwatch/Section.php
index e2d4dec5cb..2337e03140 100644
--- a/src/Symfony/Component/Stopwatch/Section.php
+++ b/src/Symfony/Component/Stopwatch/Section.php
@@ -53,7 +53,7 @@ class Section
*
* @param string $id The child section identifier
*
- * @return Section|null The child section or null when none found
+ * @return self|null The child section or null when none found
*/
public function get($id)
{
diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf
index c40f76ee88..ae4ed1df73 100644
--- a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf
+++ b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf
@@ -36,11 +36,11 @@
- To pole nie spodziewano.
+ Tego pola się nie spodziewano.
- To pole jest chybianie.
+ Tego pola brakuje.