Skip to content

Commit

Permalink
More php 5.3 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SvanteRichter committed Feb 29, 2016
1 parent a0eae46 commit b32f16c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/Content/LocalizedContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ private function localeHydrate($content = "")
{
$locales = $this->app['config']->get('general/locales');
if($locales){
$defaultLocaleSlug = reset($locales)['slug'];
$locale = reset($locales);
$defaultLocaleSlug = $locale['slug'];
$currentLocale = $this->app['request']->get('_locale');
$matchedLocales = array_filter(
$locales,
function ($e) {
return $e['slug'] == $this->app['request']->get('_locale');
function ($e) use ($currentLocale) {
return $e['slug'] == $currentLocale;
}
);

Expand All @@ -123,7 +125,7 @@ function ($e) {
$stmt->bindValue('contenttype', $this->contenttype['slug']);
$stmt->bindValue('id', $this->id);
$stmt->execute();
$this->delocalizedValues = [];
$this->delocalizedValues = array();
while ($row = $stmt->fetch()) {
$this->delocalizedValues[$row['field']] = $this->values[$row['field']];
$this->setValue($row['field'],$row['value']);
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/AsyncController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AsyncController implements ControllerProviderInterface
public function connect(Application $app)
{
$router = $app['controllers_factory'];
$router->match('/get', [$this, 'getTranslationAction'])
$router->match('/get', array($this, 'getTranslationAction'))
->method('GET');

return $router;
Expand Down

0 comments on commit b32f16c

Please sign in to comment.