Merge branch '2.3'
* 2.3: Update JsonResponse.php [HttpKernel] fixed the inline renderer when passing objects as attributes (closes #7124) CookieJar remove unneeded var, Client remove unneeded else [DI] Fixed bug requesting non existing service from dumped frozen container Update validators.sk.xlf [WebProfiler] fix content-type parameter Replace romaji period characters with Japanese style zenkaku period characters fixed CS fixed CS [Console] Avoided an unnecessary check. Added missing French validator translations typo first->second Passed the config when building the Configuration in ConfigurableExtension removed unused code Fixed variable name used in translation cache Conflicts: src/Symfony/Component/Console/Event/ConsoleCommandEvent.php
This commit is contained in:
commit
99f97e59f1
|
@ -12,8 +12,6 @@
|
|||
namespace Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass;
|
||||
|
||||
use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
|
|
|
@ -13,10 +13,8 @@ namespace Symfony\Bridge\ProxyManager\LazyProxy\Tests;
|
|||
|
||||
require_once __DIR__ . '/Fixtures/includes/foo.php';
|
||||
|
||||
use ProxyManager\Configuration;
|
||||
use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Integration tests for {@see \Symfony\Component\DependencyInjection\ContainerBuilder} combined
|
||||
|
|
|
@ -11,10 +11,8 @@
|
|||
|
||||
namespace Symfony\Bridge\ProxyManager\LazyProxy\Tests\Dumper;
|
||||
|
||||
use ProxyManager\Configuration;
|
||||
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
|
||||
|
||||
/**
|
||||
|
@ -46,7 +44,6 @@ class PhpDumperTest extends \PHPUnit_Framework_TestCase
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verifies that the generated container retrieves the same proxy instance on multiple subsequent requests
|
||||
*/
|
||||
|
|
|
@ -194,5 +194,4 @@ class stdClass_c1d194250ee2e2b7d2eab8b8212368a8 extends \stdClass implements \Pr
|
|||
return $this->valueHolder5157dd96e88c0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
namespace Symfony\Bridge\ProxyManager\LazyProxy\Tests\Instantiator;
|
||||
|
||||
use ProxyManager\Configuration;
|
||||
use ProxyManager\Proxy\LazyLoadingInterface;
|
||||
use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
|
|
@ -11,9 +11,7 @@
|
|||
|
||||
namespace Symfony\Bridge\ProxyManager\LazyProxy\Tests\Instantiator;
|
||||
|
||||
use ProxyManager\Configuration;
|
||||
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,7 +19,6 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
/**
|
||||
* A command that parse templates to extract translation messages and add them into the translation files.
|
||||
|
|
|
@ -41,11 +41,11 @@ class SerializerPass implements CompilerPassInterface
|
|||
private function findAndSortTaggedServices($tagName, ContainerBuilder $container)
|
||||
{
|
||||
$services = $container->findTaggedServiceIds($tagName);
|
||||
|
||||
|
||||
if (empty($services)) {
|
||||
throw new \RuntimeException(sprintf('You must tag at least one service as "%s" to use the Serializer service', $tagName));
|
||||
throw new \RuntimeException(sprintf('You must tag at least one service as "%s" to use the Serializer service', $tagName));
|
||||
}
|
||||
|
||||
|
||||
$sortedServices = array();
|
||||
foreach ($services as $serviceId => $tags) {
|
||||
foreach ($tags as $tag) {
|
||||
|
|
|
@ -138,7 +138,6 @@ class FormHelper extends Helper
|
|||
{
|
||||
// Uncomment this as soon as the deprecation note should be shown
|
||||
// trigger_error('The form helper $view[\'form\']->enctype() is deprecated since version 2.3 and will be removed in 3.0. Use $view[\'form\']->start() instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->renderer->searchAndRenderBlock($view, 'enctype');
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass;
|
|||
|
||||
/**
|
||||
* Tests for the SerializerPass class
|
||||
*
|
||||
*
|
||||
* @author Javier Lopez <f12loalf@gmail.com>
|
||||
*/
|
||||
class SerializerPassTest extends \PHPUnit_Framework_TestCase
|
||||
|
@ -26,50 +26,50 @@ class SerializerPassTest extends \PHPUnit_Framework_TestCase
|
|||
public function testThrowExceptionWhenNoNormalizers()
|
||||
{
|
||||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
|
||||
|
||||
|
||||
$container->expects($this->once())
|
||||
->method('hasDefinition')
|
||||
->with('serializer')
|
||||
->will($this->returnValue(true));
|
||||
|
||||
|
||||
$container->expects($this->once())
|
||||
->method('findTaggedServiceIds')
|
||||
->with('serializer.normalizer')
|
||||
->will($this->returnValue(array()));
|
||||
|
||||
|
||||
$this->setExpectedException('RuntimeException');
|
||||
|
||||
|
||||
$serializerPass = new SerializerPass();
|
||||
$serializerPass->process($container);
|
||||
}
|
||||
|
||||
|
||||
public function testThrowExceptionWhenNoEncoders()
|
||||
{
|
||||
$definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
|
||||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
|
||||
|
||||
|
||||
$container->expects($this->once())
|
||||
->method('hasDefinition')
|
||||
->with('serializer')
|
||||
->will($this->returnValue(true));
|
||||
|
||||
|
||||
$container->expects($this->any())
|
||||
->method('findTaggedServiceIds')
|
||||
->will($this->onConsecutiveCalls(
|
||||
array('n' => array('serializer.normalizer')),
|
||||
array()
|
||||
));
|
||||
|
||||
|
||||
$container->expects($this->once())
|
||||
->method('getDefinition')
|
||||
->will($this->returnValue($definition));
|
||||
|
||||
|
||||
$this->setExpectedException('RuntimeException');
|
||||
|
||||
|
||||
$serializerPass = new SerializerPass();
|
||||
$serializerPass->process($container);
|
||||
}
|
||||
|
||||
|
||||
public function testServicesAreOrderedAccordingToPriority()
|
||||
{
|
||||
$services = array(
|
||||
|
@ -77,7 +77,7 @@ class SerializerPassTest extends \PHPUnit_Framework_TestCase
|
|||
'n1' => array('tag' => array('priority' => 200)),
|
||||
'n2' => array('tag' => array('priority' => 100))
|
||||
);
|
||||
|
||||
|
||||
$expected = array(
|
||||
new Reference('n1'),
|
||||
new Reference('n2'),
|
||||
|
@ -91,15 +91,15 @@ class SerializerPassTest extends \PHPUnit_Framework_TestCase
|
|||
->will($this->returnValue($services));
|
||||
|
||||
$serializerPass = new SerializerPass();
|
||||
|
||||
|
||||
$method = new \ReflectionMethod(
|
||||
'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass',
|
||||
'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass',
|
||||
'findAndSortTaggedServices'
|
||||
);
|
||||
$method->setAccessible(TRUE);
|
||||
|
||||
|
||||
$actual = $method->invoke($serializerPass, 'tag', $container);
|
||||
|
||||
|
||||
$this->assertEquals($expected, $actual);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
|||
'debug' => '%kernel.debug%',
|
||||
),
|
||||
'serializer' => array(
|
||||
'enabled' => false
|
||||
'enabled' => false
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\DependencyInjection\ContainerAware;
|
||||
|
||||
class FragmentController extends ContainerAware
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$actions = $this->container->get('templating')->get('actions');
|
||||
|
||||
return new Response($actions->render($actions->controller('TestBundle:Fragment:inlined', array(
|
||||
'options' => array(
|
||||
'bar' => new Bar(),
|
||||
'eleven' => 11,
|
||||
),
|
||||
))));
|
||||
}
|
||||
|
||||
public function inlinedAction($options, $_format)
|
||||
{
|
||||
return new Response($options['bar']->getBar().' '.$_format);
|
||||
}
|
||||
}
|
||||
|
||||
class Bar
|
||||
{
|
||||
private $bar = 'bar';
|
||||
|
||||
public function getBar()
|
||||
{
|
||||
return $this->bar;
|
||||
}
|
||||
}
|
|
@ -45,7 +45,6 @@ class SubRequestController extends ContainerAware
|
|||
|
||||
// The RouterListener is also tested as if it does not keep the right
|
||||
// Request in the context, a 301 would be generated
|
||||
|
||||
return new Response($content);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,3 +36,11 @@ subrequest_fragment:
|
|||
path: /subrequest/fragment/{_locale}.{_format}
|
||||
defaults: { _controller: TestBundle:SubRequest:fragment, _format: "html" }
|
||||
schemes: [http]
|
||||
|
||||
fragment_home:
|
||||
path: /fragment_home
|
||||
defaults: { _controller: TestBundle:Fragment:index, _format: txt }
|
||||
|
||||
fragment_inlined:
|
||||
path: /fragment_inlined
|
||||
defaults: { _controller: TestBundle:Fragment:inlined }
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||
|
||||
/**
|
||||
* @group functional
|
||||
*/
|
||||
class FragmentTest extends WebTestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider getConfigs
|
||||
*/
|
||||
public function testFragment($insulate)
|
||||
{
|
||||
$client = $this->createClient(array('test_case' => 'Fragment', 'root_config' => 'config.yml'));
|
||||
if ($insulate) {
|
||||
$client->insulate();
|
||||
}
|
||||
|
||||
$client->request('GET', '/fragment_home');
|
||||
|
||||
$this->assertEquals('bar txt', $client->getResponse()->getContent());
|
||||
}
|
||||
|
||||
public function getConfigs()
|
||||
{
|
||||
return array(
|
||||
array(false),
|
||||
array(true),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
|
||||
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
|
||||
|
||||
return array(
|
||||
new FrameworkBundle(),
|
||||
new TestBundle(),
|
||||
);
|
|
@ -0,0 +1,7 @@
|
|||
imports:
|
||||
- { resource: ../config/default.yml }
|
||||
|
||||
framework:
|
||||
fragments: ~
|
||||
templating:
|
||||
engines: ['php']
|
|
@ -0,0 +1,2 @@
|
|||
_fragmenttest_bundle:
|
||||
resource: @TestBundle/Resources/config/routing.yml
|
|
@ -13,9 +13,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Templating;
|
|||
|
||||
use Symfony\Bundle\FrameworkBundle\Templating\TimedPhpEngine;
|
||||
use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
|
||||
use Symfony\Component\Templating\TemplateNameParser;
|
||||
use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables;
|
||||
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
|
||||
|
|
|
@ -45,13 +45,15 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
|
|||
{
|
||||
$translator = $this->getTranslator($this->getLoader());
|
||||
$translator->setLocale('fr');
|
||||
$translator->setFallbackLocales(array('en', 'es'));
|
||||
$translator->setFallbackLocale(array('en', 'es', 'pt-PT', 'pt_BR'));
|
||||
|
||||
$this->assertEquals('foo (FR)', $translator->trans('foo'));
|
||||
$this->assertEquals('bar (EN)', $translator->trans('bar'));
|
||||
$this->assertEquals('foobar (ES)', $translator->trans('foobar'));
|
||||
$this->assertEquals('choice 0 (EN)', $translator->transChoice('choice', 0));
|
||||
$this->assertEquals('no translation', $translator->trans('no translation'));
|
||||
$this->assertEquals('foobarfoo (PT-PT)', $translator->trans('foobarfoo'));
|
||||
$this->assertEquals('other choice 1 (PT-BR)', $translator->transChoice('other choice', 1));
|
||||
}
|
||||
|
||||
public function testTransWithCaching()
|
||||
|
@ -59,25 +61,29 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
|
|||
// prime the cache
|
||||
$translator = $this->getTranslator($this->getLoader(), array('cache_dir' => $this->tmpDir));
|
||||
$translator->setLocale('fr');
|
||||
$translator->setFallbackLocales(array('en', 'es'));
|
||||
$translator->setFallbackLocale(array('en', 'es', 'pt-PT', 'pt_BR'));
|
||||
|
||||
$this->assertEquals('foo (FR)', $translator->trans('foo'));
|
||||
$this->assertEquals('bar (EN)', $translator->trans('bar'));
|
||||
$this->assertEquals('foobar (ES)', $translator->trans('foobar'));
|
||||
$this->assertEquals('choice 0 (EN)', $translator->transChoice('choice', 0));
|
||||
$this->assertEquals('no translation', $translator->trans('no translation'));
|
||||
$this->assertEquals('foobarfoo (PT-PT)', $translator->trans('foobarfoo'));
|
||||
$this->assertEquals('other choice 1 (PT-BR)', $translator->transChoice('other choice', 1));
|
||||
|
||||
// do it another time as the cache is primed now
|
||||
$loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface');
|
||||
$translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir));
|
||||
$translator->setLocale('fr');
|
||||
$translator->setFallbackLocales(array('en', 'es'));
|
||||
$translator->setFallbackLocale(array('en', 'es', 'pt-PT', 'pt_BR'));
|
||||
|
||||
$this->assertEquals('foo (FR)', $translator->trans('foo'));
|
||||
$this->assertEquals('bar (EN)', $translator->trans('bar'));
|
||||
$this->assertEquals('foobar (ES)', $translator->trans('foobar'));
|
||||
$this->assertEquals('choice 0 (EN)', $translator->transChoice('choice', 0));
|
||||
$this->assertEquals('no translation', $translator->trans('no translation'));
|
||||
$this->assertEquals('foobarfoo (PT-PT)', $translator->trans('foobarfoo'));
|
||||
$this->assertEquals('other choice 1 (PT-BR)', $translator->transChoice('other choice', 1));
|
||||
}
|
||||
|
||||
public function testGetLocale()
|
||||
|
@ -155,6 +161,20 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
|
|||
'foobar' => 'foobar (ES)',
|
||||
))))
|
||||
;
|
||||
$loader
|
||||
->expects($this->at(3))
|
||||
->method('load')
|
||||
->will($this->returnValue($this->getCatalogue('pt-PT', array(
|
||||
'foobarfoo' => 'foobarfoo (PT-PT)',
|
||||
))))
|
||||
;
|
||||
$loader
|
||||
->expects($this->at(4))
|
||||
->method('load')
|
||||
->will($this->returnValue($this->getCatalogue('pt_BR', array(
|
||||
'other choice' => '{0} other choice 0 (PT-BR)|{1} other choice 1 (PT-BR)|]1,Inf] other choice inf (PT-BR)',
|
||||
))))
|
||||
;
|
||||
|
||||
return $loader;
|
||||
}
|
||||
|
@ -183,6 +203,8 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
|
|||
$translator->addResource('loader', 'foo', 'fr');
|
||||
$translator->addResource('loader', 'foo', 'en');
|
||||
$translator->addResource('loader', 'foo', 'es');
|
||||
$translator->addResource('loader', 'foo', 'pt-PT'); // European Portuguese
|
||||
$translator->addResource('loader', 'foo', 'pt_BR'); // Brazilian Portuguese
|
||||
|
||||
return $translator;
|
||||
}
|
||||
|
|
|
@ -98,6 +98,8 @@ class Translator extends BaseTranslator
|
|||
$fallbackContent = '';
|
||||
$current = '';
|
||||
foreach ($this->computeFallbackLocales($locale) as $fallback) {
|
||||
$fallbackSuffix = ucfirst(str_replace('-', '_', $fallback));
|
||||
|
||||
$fallbackContent .= sprintf(<<<EOF
|
||||
\$catalogue%s = new MessageCatalogue('%s', %s);
|
||||
\$catalogue%s->addFallbackCatalogue(\$catalogue%s);
|
||||
|
@ -105,11 +107,11 @@ class Translator extends BaseTranslator
|
|||
|
||||
EOF
|
||||
,
|
||||
ucfirst($fallback),
|
||||
$fallbackSuffix,
|
||||
$fallback,
|
||||
var_export($this->catalogues[$fallback]->all(), true),
|
||||
ucfirst($current),
|
||||
ucfirst($fallback)
|
||||
ucfirst(str_replace('-', '_', $current)),
|
||||
$fallbackSuffix
|
||||
);
|
||||
$current = $fallback;
|
||||
}
|
||||
|
|
|
@ -91,12 +91,14 @@ class SecurityRoutingIntegrationTest extends WebTestCase
|
|||
$this->assertRestricted($barredClient, '/secured-by-two-ips');
|
||||
}
|
||||
|
||||
private function assertAllowed($client, $path) {
|
||||
private function assertAllowed($client, $path)
|
||||
{
|
||||
$client->request('GET', $path);
|
||||
$this->assertEquals(404, $client->getResponse()->getStatusCode());
|
||||
}
|
||||
|
||||
private function assertRestricted($client, $path) {
|
||||
private function assertRestricted($client, $path)
|
||||
{
|
||||
$client->request('GET', $path);
|
||||
$this->assertEquals(302, $client->getResponse()->getStatusCode());
|
||||
}
|
||||
|
|
|
@ -93,10 +93,10 @@ class ExceptionController
|
|||
if (!$this->templateExists($template)) {
|
||||
$handler = new ExceptionHandler();
|
||||
|
||||
return new Response($handler->getStylesheet($exception));
|
||||
return new Response($handler->getStylesheet($exception), 200, array('Content-Type' => 'text/css'));
|
||||
}
|
||||
|
||||
return new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'), 200, 'text/css');
|
||||
return new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'), 200, array('Content-Type' => 'text/css'));
|
||||
}
|
||||
|
||||
protected function getTemplate()
|
||||
|
|
|
@ -78,7 +78,7 @@ abstract class Client
|
|||
{
|
||||
$this->followRedirects = (Boolean) $followRedirect;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the maximum number of requests that crawler can follow.
|
||||
*
|
||||
|
@ -329,7 +329,7 @@ abstract class Client
|
|||
$this->cookieJar->updateFromResponse($this->internalResponse, $uri);
|
||||
|
||||
$status = $this->internalResponse->getStatus();
|
||||
|
||||
|
||||
if ($status >= 300 && $status < 400) {
|
||||
$this->redirect = $this->internalResponse->getHeader('Location');
|
||||
} else {
|
||||
|
|
|
@ -59,7 +59,7 @@ class CookieJar
|
|||
}
|
||||
|
||||
// avoid relying on this behavior that is mainly here for BC reasons
|
||||
foreach ($this->cookieJar as $domain => $cookies) {
|
||||
foreach ($this->cookieJar as $cookies) {
|
||||
if (isset($cookies[$path][$name])) {
|
||||
return $cookies[$path][$name];
|
||||
}
|
||||
|
|
|
@ -367,7 +367,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertInstanceof('LogicException', $e, '->followRedirect() throws a \LogicException if the request did not respond with 30x HTTP Code');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function testFollowRedirectWithMaxRedirects()
|
||||
{
|
||||
$client = new TestClient();
|
||||
|
|
|
@ -859,9 +859,7 @@ class Application
|
|||
|
||||
if (true === $input->hasParameterOption(array('--no-interaction', '-n'))) {
|
||||
$input->setInteractive(false);
|
||||
}
|
||||
|
||||
if (function_exists('posix_isatty') && $this->getHelperSet()->has('dialog')) {
|
||||
} elseif (function_exists('posix_isatty') && $this->getHelperSet()->has('dialog')) {
|
||||
$inputStream = $this->getHelperSet()->get('dialog')->getInputStream();
|
||||
if (!posix_isatty($inputStream)) {
|
||||
$input->setInteractive(false);
|
||||
|
|
|
@ -11,16 +11,11 @@
|
|||
|
||||
namespace Symfony\Component\Console\Helper;
|
||||
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Descriptor\DescriptorInterface;
|
||||
use Symfony\Component\Console\Descriptor\JsonDescriptor;
|
||||
use Symfony\Component\Console\Descriptor\MarkdownDescriptor;
|
||||
use Symfony\Component\Console\Descriptor\TextDescriptor;
|
||||
use Symfony\Component\Console\Descriptor\XmlDescriptor;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputDefinition;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
/**
|
||||
|
|
|
@ -57,7 +57,7 @@ class DialogHelper extends Helper
|
|||
|
||||
if ($multiselect) {
|
||||
// Check for a separated comma values
|
||||
if(!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices, $matches)) {
|
||||
if (!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices, $matches)) {
|
||||
throw new \InvalidArgumentException(sprintf($errorMessage, $picked));
|
||||
}
|
||||
$selectedChoices = explode(",", $selectedChoices);
|
||||
|
@ -74,10 +74,10 @@ class DialogHelper extends Helper
|
|||
array_push($multiselectChoices, $value);
|
||||
}
|
||||
|
||||
if ($multiselect){
|
||||
if ($multiselect) {
|
||||
return $multiselectChoices;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $picked;
|
||||
}, $attempts, $default);
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
|
|||
{
|
||||
$application = new Application('foo', 'bar');
|
||||
$this->assertEquals('foo', $application->getName(), '__construct() takes the application name as its first argument');
|
||||
$this->assertEquals('bar', $application->getVersion(), '__construct() takes the application version as its first argument');
|
||||
$this->assertEquals('bar', $application->getVersion(), '__construct() takes the application version as its second argument');
|
||||
$this->assertEquals(array('help', 'list'), array_keys($application->all()), '__construct() registered the help and list commands by default');
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ class HelpCommandTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertRegExp('/list \[--xml\] \[--raw\] \[--format="\.\.\."\] \[namespace\]/', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
|
||||
}
|
||||
|
||||
|
||||
public function testExecuteForApplicationCommandWithXmlOption()
|
||||
{
|
||||
$application = new Application();
|
||||
|
|
|
@ -13,7 +13,6 @@ namespace Symfony\Component\Console\Tests\Descriptor;
|
|||
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Descriptor\DescriptorInterface;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputDefinition;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
|
|
|
@ -18,7 +18,6 @@ use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication1;
|
|||
use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication2;
|
||||
use Symfony\Component\Console\Tests\Fixtures\DescriptorCommand1;
|
||||
use Symfony\Component\Console\Tests\Fixtures\DescriptorCommand2;
|
||||
use Symfony\Component\Finder\Shell\Command;
|
||||
|
||||
/**
|
||||
* @author Jean-François Simon <contact@jfsimon.fr>
|
||||
|
|
|
@ -90,7 +90,7 @@ class FunctionExtension extends AbstractExtension
|
|||
if (0 !== $b) {
|
||||
$expr .= ' - '.$b;
|
||||
}
|
||||
|
||||
|
||||
$conditions = array(sprintf('%s %s 0', $expr, $sign));
|
||||
|
||||
if (1 !== $a && -1 !== $a) {
|
||||
|
@ -98,7 +98,7 @@ class FunctionExtension extends AbstractExtension
|
|||
}
|
||||
|
||||
return $xpath->addCondition(implode(' and ', $conditions));
|
||||
|
||||
|
||||
// todo: handle an+b, odd, even
|
||||
// an+b means every-a, plus b, e.g., 2n+1 means odd
|
||||
// 0n+b means b
|
||||
|
|
|
@ -104,6 +104,7 @@ class ErrorHandler
|
|||
$stack = array_map(
|
||||
function ($row) {
|
||||
unset($row['args']);
|
||||
|
||||
return $row;
|
||||
},
|
||||
array_slice(debug_backtrace(false), 0, 10)
|
||||
|
|
|
@ -19,18 +19,18 @@ namespace Symfony\Component\Debug\Exception;
|
|||
class ContextErrorException extends \ErrorException
|
||||
{
|
||||
private $context = array();
|
||||
|
||||
|
||||
public function __construct($message, $code, $severity, $filename, $lineno, $context = array())
|
||||
{
|
||||
parent::__construct($message, $code, $severity, $filename, $lineno);
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array Array of variables that existed when the exception occurred
|
||||
*/
|
||||
public function getContext()
|
||||
{
|
||||
return $this->context;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -853,7 +853,11 @@ EOF;
|
|||
private function addAliases()
|
||||
{
|
||||
if (!$aliases = $this->container->getAliases()) {
|
||||
return '';
|
||||
if ($this->container->isFrozen()) {
|
||||
return "\n \$this->aliases = array();\n";
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
$code = " \$this->aliases = array(\n";
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
namespace Symfony\Component\DependencyInjection\LazyProxy\PhpDumper;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
namespace Symfony\Component\DependencyInjection\LazyProxy\PhpDumper;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
|
||||
/**
|
||||
|
|
|
@ -134,6 +134,18 @@ class PhpDumperTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertSame($foo, $container->get('alias_for_alias'));
|
||||
}
|
||||
|
||||
public function testFrozenContainerWithoutAliases()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
$container->compile();
|
||||
|
||||
$dumper = new PhpDumper($container);
|
||||
eval('?>'.$dumper->dump(array('class' => 'Symfony_DI_PhpDumper_Test_Frozen_No_Aliases')));
|
||||
|
||||
$container = new \Symfony_DI_PhpDumper_Test_Frozen_No_Aliases();
|
||||
$this->assertFalse($container->has('foo'));
|
||||
}
|
||||
|
||||
public function testOverrideServiceWhenUsingADumpedContainer()
|
||||
{
|
||||
require_once self::$fixturesPath.'/php/services9.php';
|
||||
|
|
|
@ -36,6 +36,8 @@ class ProjectServiceContainer extends Container
|
|||
$this->methodMap = array(
|
||||
'test' => 'getTestService',
|
||||
);
|
||||
|
||||
$this->aliases = array();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,6 +34,8 @@ class ProjectServiceContainer extends Container
|
|||
$this->methodMap = array(
|
||||
'foo' => 'getFooService',
|
||||
);
|
||||
|
||||
$this->aliases = array();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -351,6 +351,7 @@ class Form extends Link implements \ArrayAccess
|
|||
throw new \LogicException(sprintf('The selected node has an invalid form attribute (%s).', $formId));
|
||||
}
|
||||
$this->node = $form;
|
||||
|
||||
return;
|
||||
}
|
||||
// we loop until we find a form ancestor
|
||||
|
|
|
@ -122,7 +122,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase
|
|||
array('../bar/./../../foo', 'http://localhost/bar/foo/', 'http://localhost/foo'),
|
||||
array('../../', 'http://localhost/', 'http://localhost/'),
|
||||
array('../../', 'http://localhost', 'http://localhost/'),
|
||||
|
||||
|
||||
array('/foo', 'file:///', 'file:///foo'),
|
||||
array('/foo', 'file:///bar/baz', 'file:///foo'),
|
||||
array('foo', 'file:///', 'file:///foo'),
|
||||
|
|
|
@ -88,7 +88,6 @@ abstract class RealIteratorTestCase extends IteratorTestCase
|
|||
}
|
||||
|
||||
if (is_string($files)) {
|
||||
|
||||
return self::$tmpDir.DIRECTORY_SEPARATOR.str_replace('/', DIRECTORY_SEPARATOR, $files);
|
||||
}
|
||||
|
||||
|
|
|
@ -446,7 +446,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
|
|||
* This method should not be invoked.
|
||||
*
|
||||
* @param FormFactoryInterface $formFactory
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws BadMethodCallException
|
||||
|
|
|
@ -124,7 +124,6 @@ class MergeCollectionListener implements EventSubscriberInterface
|
|||
$event->setData($dataToMergeInto);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Alias of {@link onSubmit()}.
|
||||
*
|
||||
|
|
|
@ -149,7 +149,6 @@ class ResizeFormListener implements EventSubscriberInterface
|
|||
$event->setData($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Alias of {@link preSubmit()}.
|
||||
*
|
||||
|
|
|
@ -13,7 +13,6 @@ namespace Symfony\Component\Form\Extension\Core\Type;
|
|||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Intl\Intl;
|
||||
use Symfony\Component\Locale\Locale;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||
|
||||
class CountryType extends AbstractType
|
||||
|
|
|
@ -13,7 +13,6 @@ namespace Symfony\Component\Form\Extension\Core\Type;
|
|||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Intl\Intl;
|
||||
use Symfony\Component\Locale\Locale;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||
|
||||
class CurrencyType extends AbstractType
|
||||
|
|
|
@ -156,7 +156,6 @@ class FormType extends BaseType
|
|||
if (null !== $options['virtual']) {
|
||||
// Uncomment this as soon as the deprecation note should be shown
|
||||
// trigger_error('The form option "virtual" is deprecated since version 2.3 and will be removed in 3.0. Use "inherit_data" instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $options['virtual'];
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ namespace Symfony\Component\Form\Extension\Core\Type;
|
|||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Intl\Intl;
|
||||
use Symfony\Component\Locale\Locale;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||
|
||||
class LanguageType extends AbstractType
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
namespace Symfony\Component\Form\Extension\HttpFoundation;
|
||||
|
||||
use Symfony\Component\Form\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\Form\Exception\UnexpectedTypeException;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\RequestHandlerInterface;
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
namespace Symfony\Component\Form\Extension\Validator\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractTypeExtension;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationMapper;
|
||||
use Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener;
|
||||
|
|
|
@ -358,7 +358,6 @@ class FormConfigBuilder implements FormConfigBuilderInterface
|
|||
{
|
||||
// Uncomment this as soon as the deprecation note should be shown
|
||||
// trigger_error('getVirtual() is deprecated since version 2.3 and will be removed in 3.0. Use getInheritData() instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->getInheritData();
|
||||
}
|
||||
|
||||
|
|
|
@ -130,6 +130,6 @@ abstract class BaseTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
|
|||
|
||||
$this->assertFalse($view->vars['multipart']);
|
||||
}
|
||||
|
||||
|
||||
abstract protected function getTestedType();
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ class JsonResponse extends Response
|
|||
public function setData($data = array())
|
||||
{
|
||||
// Encode <, >, ', &, and " for RFC4627-compliant JSON, which may also be embedded into HTML.
|
||||
$this->data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);
|
||||
$this->data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_NUMERIC_CHECK);
|
||||
|
||||
return $this->update();
|
||||
}
|
||||
|
|
|
@ -155,7 +155,6 @@ class RequestMatcher implements RequestMatcherInterface
|
|||
|
||||
// Note to future implementors: add additional checks above the
|
||||
// foreach above or else your check might not be run!
|
||||
|
||||
return count($this->ips) === 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,11 +13,8 @@ namespace Symfony\Component\HttpFoundation\Tests\Session\Storage;
|
|||
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
namespace Symfony\Component\HttpFoundation\Tests\Session\Storage;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ abstract class ConfigurableExtension extends Extension
|
|||
*/
|
||||
final public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
$this->loadInternal($this->processConfiguration($this->getConfiguration(array(), $container), $configs), $container);
|
||||
$this->loadInternal($this->processConfiguration($this->getConfiguration($configs, $container), $configs), $container);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -110,7 +110,7 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer
|
|||
}
|
||||
$renderedAttributes = '';
|
||||
if (count($attributes) > 0) {
|
||||
foreach($attributes as $attribute => $value) {
|
||||
foreach ($attributes as $attribute => $value) {
|
||||
$renderedAttributes .= sprintf(
|
||||
' %s="%s"',
|
||||
htmlspecialchars($attribute, ENT_QUOTES | ENT_SUBSTITUTE, $this->charset, false),
|
||||
|
|
|
@ -52,7 +52,15 @@ class InlineFragmentRenderer extends RoutableFragmentRenderer
|
|||
$reference = null;
|
||||
if ($uri instanceof ControllerReference) {
|
||||
$reference = $uri;
|
||||
|
||||
// Remove attributes from the genereated URI because if not, the Symfony
|
||||
// routing system will use them to populate the Request attributes. We don't
|
||||
// want that as we want to preserve objects (so we manually set Request attributes
|
||||
// below instead)
|
||||
$attributes = $reference->attributes;
|
||||
$reference->attributes = array();
|
||||
$uri = $this->generateFragmentUri($uri, $request);
|
||||
$reference->attributes = $attributes;
|
||||
}
|
||||
|
||||
$subRequest = $this->createSubRequest($uri, $request);
|
||||
|
|
|
@ -52,7 +52,7 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
|
|||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
|
||||
|
|
|
@ -16,9 +16,6 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
|||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher;
|
||||
use Symfony\Component\HttpKernel\HttpKernel;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
||||
use Symfony\Component\HttpKernel\KernelEvents;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Stopwatch\Stopwatch;
|
||||
|
@ -194,7 +191,6 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase
|
|||
->method('isStarted')
|
||||
->will($this->returnValue(false));
|
||||
|
||||
|
||||
$dispatcher = new TraceableEventDispatcher(new EventDispatcher(), $stopwatch);
|
||||
|
||||
$kernel = $this->getHttpKernel($dispatcher, function () { return new Response(); });
|
||||
|
|
|
@ -51,11 +51,7 @@ class InlineFragmentRendererTest extends \PHPUnit_Framework_TestCase
|
|||
$object = new \stdClass();
|
||||
|
||||
$subRequest = Request::create('/_fragment?_path=_format%3Dhtml%26_controller%3Dmain_controller');
|
||||
$subRequest->attributes->replace(array(
|
||||
'object' => $object,
|
||||
'_format' => 'html',
|
||||
'_controller' => 'main_controller',
|
||||
));
|
||||
$subRequest->attributes->replace(array('object' => $object));
|
||||
$subRequest->headers->set('x-forwarded-for', array('127.0.0.1'));
|
||||
$subRequest->server->set('HTTP_X_FORWARDED_FOR', '127.0.0.1');
|
||||
|
||||
|
|
|
@ -16,15 +16,8 @@ use Symfony\Component\Icu\IcuData;
|
|||
use Symfony\Component\Icu\IcuLanguageBundle;
|
||||
use Symfony\Component\Icu\IcuLocaleBundle;
|
||||
use Symfony\Component\Icu\IcuRegionBundle;
|
||||
use Symfony\Component\Intl\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\Intl\ResourceBundle\Reader\BinaryBundleReader;
|
||||
use Symfony\Component\Intl\ResourceBundle\Reader\BufferedBundleReader;
|
||||
use Symfony\Component\Intl\ResourceBundle\Reader\PhpBundleReader;
|
||||
use Symfony\Component\Intl\ResourceBundle\Reader\StructuredBundleReader;
|
||||
use Symfony\Component\Intl\ResourceBundle\Stub\StubCurrencyBundle;
|
||||
use Symfony\Component\Intl\ResourceBundle\Stub\StubLanguageBundle;
|
||||
use Symfony\Component\Intl\ResourceBundle\Stub\StubLocaleBundle;
|
||||
use Symfony\Component\Intl\ResourceBundle\Stub\StubRegionBundle;
|
||||
|
||||
/**
|
||||
* Gives access to internationalization data.
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
namespace Symfony\Component\Intl\Locale;
|
||||
|
||||
use Symfony\Component\Intl\Exception\NotImplementedException;
|
||||
use Symfony\Component\Intl\Exception\MethodNotImplementedException;
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,7 +23,6 @@ class BufferedBundleReader implements BundleReaderInterface
|
|||
*/
|
||||
private $reader;
|
||||
|
||||
|
||||
private $buffer;
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,7 +21,7 @@ class PhpBundleWriter implements BundleWriterInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
function write($path, $locale, $data)
|
||||
public function write($path, $locale, $data)
|
||||
{
|
||||
$template = <<<TEMPLATE
|
||||
<?php
|
||||
|
|
|
@ -12,12 +12,6 @@
|
|||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\Icu\IcuData;
|
||||
use Symfony\Component\Intl\Intl;
|
||||
use Symfony\Component\Intl\ResourceBundle\Transformer\BundleTransformer;
|
||||
use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\CurrencyBundleTransformationRule;
|
||||
use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\LanguageBundleTransformationRule;
|
||||
use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\LocaleBundleTransformationRule;
|
||||
use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\RegionBundleTransformationRule;
|
||||
use Symfony\Component\Intl\ResourceBundle\Transformer\StubbingContext;
|
||||
|
||||
require_once __DIR__ . '/common.php';
|
||||
require_once __DIR__ . '/autoload.php';
|
||||
|
@ -66,5 +60,4 @@ echo "Copying files from $sourceDir to $targetDir...\n";
|
|||
|
||||
$filesystem->mirror($sourceDir, $targetDir);
|
||||
|
||||
|
||||
echo "Done.\n";
|
||||
|
|
|
@ -14,8 +14,6 @@ namespace Symfony\Component\Intl\Tests\DateFormatter;
|
|||
use Symfony\Component\Intl\DateFormatter\IntlDateFormatter;
|
||||
use Symfony\Component\Intl\Globals\IntlGlobals;
|
||||
use Symfony\Component\Intl\Intl;
|
||||
use Symfony\Component\Intl\Util\IcuVersion;
|
||||
use Symfony\Component\Intl\Util\Version;
|
||||
|
||||
/**
|
||||
* Test case for IntlDateFormatter implementations.
|
||||
|
|
|
@ -13,7 +13,6 @@ namespace Symfony\Component\Intl\Tests\DateFormatter;
|
|||
|
||||
use Symfony\Component\Intl\DateFormatter\IntlDateFormatter;
|
||||
use Symfony\Component\Intl\Globals\IntlGlobals;
|
||||
use Symfony\Component\Intl\Util\Version;
|
||||
|
||||
class IntlDateFormatterTest extends AbstractIntlDateFormatterTest
|
||||
{
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
namespace Symfony\Component\Intl\Tests\Globals;
|
||||
|
||||
|
||||
/**
|
||||
* Test case for intl function implementations.
|
||||
*
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
|
||||
namespace Symfony\Component\Intl\Tests\Locale;
|
||||
|
||||
use Symfony\Component\Intl\Stub\StubLocale;
|
||||
|
||||
/**
|
||||
* Test case for Locale implementations.
|
||||
*
|
||||
|
|
|
@ -15,7 +15,6 @@ use Symfony\Component\Intl\Globals\IntlGlobals;
|
|||
use Symfony\Component\Intl\Intl;
|
||||
use Symfony\Component\Intl\Locale;
|
||||
use Symfony\Component\Intl\NumberFormatter\NumberFormatter;
|
||||
use Symfony\Component\Intl\Util\IcuVersion;
|
||||
use Symfony\Component\Intl\Util\IntlTestHelper;
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,7 +43,6 @@ class LocaleBundleTest extends \PHPUnit_Framework_TestCase
|
|||
->with(self::RES_DIR, 'en', array('Locales', 'de_AT'))
|
||||
->will($this->returnValue('German (Austria)'));
|
||||
|
||||
|
||||
$this->assertSame('German (Austria)', $this->bundle->getLocaleName('de_AT', 'en'));
|
||||
}
|
||||
|
||||
|
@ -60,7 +59,6 @@ class LocaleBundleTest extends \PHPUnit_Framework_TestCase
|
|||
->with(self::RES_DIR, 'en', array('Locales'))
|
||||
->will($this->returnValue($sortedLocales));
|
||||
|
||||
|
||||
$this->assertSame($sortedLocales, $this->bundle->getLocaleNames('en'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,6 @@ class RegionBundleTest extends \PHPUnit_Framework_TestCase
|
|||
->with(self::RES_DIR, 'en', array('Countries'))
|
||||
->will($this->returnValue($sortedCountries));
|
||||
|
||||
|
||||
$this->assertSame($sortedCountries, $this->bundle->getCountryNames('en'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,11 +39,11 @@ class IntlTestHelper
|
|||
// * the intl extension is loaded with version Intl::getIcuStubVersion()
|
||||
// * the intl extension is not loaded
|
||||
|
||||
if (IcuVersion::compare(Intl::getIcuVersion(), Intl::getIcuStubVersion(), '!=', $precision = 1)) {
|
||||
if (IcuVersion::compare(Intl::getIcuVersion(), Intl::getIcuStubVersion(), '!=', 1)) {
|
||||
$testCase->markTestSkipped('Please change ICU version to ' . Intl::getIcuStubVersion());
|
||||
}
|
||||
|
||||
if (IcuVersion::compare(Intl::getIcuDataVersion(), Intl::getIcuStubVersion(), '!=', $precision = 1)) {
|
||||
if (IcuVersion::compare(Intl::getIcuDataVersion(), Intl::getIcuStubVersion(), '!=', 1)) {
|
||||
$testCase->markTestSkipped('Please change the Icu component to version 1.0.x or 1.' . IcuVersion::normalize(Intl::getIcuStubVersion(), 1) . '.x');
|
||||
}
|
||||
|
||||
|
@ -75,12 +75,12 @@ class IntlTestHelper
|
|||
}
|
||||
|
||||
// ... and only if the version is *one specific version* ...
|
||||
if (IcuVersion::compare(Intl::getIcuVersion(), Intl::getIcuStubVersion(), '!=', $precision = 1)) {
|
||||
if (IcuVersion::compare(Intl::getIcuVersion(), Intl::getIcuStubVersion(), '!=', 1)) {
|
||||
$testCase->markTestSkipped('Please change ICU version to ' . Intl::getIcuStubVersion());
|
||||
}
|
||||
|
||||
// ... and only if the data in the Icu component matches that version.
|
||||
if (IcuVersion::compare(Intl::getIcuDataVersion(), Intl::getIcuStubVersion(), '!=', $precision = 1)) {
|
||||
if (IcuVersion::compare(Intl::getIcuDataVersion(), Intl::getIcuStubVersion(), '!=', 1)) {
|
||||
$testCase->markTestSkipped('Please change the Icu component to version 1.0.x or 1.' . IcuVersion::normalize(Intl::getIcuStubVersion(), 1) . '.x');
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
namespace Symfony\Component\Locale\Tests;
|
||||
|
||||
use Symfony\Component\Intl\Intl;
|
||||
use Symfony\Component\Intl\Util\IcuVersion;
|
||||
use Symfony\Component\Intl\Util\IntlTestHelper;
|
||||
use Symfony\Component\Locale\Locale;
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
namespace Symfony\Component\Locale\Tests\Stub;
|
||||
|
||||
use Symfony\Component\Intl\Util\IcuVersion;
|
||||
use Symfony\Component\Intl\Util\IntlTestHelper;
|
||||
use Symfony\Component\Locale\Stub\StubLocale;
|
||||
|
||||
|
|
|
@ -259,9 +259,9 @@ class Process
|
|||
stream_set_blocking($pipe, false);
|
||||
}
|
||||
|
||||
|
||||
if ($this->tty) {
|
||||
$this->status = self::STATUS_TERMINATED;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1102,9 +1102,9 @@ class Process
|
|||
$this->readBytes = array(
|
||||
self::STDOUT => 0,
|
||||
);
|
||||
|
||||
|
||||
return array(array('pipe', 'r'), $this->fileHandles[self::STDOUT], array('pipe', 'w'));
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->tty) {
|
||||
$descriptors = array(
|
||||
|
|
|
@ -42,7 +42,7 @@ class ProcessUtils
|
|||
//@see https://bugs.php.net/bug.php?id=49446
|
||||
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
|
||||
$escapedArgument = '';
|
||||
foreach(preg_split('/([%"])/i', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) {
|
||||
foreach (preg_split('/([%"])/i', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) {
|
||||
if ('"' == $part) {
|
||||
$escapedArgument .= '\\"';
|
||||
} elseif ('%' == $part) {
|
||||
|
|
|
@ -8,9 +8,9 @@ pcntl_signal(SIGUSR1, function(){echo "Caught SIGUSR1"; exit;});
|
|||
$n=0;
|
||||
|
||||
// ticks require activity to work - sleep(4); does not work
|
||||
while($n < 400) {
|
||||
while ($n < 400) {
|
||||
usleep(10000);
|
||||
$n++;
|
||||
}
|
||||
|
||||
return;
|
||||
return;
|
||||
|
|
|
@ -19,7 +19,6 @@ class MagicianCall
|
|||
{
|
||||
$property = lcfirst(substr($name, 3));
|
||||
if ('get' === substr($name, 0, 3)) {
|
||||
|
||||
return isset($this->$property) ? $this->$property : null;
|
||||
} elseif ('set' === substr($name, 0, 3)) {
|
||||
$value = 1 == count($args) ? $args[0] : null;
|
||||
|
|
|
@ -40,46 +40,46 @@ class BasicPermissionMap implements PermissionMapInterface
|
|||
MaskBuilder::MASK_MASTER,
|
||||
MaskBuilder::MASK_OWNER,
|
||||
),
|
||||
|
||||
|
||||
self::PERMISSION_EDIT => array(
|
||||
MaskBuilder::MASK_EDIT,
|
||||
MaskBuilder::MASK_OPERATOR,
|
||||
MaskBuilder::MASK_MASTER,
|
||||
MaskBuilder::MASK_OWNER,
|
||||
),
|
||||
|
||||
|
||||
self::PERMISSION_CREATE => array(
|
||||
MaskBuilder::MASK_CREATE,
|
||||
MaskBuilder::MASK_OPERATOR,
|
||||
MaskBuilder::MASK_MASTER,
|
||||
MaskBuilder::MASK_OWNER,
|
||||
),
|
||||
|
||||
|
||||
self::PERMISSION_DELETE => array(
|
||||
MaskBuilder::MASK_DELETE,
|
||||
MaskBuilder::MASK_OPERATOR,
|
||||
MaskBuilder::MASK_MASTER,
|
||||
MaskBuilder::MASK_OWNER,
|
||||
),
|
||||
|
||||
|
||||
self::PERMISSION_UNDELETE => array(
|
||||
MaskBuilder::MASK_UNDELETE,
|
||||
MaskBuilder::MASK_OPERATOR,
|
||||
MaskBuilder::MASK_MASTER,
|
||||
MaskBuilder::MASK_OWNER,
|
||||
),
|
||||
|
||||
|
||||
self::PERMISSION_OPERATOR => array(
|
||||
MaskBuilder::MASK_OPERATOR,
|
||||
MaskBuilder::MASK_MASTER,
|
||||
MaskBuilder::MASK_OWNER,
|
||||
),
|
||||
|
||||
|
||||
self::PERMISSION_MASTER => array(
|
||||
MaskBuilder::MASK_MASTER,
|
||||
MaskBuilder::MASK_OWNER,
|
||||
),
|
||||
|
||||
|
||||
self::PERMISSION_OWNER => array(
|
||||
MaskBuilder::MASK_OWNER,
|
||||
),
|
||||
|
|
|
@ -44,7 +44,7 @@ class JsonDecode implements DecoderInterface
|
|||
public function __construct($associative = false, $depth = 512)
|
||||
{
|
||||
$this->associative = $associative;
|
||||
$this->recursionDepth = (int)$depth;
|
||||
$this->recursionDepth = (int) $depth;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -165,8 +165,8 @@ class GetSetMethodNormalizer extends SerializerAwareNormalizer implements Normal
|
|||
{
|
||||
if (in_array($attributeName, $this->camelizedAttributes)) {
|
||||
return preg_replace_callback(
|
||||
'/(^|_|\.)+(.)/', function ($match) {
|
||||
return ('.' === $match[1] ? '_' : '').strtoupper($match[2]);
|
||||
'/(^|_|\.)+(.)/', function ($match) {
|
||||
return ('.' === $match[1] ? '_' : '').strtoupper($match[2]);
|
||||
}, $attributeName
|
||||
);
|
||||
}
|
||||
|
|
|
@ -56,6 +56,7 @@ class IbanValidator extends ConstraintValidator
|
|||
|
||||
if ($rest != 1) {
|
||||
$this->context->addViolation($constraint->message, array('{{ value }}' => $value));
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -242,6 +242,42 @@
|
|||
<source>This value is not a valid ISSN.</source>
|
||||
<target>Cette valeur n'est pas un code ISSN valide.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="64">
|
||||
<source>This value is not a valid currency.</source>
|
||||
<target>Cette valeur n'est pas une devise valide.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="65">
|
||||
<source>This value should be equal to {{ compared_value }}.</source>
|
||||
<target>Cette valeur doit être égale à {{ compared_value }}.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="66">
|
||||
<source>This value should be greater than {{ compared_value }}.</source>
|
||||
<target>Cette valeur doit être supérieure à {{ compared_value }}.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="67">
|
||||
<source>This value should be greater than or equal to {{ compared_value }}.</source>
|
||||
<target>Cette valeur doit être supérieure ou égale à {{ compared_value }}.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="68">
|
||||
<source>This value should be identical to {{ compared_value_type }} {{ compared_value }}.</source>
|
||||
<target>Cette valeur doit être identique à {{ compared_value_type }} {{ compared_value }}.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="69">
|
||||
<source>This value should be less than {{ compared_value }}.</source>
|
||||
<target>Cette valeur doit être inférieure à {{ compared_value }}.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="70">
|
||||
<source>This value should be less than or equal to {{ compared_value }}.</source>
|
||||
<target>Cette valeur doit être inférieure ou égale à {{ compared_value }}.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="71">
|
||||
<source>This value should not be equal to {{ compared_value }}.</source>
|
||||
<target>Cette valeur ne doit pas être égale à {{ compared_value }}.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="72">
|
||||
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
|
||||
<target>Cette valeur ne doit pas être identique à {{ compared_value_type }} {{ compared_value }}.</target>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
</trans-unit>
|
||||
<trans-unit id="6">
|
||||
<source>You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.</source>
|
||||
<target>{{ limit }}個以上選択してください.</target>
|
||||
<target>{{ limit }}個以上選択してください。</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="7">
|
||||
<source>You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.</source>
|
||||
<target>{{ limit }}個以内で選択してください.</target>
|
||||
<target>{{ limit }}個以内で選択してください。</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="8">
|
||||
<source>One or more of the given values is invalid.</source>
|
||||
|
@ -76,7 +76,7 @@
|
|||
</trans-unit>
|
||||
<trans-unit id="19">
|
||||
<source>This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.</source>
|
||||
<target>値が長すぎます。{{ limit }}文字以内でなければなりません.</target>
|
||||
<target>値が長すぎます。{{ limit }}文字以内でなければなりません。</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="20">
|
||||
<source>This value should be {{ limit }} or more.</source>
|
||||
|
@ -84,7 +84,7 @@
|
|||
</trans-unit>
|
||||
<trans-unit id="21">
|
||||
<source>This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.</source>
|
||||
<target>値が短すぎます。{{ limit }}文字以上でなければなりません.</target>
|
||||
<target>値が短すぎます。{{ limit }}文字以上でなければなりません。</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="22">
|
||||
<source>This value should not be blank.</source>
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
</trans-unit>
|
||||
<trans-unit id="6">
|
||||
<source>You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.</source>
|
||||
<target>Mali by ste vybrať minimálne {{ limit }} možnosti.</target>
|
||||
<target>Mali by ste vybrať minimálne {{ limit }} možnosť.|Mali by ste vybrať minimálne {{ limit }} možnosti.|Mali by ste vybrať minimálne {{ limit }} možností.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="7">
|
||||
<source>You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.</source>
|
||||
<target>Mali by ste vybrať najviac {{ limit }} možnosti.</target>
|
||||
<target>Mali by ste vybrať najviac {{ limit }} možnosť.|Mali by ste vybrať najviac {{ limit }} možnosti.|Mali by ste vybrať najviac {{ limit }} možností.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="8">
|
||||
<source>One or more of the given values is invalid.</source>
|
||||
|
@ -76,7 +76,7 @@
|
|||
</trans-unit>
|
||||
<trans-unit id="19">
|
||||
<source>This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.</source>
|
||||
<target>Táto hodnota obsahuje viac znakov ako je povolené. Mala by obsahovať najviac {{ limit }} znakov.</target>
|
||||
<target>Táto hodnota obsahuje viac znakov ako je povolené. Mala by obsahovať najviac {{ limit }} znak.|Táto hodnota obsahuje viac znakov ako je povolené. Mala by obsahovať najviac {{ limit }} znaky.|Táto hodnota obsahuje viac znakov ako je povolené. Mala by obsahovať najviac {{ limit }} znakov.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="20">
|
||||
<source>This value should be {{ limit }} or more.</source>
|
||||
|
@ -84,7 +84,7 @@
|
|||
</trans-unit>
|
||||
<trans-unit id="21">
|
||||
<source>This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.</source>
|
||||
<target>Táto hodnota nemá dostatočný počet znakov. Minimálny počet znakov je {{ limit }}.</target>
|
||||
<target>Táto hodnota je príliš krátka. Musí obsahovať minimálne {{ limit }} znak.|Táto hodnota je príliš krátka. Musí obsahovať minimálne {{ limit }} znaky.|Táto hodnota je príliš krátka. Minimálny počet znakov je {{ limit }}.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="22">
|
||||
<source>This value should not be blank.</source>
|
||||
|
@ -180,7 +180,7 @@
|
|||
</trans-unit>
|
||||
<trans-unit id="48">
|
||||
<source>This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.</source>
|
||||
<target>Táto hodnota by mala mať presne {{ limit }} znakov.</target>
|
||||
<target>Táto hodnota by mala mať presne {{ limit }} znak.|Táto hodnota by mala mať presne {{ limit }} znaky.|Táto hodnota by mala mať presne {{ limit }} znakov.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="49">
|
||||
<source>The file was only partially uploaded.</source>
|
||||
|
|
|
@ -163,7 +163,7 @@ class IsbnValidatorTest extends \PHPUnit_Framework_TestCase
|
|||
->expects($this->once())
|
||||
->method('addViolation')
|
||||
->with($constraint->isbn10Message);
|
||||
|
||||
|
||||
$this->validator->validate($isbn, $constraint);
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue