Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7f6df53

Browse files
authored
Merge pull request #11 from svycka/migrate-to-laminas
Migrate to laminas
2 parents 22449dd + 8ff84c7 commit 7f6df53

20 files changed

Lines changed: 117 additions & 122 deletions

.travis.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ sudo: false
66

77
matrix:
88
include:
9-
- php: 5.6
10-
env:
11-
- EXECUTE_TEST_COVERALLS=true
12-
- php: 7
9+
- php: 7.2
1310
env:
1411
- EXECUTE_CS_CHECK=true
15-
- php: 7.1
16-
allow_failures:
17-
- php: hhvm
12+
- php: 7.3
13+
env:
14+
- EXECUTE_TEST_COVERALLS=true
15+
- php: 7.4
1816

1917
before_install:
2018
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ All Notable changes to `svycka/social-user` will be documented in this file
55
## NEXT - YYYY-MM-DD
66

77
### Added
8-
- Nothing
8+
- [#11](https://github.com/svycka/social-user/pull/11) Added support for Laminas
9+
- [#11](https://github.com/svycka/social-user/pull/11) Added support for PHP 7.2, 7.3 and 7.4
910

1011
### Deprecated
1112
- Nothing
@@ -14,7 +15,8 @@ All Notable changes to `svycka/social-user` will be documented in this file
1415
- Nothing
1516

1617
### Removed
17-
- Nothing
18+
- [#11](https://github.com/svycka/social-user/pull/11) Removed PHP 5.6, 7.0 and php7.1 support
19+
- [#11](https://github.com/svycka/social-user/pull/11) Removed zend-servicemanager 2.* support
1820

1921
### Security
2022
- Nothing

composer.json

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"social-user",
1111
"zendframework",
1212
"doctrine",
13-
"zf2",
1413
"module",
15-
"zend-expressive"
14+
"mezzio",
15+
"laminas"
1616
],
1717
"homepage": "https://github.com/svycka/social-user",
1818
"license": "MIT",
@@ -24,24 +24,25 @@
2424
}
2525
],
2626
"require": {
27-
"php": "^5.6 || ^7.0",
28-
"zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
29-
"bshaffer/oauth2-server-php": "^1.8"
27+
"php": "^7.2",
28+
"ext-json": "*",
29+
"bshaffer/oauth2-server-php": "^1.11",
30+
"laminas/laminas-servicemanager": "^3.4.0"
3031
},
3132
"require-dev": {
3233
"doctrine/orm": "^2.5.6",
3334
"facebook/graph-sdk": "^5.3.1",
3435
"guzzlehttp/guzzle": "^6.1",
35-
"phpunit/phpunit": "^4.8",
36-
"scrutinizer/ocular": "~1.1",
37-
"squizlabs/php_codesniffer": "^2.5",
38-
"zendframework/zend-modulemanager": "^2.7"
36+
"phpunit/phpunit": "^7.5.20",
37+
"scrutinizer/ocular": "^1.6.0",
38+
"squizlabs/php_codesniffer": "^3.5.3",
39+
"laminas/laminas-modulemanager": "^2.7"
3940
},
4041
"suggest": {
4142
"facebook/graph-sdk": "Required, if you will use Facebook grant type",
4243
"guzzlehttp/guzzle": "Required, if you will use Google grant type",
4344
"doctrine/orm": "Required, if you will use Doctrine for storage",
44-
"zendframework/zend-modulemanager": "Required, if you will use zend-mvc"
45+
"laminas/laminas-modulemanager": "Required, if you will use laminas-mvc"
4546
},
4647
"autoload": {
4748
"psr-4": {
@@ -61,5 +62,17 @@
6162
"component": "Svycka\\SocialUser",
6263
"config-provider": "Svycka\\SocialUser\\ConfigProvider"
6364
}
65+
},
66+
"scripts": {
67+
"check": [
68+
"@test",
69+
"@cs-check"
70+
],
71+
"cs-check": "php vendor/bin/phpcs",
72+
"cs-fix": "php vendor/bin/phpcbf",
73+
"test": "php vendor/bin/phpunit --colors=always"
74+
},
75+
"config": {
76+
"sort-packages": true
6477
}
6578
}

src/OAuth2/GrantType/Factory/FacebookFactory.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33
namespace Svycka\SocialUser\OAuth2\GrantType\Factory;
44

55
use Facebook\Facebook;
6+
use Laminas\ServiceManager\Factory\FactoryInterface;
67
use Interop\Container\ContainerInterface;
78
use Svycka\SocialUser\OAuth2\GrantType;
89
use Svycka\SocialUser\Service\SocialUserService;
9-
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
10-
use Zend\ServiceManager\FactoryInterface;
11-
use Zend\ServiceManager\ServiceLocatorInterface;
10+
use Laminas\ServiceManager\Exception\ServiceNotCreatedException;
1211

1312
/**
1413
* @author Vytautas Stankus <[email protected]>
1514
* @license MIT
1615
*/
17-
class FacebookFactory implements FactoryInterface
16+
final class FacebookFactory implements FactoryInterface
1817
{
1918
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
2019
{
@@ -29,9 +28,4 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
2928

3029
return new GrantType\Facebook($socialUserService, $facebook);
3130
}
32-
33-
public function createService(ServiceLocatorInterface $services)
34-
{
35-
return $this($services, GrantType\Facebook::class);
36-
}
3731
}

src/OAuth2/GrantType/Factory/GoogleFactory.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22

33
namespace Svycka\SocialUser\OAuth2\GrantType\Factory;
44

5+
use Laminas\ServiceManager\Factory\FactoryInterface;
56
use Interop\Container\ContainerInterface;
67
use Svycka\SocialUser\OAuth2\GrantType;
78
use Svycka\SocialUser\Service\SocialUserService;
8-
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
9-
use Zend\ServiceManager\FactoryInterface;
10-
use Zend\ServiceManager\ServiceLocatorInterface;
9+
use Laminas\ServiceManager\Exception\ServiceNotCreatedException;
1110

1211
/**
1312
* @author Vytautas Stankus <[email protected]>
1413
* @license MIT
1514
*/
16-
class GoogleFactory implements FactoryInterface
15+
final class GoogleFactory implements FactoryInterface
1716
{
1817
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
1918
{
@@ -28,9 +27,4 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
2827

2928
return new GrantType\Google($socialUserService, $httpClient, $options[GrantType\Google::class]);
3029
}
31-
32-
public function createService(ServiceLocatorInterface $services)
33-
{
34-
return $this($services, GrantType\Google::class);
35-
}
3630
}

src/Service/Factory/SocialUserServiceFactory.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22

33
namespace Svycka\SocialUser\Service\Factory;
44

5+
use Laminas\ServiceManager\Factory\FactoryInterface;
56
use Interop\Container\ContainerInterface;
67
use Svycka\SocialUser\LocalUserProviderInterface;
78
use Svycka\SocialUser\Service\SocialUserService;
89
use Svycka\SocialUser\Storage\SocialUserStorageInterface;
9-
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
10-
use Zend\ServiceManager\FactoryInterface;
11-
use Zend\ServiceManager\ServiceLocatorInterface;
10+
use Laminas\ServiceManager\Exception\ServiceNotCreatedException;
1211

1312
/**
1413
* @author Vytautas Stankus <[email protected]>
1514
* @license MIT
1615
*/
17-
class SocialUserServiceFactory implements FactoryInterface
16+
final class SocialUserServiceFactory implements FactoryInterface
1817
{
1918
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
2019
{
@@ -40,9 +39,4 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
4039

4140
return new SocialUserService($localUserProvider, $storage);
4241
}
43-
44-
public function createService(ServiceLocatorInterface $services)
45-
{
46-
return $this($services, SocialUserService::class);
47-
}
4842
}

src/Storage/Doctrine.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@ public function findByProviderIdentifier($provider, $identifier)
5757
}
5858

5959
/**
60-
* @param int $user_id
60+
* @param int $user_id
6161
* @param string $identifier
6262
* @param string $provider
6363
*
6464
* @return SocialUserInterface
65+
* @throws \Doctrine\ORM\ORMException
6566
*/
6667
public function addSocialUser($user_id, $identifier, $provider)
6768
{

src/Storage/Factory/DoctrineStorageFactory.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22

33
namespace Svycka\SocialUser\Storage\Factory;
44

5+
use Laminas\ServiceManager\Factory\FactoryInterface;
56
use Interop\Container\ContainerInterface;
67
use Svycka\SocialUser\Storage\Doctrine;
7-
use Zend\ServiceManager\FactoryInterface;
8-
use Zend\ServiceManager\ServiceLocatorInterface;
98

109
/**
1110
* @author Vytautas Stankus <[email protected]>
1211
* @license MIT
1312
*/
14-
class DoctrineStorageFactory implements FactoryInterface
13+
final class DoctrineStorageFactory implements FactoryInterface
1514
{
1615
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
1716
{
@@ -24,9 +23,4 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
2423

2524
return new Doctrine($entityManager, $options);
2625
}
27-
28-
public function createService(ServiceLocatorInterface $services)
29-
{
30-
return $this($services, Doctrine::class);
31-
}
3226
}

tests/SocialUserTest/ConfigProviderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
* @author Vytautas Stankus <[email protected]>
99
* @license MIT
1010
*/
11-
class ConfigProviderTest extends \PHPUnit_Framework_TestCase
11+
class ConfigProviderTest extends \PHPUnit\Framework\TestCase
1212
{
1313
public function testConfigIsArray()
1414
{
1515
$configProvider = new ConfigProvider();
16-
$this->assertInternalType('array', $configProvider->__invoke());
16+
$this->assertIsArray($configProvider->__invoke());
1717
}
1818
}

tests/SocialUserTest/Entity/SocialUserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @author Vytautas Stankus <[email protected]>
99
* @license MIT
1010
*/
11-
class SocialUserTest extends \PHPUnit_Framework_TestCase
11+
class SocialUserTest extends \PHPUnit\Framework\TestCase
1212
{
1313
/**
1414
* @var SocialUser

0 commit comments

Comments
 (0)