From 526b4c8edf4ceb56cf14ac9d399c95970cf71164 Mon Sep 17 00:00:00 2001 From: Tony R Quilkey Date: Wed, 2 Dec 2015 12:32:45 +1100 Subject: [PATCH 1/3] Upgrade to support 2.8 & 3.0 and fixed deprecations --- .travis.yml | 6 ++++++ Helper/DeviceView.php | 4 +--- composer.json | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 99c575f..c062ad1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,12 +5,18 @@ php: - 5.3 - 5.4 - 5.5 + - 5.6 env: - SYMFONY_VERSION=2.1.* - SYMFONY_VERSION=2.2.* - SYMFONY_VERSION=2.3.* - SYMFONY_VERSION=2.4.* + - SYMFONY_VERSION=2.5.* + - SYMFONY_VERSION=2.6.* + - SYMFONY_VERSION=2.7.* + - SYMFONY_VERSION=2.8.* + - SYMFONY_VERSION=3.0.* before_script: - composer require symfony/framework-bundle:${SYMFONY_VERSION} diff --git a/Helper/DeviceView.php b/Helper/DeviceView.php index 787687d..af38886 100644 --- a/Helper/DeviceView.php +++ b/Helper/DeviceView.php @@ -54,14 +54,12 @@ class DeviceView */ public function __construct(Container $serviceContainer) { - if (false === $serviceContainer->isScopeActive('request')) { + if (!$this->request = $serviceContainer->get('request_stack')->getMasterRequest()) { $this->viewType = self::VIEW_NOT_MOBILE; return; } - $this->request = $serviceContainer->get('request'); - if ($this->request->query->has(self::SWITCH_PARAM)) { $this->viewType = $this->request->query->get(self::SWITCH_PARAM); } elseif ($this->request->cookies->has(self::COOKIE_KEY)) { diff --git a/composer.json b/composer.json index 4b7e36a..ee52a5d 100644 --- a/composer.json +++ b/composer.json @@ -13,11 +13,12 @@ ], "require": { "php": ">=5.3.0", - "symfony/framework-bundle": ">=2.3,<3.0", + "symfony/framework-bundle": ">=2.3|~2.8|~3.0", "mobiledetect/mobiledetectlib": "~2.8" }, "require-dev": { - "phpunit/phpunit": "~4.1" + "phpunit/phpunit": "~4.1", + "symfony/phpunit-bridge": "^3.0" }, "autoload": { "psr-0": { From f059e75088c3a99405018a8b3dd42252ce32d23b Mon Sep 17 00:00:00 2001 From: Tony R Quilkey Date: Mon, 7 Dec 2015 13:54:16 +1100 Subject: [PATCH 2/3] Updated composer.json re PR --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index ee52a5d..b2c4a35 100644 --- a/composer.json +++ b/composer.json @@ -13,12 +13,12 @@ ], "require": { "php": ">=5.3.0", - "symfony/framework-bundle": ">=2.3|~2.8|~3.0", + "symfony/framework-bundle": "~2.3|~3.0", "mobiledetect/mobiledetectlib": "~2.8" }, "require-dev": { "phpunit/phpunit": "~4.1", - "symfony/phpunit-bridge": "^3.0" + "symfony/phpunit-bridge": "~2.7|~3.0" }, "autoload": { "psr-0": { From a3facf3f4fe0f7792bb7ff7182b2629d5b6b5e38 Mon Sep 17 00:00:00 2001 From: Tony R Quilkey Date: Mon, 7 Dec 2015 13:54:35 +1100 Subject: [PATCH 3/3] Updated .travis.yml re PR --- .travis.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index c062ad1..b3d7217 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,14 +6,10 @@ php: - 5.4 - 5.5 - 5.6 + - 7.0 env: - - SYMFONY_VERSION=2.1.* - - SYMFONY_VERSION=2.2.* - SYMFONY_VERSION=2.3.* - - SYMFONY_VERSION=2.4.* - - SYMFONY_VERSION=2.5.* - - SYMFONY_VERSION=2.6.* - SYMFONY_VERSION=2.7.* - SYMFONY_VERSION=2.8.* - SYMFONY_VERSION=3.0.*