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

Skip to content

Commit 7090495

Browse files
Merge branch '2.8' into 3.4
* 2.8: [HttpKernel] fix test compat with PHP 5.3 fix file lock on SunOS change `evaluate()` docblock return type from string to mixed Set serialize_precision explicitly to avoid fancy float rounding
2 parents d652222 + f63579d commit 7090495

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function compile($expression, $names = array())
7171
* @param Expression|string $expression The expression to compile
7272
* @param array $values An array of values
7373
*
74-
* @return string The result of the evaluation of the expression
74+
* @return mixed The result of the evaluation of the expression
7575
*/
7676
public function evaluate($expression, $values = array())
7777
{

src/Symfony/Component/Filesystem/LockHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ public function lock($blocking = false)
8181
$error = $msg;
8282
});
8383

84-
if (!$this->handle = fopen($this->file, 'r')) {
84+
if (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) {
8585
if ($this->handle = fopen($this->file, 'x')) {
8686
chmod($this->file, 0444);
87-
} elseif (!$this->handle = fopen($this->file, 'r')) {
87+
} elseif (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) {
8888
usleep(100); // Give some time for chmod() to complete
89-
$this->handle = fopen($this->file, 'r');
89+
$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r');
9090
}
9191
}
9292
restore_error_handler();

src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616

1717
class JsonResponseTest extends TestCase
1818
{
19+
protected function setUp()
20+
{
21+
parent::setUp();
22+
23+
if (!defined('HHVM_VERSION')) {
24+
$this->iniSet('serialize_precision', 14);
25+
}
26+
}
27+
1928
public function testConstructorEmptyCreatesJsonObject()
2029
{
2130
$response = new JsonResponse();

0 commit comments

Comments
 (0)
0