Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Manually fix symfony components to stick to php5.4 compliance. We may…
Browse files Browse the repository at this point in the history
… have to bump php to 5.5 requirement in next version.
  • Loading branch information
cdujeu committed Jul 19, 2016
1 parent 71870b4 commit c86f299
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ protected function normalizeValue($value)
*/
protected function remapXml($value)
{
foreach ($this->xmlRemappings as list($singular, $plural)) {
foreach ($this->xmlRemappings as $transition) {
list($singular, $plural) = $transition;
if (!isset($value[$singular])) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,13 @@ public function import($resource, $type = null, $ignoreErrors = false, $sourceRe

try {
$ret = $loader->load($resource, $type);
} finally {
} catch (\Exception $e) {
unset(self::$loading[$resource]);
throw $e;
}

unset(self::$loading[$resource]);

return $ret;
} catch (FileLoaderImportCircularReferenceException $e) {
throw $e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,16 @@ public function testLoadWrongEmptyXMLWithErrorHandler()
} catch (\InvalidArgumentException $e) {
$this->assertEquals(sprintf('File %s does not contain valid XML, it is empty.', $file), $e->getMessage());
}
} finally {
} catch (\Exception $e) {
restore_error_handler();
error_reporting($errorReporting);

throw $e;
}

restore_error_handler();
error_reporting($errorReporting);

$disableEntities = libxml_disable_entity_loader(true);
libxml_disable_entity_loader($disableEntities);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ public function testDumpNumericValueWithLocale()

$this->assertEquals('1.2', Inline::dump(1.2));
$this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0)));
} finally {
setlocale(LC_NUMERIC, $locale);
} catch (\Exception $e) {
setlocale(LC_NUMERIC, $locale);
throw $e;
}
}

Expand Down

0 comments on commit c86f299

Please sign in to comment.