Skip to content

Commit

Permalink
allow onelogin 3.0 for php 7.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
cdaguerre committed Nov 9, 2018
1 parent 1b8f80e commit 60453c0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -4,6 +4,7 @@ php:
- 5.6
- 7.0
- 7.1
- 7.2

matrix:
fast_finish: true
Expand All @@ -24,9 +25,8 @@ cache:
before_install:
- mkdir -p build/logs
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
- echo "memory_limit=2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini

install: composer update --prefer-dist --no-interaction
install: COMPOSER_MEMORY_LIMIT=-1 travis_retry composer update --prefer-dist --no-interaction

script:
- ./vendor/bin/phpunit
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/services.yml
Expand Up @@ -2,7 +2,7 @@ parameters:

services:
onelogin_auth:
class: OneLogin_Saml2_Auth
class: OneLogin\Saml2\Auth
arguments: [ "%hslavich_onelogin_saml.settings%"]
public: true

Expand Down
6 changes: 3 additions & 3 deletions Security/Firewall/SamlListener.php
Expand Up @@ -12,14 +12,14 @@
class SamlListener extends AbstractAuthenticationListener
{
/**
* @var \OneLogin_Saml2_Auth
* @var \OneLogin\Saml2\Auth
*/
protected $oneLoginAuth;

/**
* @param \OneLogin_Saml2_Auth $oneLoginAuth
* @param \OneLogin\Saml2\Auth $oneLoginAuth
*/
public function setOneLoginAuth(\OneLogin_Saml2_Auth $oneLoginAuth)
public function setOneLoginAuth(\OneLogin\Saml2\Auth $oneLoginAuth)
{
$this->oneLoginAuth = $oneLoginAuth;
}
Expand Down
4 changes: 2 additions & 2 deletions Security/Logout/SamlLogoutHandler.php
Expand Up @@ -12,7 +12,7 @@ class SamlLogoutHandler implements LogoutHandlerInterface
{
protected $samlAuth;

public function __construct(\OneLogin_Saml2_Auth $samlAuth)
public function __construct(\OneLogin\Saml2\Auth $samlAuth)
{
$this->samlAuth = $samlAuth;
}
Expand All @@ -34,7 +34,7 @@ public function logout(Request $request, Response $response, TokenInterface $tok

try {
$this->samlAuth->processSLO();
} catch (\OneLogin_Saml2_Error $e) {
} catch (\OneLogin\Saml2\Error $e) {
$sessionIndex = $token->hasAttribute('sessionIndex') ? $token->getAttribute('sessionIndex') : null;
$this->samlAuth->logout(null, array(), $token->getUsername(), $sessionIndex);
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/Firewall/SamlListenerTest.php
Expand Up @@ -20,7 +20,7 @@ public function testHandleValidAuthenticationWithAttribute()

$attributes = array('uid' => array('username_uid'));

$onelogin = $this->getMockBuilder('OneLogin_Saml2_Auth')->disableOriginalConstructor()->getMock();
$onelogin = $this->getMockBuilder('OneLogin\Saml2\Auth')->disableOriginalConstructor()->getMock();
$onelogin->expects($this->once())->method('processResponse');
$onelogin
->expects($this->once())
Expand All @@ -36,7 +36,7 @@ public function testHandleValidAuthenticationWithEmptyOptions()
{
$listener = $this->getListener(array());

$onelogin = $this->getMockBuilder('OneLogin_Saml2_Auth')->disableOriginalConstructor()->getMock();
$onelogin = $this->getMockBuilder('OneLogin\Saml2\Auth')->disableOriginalConstructor()->getMock();
$onelogin->expects($this->once())->method('processResponse');
$onelogin
->expects($this->once())
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -13,7 +13,7 @@
"require": {
"symfony/framework-bundle": "~2.3|~3.0|^4.0",
"symfony/security-bundle": "~2.3|~3.0|^4.0",
"onelogin/php-saml": "~2.13"
"onelogin/php-saml": "^3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7|~3.0|^4.0",
Expand Down

0 comments on commit 60453c0

Please sign in to comment.