From b32f16c648e1fa22df33b5979c5c83f8cf8d3443 Mon Sep 17 00:00:00 2001 From: Svante Richter Date: Mon, 29 Feb 2016 15:32:46 +0100 Subject: [PATCH] More php 5.3 fixes --- src/Content/LocalizedContent.php | 10 ++++++---- src/Controller/AsyncController.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Content/LocalizedContent.php b/src/Content/LocalizedContent.php index 3f49d5c..802853d 100644 --- a/src/Content/LocalizedContent.php +++ b/src/Content/LocalizedContent.php @@ -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; } ); @@ -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']); diff --git a/src/Controller/AsyncController.php b/src/Controller/AsyncController.php index 5a7c65c..56ad892 100755 --- a/src/Controller/AsyncController.php +++ b/src/Controller/AsyncController.php @@ -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;