8000 Merge branch '2.4' · symfony/symfony@4c9e307 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4c9e307

Browse files
committed
Merge branch '2.4'
* 2.4: $default can be string Fix wording for Process class documentation Option can be bool too (eg. --force) [Form] Update DateTime objects only if the actual value has changed Revert "bug #10091 [Translation] Update PluralizationRules.php (guilhermeblanco)" [HttpFoundation] fixed typo Added delta for Request comparison add zh_TW validator translations Added Bulgarian translation for security component
2 parents 1e89880 + 3d91128 commit 4c9e307

File tree

10 files changed

+388
-33
lines changed

10 files changed

+388
-33
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class DialogHelper extends InputAwareHelper
3131
* @param OutputInterface $output An Output instance
3232
* @param string|array $question The question to ask
3333
* @param array $choices List of choices to pick from
34-
* @param Boolean $default The default answer if the user enters nothing
34+
* @param Boolean|string $default The default answer if the user enters nothing
3535
* @param Boolean|integer $attempts Max number of times to ask before giving up (false by default, which means infinite)
3636
* @param string $errorMessage Message which will be shown if invalid value from choice list would be picked
3737
* @param Boolean $multiselect Select more than one value separated by comma

src/Symfony/Component/Console/Input/Input.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ public function getOption($name)
186186
/**
187187
* Sets an option value by name.
188188
*
189-
* @param string $name The option name
190-
* @param string $value The option value
189+
* @param string $name The option name
190+
* @param string|boolean $value The option value
191191
*
192192
* @throws \InvalidArgumentException When option given doesn't exist
193193
*/

src/Symfony/Component/Console/Input/InputInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ public function getOption($name);
120120
/**
121121
* Sets an option value by name.
122122
*
123-
* @param string $name The option name
124-
* @param string $value The option value
123+
* @param string $name The option name
124+
* @param string|boolean $value The option value
125125
*
126126
* @throws \InvalidArgumentException When option given doesn't exist
127127
*/

src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ public function mapFormsToData($forms, &$data)
8181
// Write-back is disabled if the form is not synchronized (transformation failed),
8282
// if the form was not submitted and if the form is disabled (modification not allowed)
8383
if (null !== $propertyPath && $config->getMapped() && $form->isSubmitted() && $form->isSynchronized() && !$form->isDisabled()) {
84+
85+
// If the field is of type DateTime and the data is the same skip the update to
86+
// keep the original object hash
87+
if ($form->getData() instanceof \DateTime && $form->getData() == $this->propertyAccessor->getValue($data, $propertyPath)) {
88+
continue;
89+
}
90+
8491
// If the data is identical to the value in $data, we are
8592
// dealing with a reference
8693
if (!is_object($data) || !$config->getByReference() || $form->getData() !== $this->propertyAccessor->getValue($data, $propertyPath)) {

src/Symfony/Component/HttpFoundation/FileBag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Component\HttpFoundation\File\UploadedFile;
1515

1616
/**
17-
* FileBag is a container for HTTP headers.
17+
* FileBag is a container for uploaded files.
1818
*
1919
* @author Fabien Potencier <fabien@symfony.com>
2020
* @author Bulat Shakirzyanov <mallluhuct@gmail.com>

src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,7 @@ public function testRenderWithObjectsAsAttributes()
4444
$subRequest->headers->set('x-forwarded-for', array('127.0.0.1'));
4545
$subRequest->server->set('HTTP_X_FORWARDED_FOR', '127.0.0.1');
4646

47-
$kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
48-
$kernel
49-
->expects($this->any())
50-
->method('handle')
51-
->with($subRequest)
52-
;
53-
54-
$strategy = new InlineFragmentRenderer($kernel);
47+
$strategy = new InlineFragmentRenderer($this->getKernelExpectingRequest($subRequest));
5548

5649
$strategy->render(new ControllerReference('main_controller', array('object' => $object), array()), Request::create('/'));
5750
}
@@ -80,15 +73,7 @@ public function testRenderWithTrustedHeaderDisabled()
8073

8174
Request::setTrustedHeaderName(Request::HEADER_CLIENT_IP, '');
8275

83-
$kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
84-
$kernel
85-
->expects($this->any())
86-
->method('handle')
87-
->with(Request::create('/'))
88-
;
89-
90-
$strategy = new InlineFragmentRenderer($kernel);
91-
76+
$strategy = new InlineFragmentRenderer($this->getKernelExpectingRequest(Request::create('/')));
9277
$strategy->render('/', Request::create('/'));
9378

9479
Request::setTrustedHeaderName(Request::HEADER_CLIENT_IP, $trustedHeaderName);
@@ -139,6 +124,22 @@ private function getKernel($returnValue)
139124
return $kernel;
140125
}
141126

127+
/**
128+
* Creates a Kernel expecting a request equals to $request
129+
* Allows delta in comparison in case REQUEST_TIME changed by 1 second
130+
*/
131+
private function getKernelExpectingRequest(Request $request)
132+
{
133+
$kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
134+
$kernel
135+
->expects($this->any())
136+
->method('handle')
137+
->with($this->equalTo($request, 1))
138+
;
139+
140+
return $kernel;
141+
}
142+
142143
public function testExceptionInSubRequestsDoesNotMangleOutputBuffers()
143144
{
144145
$resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface');
@@ -180,14 +181,7 @@ public function testESIHeaderIsKeptInSubrequest()
180181
$expectedSubRequest->server->set('HTTP_X_FORWARDED_FOR', '127.0.0.1');
181182
}
182183

183-
$kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
184-
$kernel
185-
->expects($this->any())
186-
->method('handle')
187-
->with($expectedSubRequest)
188-
;
189-
190-
$strategy = new InlineFragmentRenderer($kernel);
184+
$strategy = new InlineFragmentRenderer($this->getKernelExpectingRequest($expectedSubRequest));
191185

192186
$request = Request::create('/');
193187
$request->headers->set('Surrogate-Capability', 'abc="ESI/1.0"');

src/Symfony/Component/Process/Process.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Symfony\Component\Process\Exception\RuntimeException;
1919

2020
/**
21-
* Process is a thin wrapper around proc_* functions to ease
21+
* Process is a thin wrapper around proc_* functions to easily
2222
* start independent PHP processes.
2323
*
2424
* @author Fabien Potencier <fabien@symfony.com>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0"?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3+
<file source-language="en" datatype="plaintext" original="file.ext">
4+
<body>
5+
<trans-unit id="1">
6+
<source>An authentication exception occurred.</source>
7+
<target>Грешка при автентикация.</target>
8+
</trans-unit>
9+
<trans-unit id="2">
10+
<source>Authentication credentials could not be found.</source>
11+
<target>Удостоверението за автентикация не е открито.</target>
12+
</trans-unit>
13+
<trans-unit id="3">
14+
<source>Authentication request could not be processed due to a system problem.</source>
15+
<target>Заявката за автентикация не може да бъде обработената поради системна грешка.</target>
16+
</trans-unit>
17+
<trans-unit id="4">
18+
<source>Invalid credentials.</source>
19+
<target>Невалидно удостоверение за автентикация.</target>
20+
</trans-unit>
21+
<trans-unit id="5">
22+
<source>Cookie has already been used by someone else.</source>
23+
<target>Това cookie вече се ползва от някой друг.</target>
24+
</trans-unit>
25+
<trans-unit id="6">
26+
<source>Not privileged to request the resource.</source>
27+
<target>Нямате права за достъп до този ресурс.</target>
28+
</trans-unit>
29+
<trans-unit id="7">
30+
<source>Invalid CSRF token.</source>
31+
<target>Невалиден CSRF токен.</target>
32+
</trans-unit>
33+
<trans-unit id="8">
34+
<source>Digest nonce has expired.</source>
35+
<target>Digest nonce е изтекъл.</target>
36+
</trans-unit>
37+
<trans-unit id="9">
38+
<source>No authentication provider found to support the authentication token.</source>
39+
<target>Не е открит провайдър, който да поддържа този токен за автентикация.</target>
40+
</trans-unit>
41+
<trans-unit id="10">
42+
<source>No session available, it either timed out or cookies are not enabled.</source>
43+
<target>Сесията не е достъпна, или времето за достъп е изтекло, или кукитата не са разрешени.</target>
44+
</trans-unit>
45+
<trans-unit id="11">
46+
<source>No token could be found.</source>
47+
<target>Токена не е открит.</target>
48+
</trans-unit>
49+
<trans-unit id="12">
50+
<source>Username could not be found.</source>
51+
<target>Потребителското име не е открито.</target>
52+
</trans-unit>
53+
<trans-unit id="13">
54+
<source>Account has expired.</source>
55+
<target>Акаунта е изтекъл.</target>
56+
</trans-unit>
57+
<trans-unit id="14">
58+
<source>Credentials have expired.</source>
59+
<target>Удостоверението за автентикация е изтекло.</target>
60+
</trans-unit>
61+
<trans-unit id="15">
62+
<source>Account is disabled.</source>
63+
<target>Акаунта е деактивиран.</target>
64+
</trans-unit>
65+
<trans-unit id="16">
66+
<source>Account is locked.</source>
67+
<target>Акаунта е заключен.</target>
68+
</trans-unit>
69+
</body>
70+
</file>
71+
</xliff>

src/Symfony/Component/Translation/PluralizationRules.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ public static function get($number, $locale)
114114
case 'pap':
115115
case 'ps':
116116
case 'pt':
117-
case 'xbr':
118117
case 'so':
119118
case 'sq':
120119
case 'sv':
@@ -135,6 +134,7 @@ public static function get($number, $locale)
135134
case 'ln':
136135
case 'mg':
137136
case 'nso':
137+
case 'xbr':
138138
case 'ti':
139139
case 'wa':
140140
return (($number == 0) || ($number == 1)) ? 0 : 1;

0 commit comments

Comments
 (0)
0