8000 Merge branch '3.4' into 4.2 · deviantintegral/symfony@a5951ce · GitHub
[go: up one dir, main page]

Skip to content

Commit a5951ce

Browse files
Merge branch '3.4' into 4.2
* 3.4: cs fix cs fix [PHPUnit-Bridge] override some environment variables [TwigBridge] Remove use spaceless tag [translation] Update defaut format from yml to yaml Change default log level for output streams update docblock to match the actual behavior compatibility with phpunit8 [Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods Added translations for chineese language.
2 parents d7ef2fd + b43cfc8 commit a5951ce

File tree

16 files changed

+232
-42
lines changed

16 files changed

+232
-42
lines changed

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ if (PHP_VERSION_ID >= 70200) {
5656
$PHPUNIT_VERSION = '4.8';
5757
}
5858

59-
if ('composer.json' !== $COMPOSER_JSON = getenv('COMPOSER') ?: 'composer.json') {
60-
putenv('COMPOSER=composer.json');
61-
$_SERVER['COMPOSER'] = $_ENV['COMPOSER'] = 'composer.json';
62-
}
59+
$COMPOSER_JSON = getenv('COMPOSER') ?: 'composer.json';
6360

6461
$root = __DIR__;
6562
while (!file_exists($root.'/'.$COMPOSER_JSON) || file_exists($root.'/DeprecationErrorHandler.php')) {
@@ -77,6 +74,19 @@ if ('phpdbg' === PHP_SAPI) {
7774
$PHP .= ' -qrr';
7875
}
7976

77+
$defaultEnvs = [
78+
'COMPOSER' => 'composer.json',
79+
'COMPOSER_VENDOR_DIR' => 'vendor',
80+
'COMPOSER_BIN_DIR' => 'bin',
81+
];
82+
83+
foreach ($defaultEnvs as $envName => $envValue) {
84+
if ($envValue !== getenv($envName)) {
85+
putenv("$envName=$envValue");
86+
$_SERVER[$envName] = $_ENV[$envName] = $envValue;
87+
}
88+
}
89+
8090
$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar') || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
8191
? $PHP.' '.escapeshellarg($COMPOSER)
8292
: 'composer';
Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
{% block _text_id_widget %}
2-
{% spaceless %}
1+
{% block _text_id_widget -%}
32
<div id="container">
4-
{{ form_widget(form) }}
3+
{{- form_widget(form) -}}
54
</div>
6-
{% endspaceless %}
7-
{% endblock _text_id_widget %}
5+
{%- endblock _text_id_widget %}
86

9-
{% block _names_entry_label %}
10-
{% spaceless %}
7+
{% block _names_entry_label -%}
118
{% if label is empty %}
12-
{% set label = name|humanize %}
13-
{% endif %}
9+
{%- set label = name|humanize -%}
10+
{% endif -%}
1411
<label>Custom label: {{ label|trans({}, translation_domain) }}</label>
15-
{% endspaceless %}
16-
{% endblock _names_entry_label %}
12+
{%- endblock _names_entry_label %}
1713

18-
{% block _name_c_entry_label %}
19-
{% spaceless %}
14+
{% block _name_c_entry_label -%}
2015
{% if label is empty %}
21-
{% set label = name|humanize %}
22-
{% endif %}
16+
{%- set label = name|humanize -%}
17+
{% endif -%}
2318
<label>Custom name label: {{ label|trans({}, translation_domain) }}</label>
24-
{% endspaceless %}
25-
{% endblock _name_c_entry_label %}
19+
{%- endblock _name_c_entry_label %}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{% block form_widget_simple %}
2-
{% spaceless %}
3-
{% set type = type|default('text') %}
2+
{%- set type = type|default('text') -%}
43
<input type="{{ type }}" {{ block('widget_attributes') }} value="{{ value }}" rel="theme" />
5-
{% endspaceless %}
6-
{% endblock form_widget_simple %}
4+
{%- endblock form_widget_simple %}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{% extends 'form_div_layout.html.twig' %}
22

33
{% block form_widget_simple %}
4-
{% spaceless %}
5-
{% set type = type|default('text') %}
4+
{%- set type = type|default('text') -%}
65
<input type="{{ type }}" {{ block('widget_attributes') }} value="{{ value }}" rel="theme" />
7-
{% endspaceless %}
8-
{% endblock form_widget_simple %}
6+
{%- endblock form_widget_simple %}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{% use 'form_div_layout.html.twig' %}
22

33
{% block form_widget_simple %}
4-
{% spaceless %}
5-
{% set type = type|default('text') %}
4+
{%- set type = type|default('text') -%}
65
<input type="{{ type }}" {{ block('widget_attributes') }} value="{{ value }}" rel="theme" />
7-
{% endspaceless %}
8-
{% endblock form_widget_simple %}
6+
{%- endblock form_widget_simple %}

src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private function createCommandTester($extractedMessages = [], $loadedMessages =
159159
->expects($this->any())
160160
->method('getFormats')
161161
->will(
162-
$this->returnValue(['xlf', 'yml'])
162+
$this->returnValue(['xlf', 'yml', 'yaml'])
163163
);
164164

165165
if (null === $kernel) {

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public function checkAnnotations(\ReflectionClass $refl, $class)
324324
$finalOrInternal = false;
325325

326326
foreach (['final', 'internal'] as $annotation) {
327-
if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$)#s', $doc, $notice)) {
327+
if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$|\r?\n)#s', $doc, $notice)) {
328328
$message = isset($notice[1]) ? preg_replace('#\.?\r?\n( \*)? *(?= |\r?\n|$)#', '', $notice[1]) : '';
329329
self::${$annotation.'Methods'}[$class][$method->name] = [$class, $message];
330330
$finalOrInternal = true;

src/Symfony/Component/Debug/Tests/Fixtures/FinalMethod.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public function finalMethod()
1313

1414
/**
1515
* @final
16+
*
17+
* @return int
1618
*/
1719
public function finalMethod2()
1820
{

src/Symfony/Component/DependencyInjection/Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function setParameter($name, $value)
138138
/**
139139
* Sets a service.
140140
*
141-
* Setting a service to null resets the service: has() returns false and get()
141+
* Setting a synthetic service to null resets it: has() returns false and get()
142142
* behaves in the same way as if the service was never created.
143143
*
144144
* @param string $id The service identifier

src/Symfony/Component/Form/Test/FormIntegrationTestCase.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
*/
2121
abstract class FormIntegrationTestCase extends TestCase
2222
{
23+
use TestCaseSetUpTearDownTrait;
24+
2325
/**
2426
* @var FormFactoryInterface
2527
*/
2628
protected $factory;
2729

28-
protected function setUp()
30+
private function doSetUp()
2931
{
3032
$this->factory = Forms::createFormFactoryBuilder()
3133
->addExtensions($this->getExtensions())

0 commit comments

Comments
 (0)
0