Skip to content

Commit

Permalink
Merge pull request #1 from ruslanbaydan/feature/3.0-compat
Browse files Browse the repository at this point in the history
Feature/3.0-compat
  • Loading branch information
ruslanbaidan committed Jan 11, 2016
2 parents e381edf + a3facf3 commit d114b3c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ php:
- 5.3
- 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.7.*
- SYMFONY_VERSION=2.8.*
- SYMFONY_VERSION=3.0.*

before_script:
- composer require symfony/framework-bundle:${SYMFONY_VERSION}
Expand Down
4 changes: 1 addition & 3 deletions Helper/DeviceView.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
],
"require": {
"php": ">=5.3.0",
"symfony/framework-bundle": ">=2.3,<3.0",
"symfony/framework-bundle": "~2.3|~3.0",
"mobiledetect/mobiledetectlib": "~2.8"
},
"require-dev": {
"phpunit/phpunit": "~4.1"
"phpunit/phpunit": "~4.1",
"symfony/phpunit-bridge": "~2.7|~3.0"
},
"autoload": {
"psr-0": {
Expand Down

0 comments on commit d114b3c

Please sign in to comment.