Skip to content
Permalink
Browse files

Merge branch '4.3' into 4.4

* 4.3:
  cleanups
  Disable PHPUnit result cache on the CI
  [Security] Cleanup "Digest nonce has expired." translation
  [Translation] Highlight invalid translation status
  Added translations in validator for Serbian Cyrillic
  Added translations in validator for Serbian Latin
  [EventDispatcher] wrong Request class
  [DependencyInjection] improved exception message
  • Loading branch information...
nicolas-grekas committed Aug 10, 2019
2 parents 24858f2 + 9d9f558 commit 50167b950927dd6615250f5acd8229f49bd49faa
@@ -12,6 +12,7 @@ init:
- SET SYMFONY_DEPRECATIONS_HELPER=strict
- SET "SYMFONY_REQUIRE=>=4.2"
- SET ANSICON=121x90 (121x90)
- SET SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1
- REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f

install:
@@ -21,6 +21,7 @@ env:
- SYMFONY_PROCESS_PHP_TEST_BINARY=~/.phpenv/shims/php
- MESSENGER_AMQP_DSN=amqp://localhost/%2f/messages
- MESSENGER_REDIS_DSN=redis://127.0.0.1:7001/messages
- SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1

matrix:
include:
@@ -185,6 +185,14 @@ class SymfonyBlacklistPhpunit {}
global $argv, $argc;
$argv = isset($_SERVER['argv']) ? $_SERVER['argv'] : array();
$argc = isset($_SERVER['argc']) ? $_SERVER['argc'] : 0;
if ($PHPUNIT_VERSION < 8.0) {
$argv = array_filter($argv, function ($v) use (&$argc) { if ('--do-not-cache-result' !== $v) return true; --$argc; });
} elseif (filter_var(getenv('SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE'), FILTER_VALIDATE_BOOLEAN)) {
$argv[] = '--do-not-cache-result';
++$argc;
}
$components = array();
$cmd = array_map('escapeshellarg', $argv);
$exit = 0;
@@ -366,9 +366,9 @@ public function getPath()
/**
* Normalizes the value before any other normalization is applied.
*
* @param $value
* @param mixed $value
*
* @return The normalized array value
* @return mixed The normalized array value
*/
protected function preNormalize($value)
{
@@ -29,10 +29,13 @@ public function process(ContainerBuilder $container)
if ($definition->isSynthetic() || null !== $definition->getClass()) {
continue;
}
if (preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\\\\[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)++$/', $id)) {
if (preg_match('/^\\\\?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\\\\[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)++$/', $id)) {
if ($definition instanceof ChildDefinition && !class_exists($id)) {
throw new InvalidArgumentException(sprintf('Service definition "%s" has a parent but no class, and its name looks like a FQCN. Either the class is missing or you want to inherit it from the parent service. To resolve this ambiguity, please rename this service to a non-FQCN (e.g. using dots), or create the missing class.', $id));
}
if ('\\' === $id[0]) {
throw new InvalidArgumentException(sprintf('Service definition "%s" has no class, and its name looks like a FQCN but it starts with a backslash; remove the leading backslash.', $id));
}
$definition->setClass($id);
}
}
@@ -15,6 +15,7 @@
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\Compiler\ResolveClassPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Tests\Fixtures\CaseSensitiveClass;
class ResolveClassPassTest extends TestCase
@@ -58,6 +59,17 @@ public function provideInvalidClassId()
yield ['\DateTime'];
}
public function testWontResolveClassFromClassIdWithLeadingBackslash()
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Service definition "\App\Some\Service" has no class, and its name looks like a FQCN but it starts with a backslash; remove the leading backslash.');
$container = new ContainerBuilder();
$container->register('\App\Some\Service');
(new ResolveClassPass())->process($container);
}
public function testNonFqcnChildDefinition()
{
$container = new ContainerBuilder();
@@ -282,7 +282,6 @@ public function testEmptyConfigFromMoreThanOneSource()
$container = new ContainerBuilder();
$container->registerExtension(new EnvExtension(new ConfigurationWithArrayNodeRequiringOneElement()));
$container->loadFromExtension('env_extension', []);
$container->loadFromExtension('env_extension', []);
$this->doProcess($container);
@@ -13,12 +13,12 @@
use Psr\EventDispatcher\StoppableEventInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\BrowserKit\Request;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Symfony\Component\EventDispatcher\LegacyEventProxy;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
@@ -210,7 +210,7 @@ public function testHasTypeIfFQCN()
$this->resolvedTypeFactory
->expects($this->any())
->method('createResolvedType')
->will($this->returnValue($this->createMock(ResolvedFormTypeInterface::class)));
->willReturn($this->createMock(ResolvedFormTypeInterface::class));
$this->assertTrue($this->registry->hasType('Symfony\Component\Form\Tests\Fixtures\FooType'));
}
@@ -1565,7 +1565,6 @@ public function testGetLanguages()
$request = new Request();
$request->headers->set('Accept-language', 'zh, en-us; q=0.8, en; q=0.6');
$this->assertEquals(['zh', 'en_US', 'en'], $request->getLanguages());
$this->assertEquals(['zh', 'en_US', 'en'], $request->getLanguages());
$request = new Request();
$request->headers->set('Accept-language', 'zh, en-us; q=0.6, en; q=0.8');
@@ -534,7 +534,6 @@ public function testPrepareRemovesContentForInformationalResponse()
$response->prepare($request);
$this->assertEquals('', $response->getContent());
$this->assertFalse($response->headers->has('Content-Type'));
$this->assertFalse($response->headers->has('Content-Type'));
$response->setContent('content');
$response->setStatusCode(304);
@@ -27,7 +27,7 @@
class LanguageDataGenerator extends AbstractDataGenerator
{
/**
* Source: https://iso639-3.sil.org/code_tables/639/data
* Source: https://iso639-3.sil.org/code_tables/639/data.
*/
private static $preferredAlpha2ToAlpha3Mapping = [
'ak' => 'aka',
@@ -28,7 +28,7 @@
class RegionDataGenerator extends AbstractDataGenerator
{
/**
* Source https://www.iso.org/obp/ui/#iso:pub:PUB500001:en
* Source: https://www.iso.org/obp/ui/#iso:pub:PUB500001:en.
*/
private static $preferredAlpha2ToAlpha3Mapping = [
'DE' => 'DEU',
@@ -30,10 +30,6 @@
<source>Invalid CSRF token.</source>
<target>توکن CSRF معتبر نمی باشد.</target>
</trans-unit>
<trans-unit id="8">
<source>Digest nonce has expired.</source>
<target>Digest nonce منقضی گردیده است.</target>
</trans-unit>
<trans-unit id="9">
<source>No authentication provider found to support the authentication token.</source>
<target>هیچ ارایه دهنده احراز هویتی برای پشتیبانی از توکن احراز هویت پیدا نشد.</target>
@@ -167,8 +167,9 @@ function printTable($translations, $verboseOutput)
$longestLocaleNameLength = max(array_map('strlen', array_keys($translations)));
foreach ($translations as $locale => $translation) {
$isTranslationCompleted = $translation['translated'] === $translation['total'];
if ($isTranslationCompleted) {
if ($translation['translated'] > $translation['total']) {
textColorRed();
} elseif ($translation['translated'] === $translation['total']) {
textColorGreen();
}
@@ -194,6 +195,11 @@ function textColorGreen()
echo "\033[32m";
}
function textColorRed()
{
echo "\033[31m";
}
function textColorNormal()
{
echo "\033[0m";
@@ -298,6 +298,74 @@
<source>The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.</source>
<target>Слика је оријантације портрета ({{ width }}x{{ height }}px). Портретна оријентација слика није дозвољена.</target>
</trans-unit>
<trans-unit id="78">
<source>An empty file is not allowed.</source>
<target>Празна датотека није дозвољена.</target>
</trans-unit>
<trans-unit id="79">
<source>The host could not be resolved.</source>
<target>Није могуће одредити послужитеља.</target>
</trans-unit>
<trans-unit id="80">
<source>This value does not match the expected {{ charset }} charset.</source>
<target>Вредност се не поклапа са очекиваним {{ charset }} сетом карактера.</target>
</trans-unit>
<trans-unit id="81">
<source>This is not a valid Business Identifier Code (BIC).</source>
<target>Ово није валидан међународни идентификацијски код банке (BIC).</target>
</trans-unit>
<trans-unit id="82">
<source>Error</source>
<target>Грешка</target>
</trans-unit>
<trans-unit id="83">
<source>This is not a valid UUID.</source>
<target>Ово није валидан универзални уникатни идентификатор (UUID).</target>
</trans-unit>
<trans-unit id="84">
<source>This value should be a multiple of {{ compared_value }}.</source>
<target>Ова вредност би требало да буде дељива са {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="85">
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
<target>BIC код није повезан са IBAN {{ iban }}.</target>
</trans-unit>
<trans-unit id="86">
<source>This value should be valid JSON.</source>
<target>Ова вредност би требало да буде валидан JSON.</target>
</trans-unit>
<trans-unit id="87">
<source>This collection should contain only unique elements.</source>
<target>Ова колекција би требала да садржи само јединствене елементе.</target>
</trans-unit>
<trans-unit id="88">
<source>This value should be positive.</source>
<target>Ова вредност би требала бити позитивна.</target>
</trans-unit>
<trans-unit id="89">
<source>This value should be either positive or zero.</source>
<target>Ова вредност би требала бити позитивна или нула.</target>
</trans-unit>
<trans-unit id="90">
<source>This value should be negative.</source>
<target>Ова вредност би требала бити негативна.</target>
</trans-unit>
<trans-unit id="91">
<source>This value should be either negative or zero.</source>
<target>Ова вредност би требала бити позитивна или нула.</target>
</trans-unit>
<trans-unit id="92">
<source>This value is not a valid timezone.</source>
<target>Ова вредност није валидна временска зона.</target>
</trans-unit>
<trans-unit id="93">
<source>This password has been leaked in a data breach, it must not be used. Please use another password.</source>
<target>Ова лозинка је компромитована приликом претходних напада, немојте је користити. Користите другу лозинку.</target>
</trans-unit>
<trans-unit id="94">
<source>This value should be between {{ min }} and {{ max }}.</source>
<target>Ова вредност треба да буде између {{ min }} и {{ max }}.</target>
</trans-unit>
</body>
</file>
</xliff>
@@ -334,6 +334,38 @@
<source>This value should be valid JSON.</source>
<target>Ova vrednost bi trebalo da bude validan JSON.</target>
</trans-unit>
<trans-unit id="87">
<source>This collection should contain only unique elements.</source>
<target>Ova kolekcija bi trebala da sadrži samo jedinstvene elemente.</target>
</trans-unit>
<trans-unit id="88">
<source>This value should be positive.</source>
<target>Ova vrednost bi trebala biti pozitivna.</target>
</trans-unit>
<trans-unit id="89">
<source>This value should be either positive or zero.</source>
<target>Ova vrednost bi trebala biti pozitivna ili nula.</target>
</trans-unit>
<trans-unit id="90">
<source>This value should be negative.</source>
<target>Ova vrednost bi trebala biti negativna.</target>
</trans-unit>
<trans-unit id="91">
<source>This value should be either negative or zero.</source>
<target>Ova vrednost bi trebala biti pozitivna ili nula.</target>
</trans-unit>
<trans-unit id="92">
<source>This value is not a valid timezone.</source>
<target>Ova vrednost nije validna vremenska zona.</target>
</trans-unit>
<trans-unit id="93">
<source>This password has been leaked in a data breach, it must not be used. Please use another password.</source>
<target>Ova lozinka je kompromitovana prilikom prethodnih napada, nemojte je koristiti. Koristite drugu lozinku.</target>
</trans-unit>
<trans-unit id="94">
<source>This value should be between {{ min }} and {{ max }}.</source>
<target>Ova vrednost treba da bude između {{ min }} i {{ max }}.</target>
</trans-unit>
</body>
</file>
</xliff>

0 comments on commit 50167b9

Please sign in to comment.
You can’t perform that action at this time.