Skip to content

Commit c1cc49d

Browse files
committed
migrate to laminas
1 parent 5c42168 commit c1cc49d

File tree

8 files changed

+33
-30
lines changed

8 files changed

+33
-30
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ CONTRIBUTING
33
To contribute, you can send pull requests with :
44

55
- Typo fix.
6-
- Use [Zend Coding Standard](https://github.com/zendframework/zend-coding-standard).
6+
- Use [Laminas Coding Standard](https://github.com/laminas/laminas-coding-standard).
77
- patch(es) need new/updated test(s).
88
- new feature(s) need test(s).
99

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ RedirectHandlerModule
77
[![Coverage Status](https://coveralls.io/repos/samsonasik/RedirectHandlerModule/badge.svg?branch=master)](https://coveralls.io/r/samsonasik/RedirectHandlerModule)
88
[![Downloads](https://poser.pugx.org/samsonasik/redirect-handler-module/downloads)](https://packagist.org/packages/samsonasik/redirect-handler-module)
99

10-
*RedirectHandlerModule* is a module for handling redirect when the given url to redirect plugin is not registered in your ZF application. It simply override existing ZF redirect plugin, so we can just use it.
10+
*RedirectHandlerModule* is a module for handling redirect when the given url to redirect plugin is not registered in your Laminas application. It simply override existing Laminas redirect plugin, so we can just use it.
1111

12-
> This is README for version ^2.0 which only support ZF3 with php ^7.1.
12+
> This is README for version ^3.0 which only support Laminas 3 with php ^7.1.
13+
14+
> For version 2, you can read at [version 2 readme](https://github.com/samsonasik/RedirectHandlerModule/tree/2.x.x) which still support ZF3 with php ^7.1 support.
1315
1416
> For version 1, you can read at [version 1 readme](https://github.com/samsonasik/RedirectHandlerModule/tree/1.x.x) which still support ZF2 with php ^5.6|^7.0 support.
1517

composer.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "samsonasik/redirect-handler-module",
33
"type": "library",
4-
"description": "ZF2 module to for Url Redirect handling",
4+
"description": "Laminas module to for Url Redirect handling",
55
"keywords": [
66
"redirect",
7-
"zf2",
8-
"zf3",
7+
"laminas2",
8+
"laminas3",
99
"handler"
1010
],
1111
"homepage": "https://github.com/samsonasik/RedirectHandlerModule",
@@ -20,13 +20,14 @@
2020
],
2121
"require": {
2222
"php": "^7.1",
23-
"zendframework/zend-mvc": "^3.0",
24-
"zendframework/zend-servicemanager": "^3.3.0"
23+
"laminas/laminas-mvc": "^3.0",
24+
"laminas/laminas-servicemanager": "^3.3.0",
25+
"laminas/laminas-dependency-plugin": "^1.0"
2526
},
2627
"require-dev": {
2728
"php-coveralls/php-coveralls": "^2.1",
2829
"phpunit/phpunit": "^7.0",
29-
"zendframework/zend-coding-standard": "^1.0"
30+
"laminas/laminas-coding-standard": "^1.0"
3031
},
3132
"config": {
3233
"process-timeout": 5000

config/module.config.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
return [
2121
'controller_plugins' => [
2222
'factories' => [
23-
'redirect' => 'RedirectHandlerModule\Controller\Plugin\RedirectFactory',
24-
'Redirect' => 'RedirectHandlerModule\Controller\Plugin\RedirectFactory',
25-
\Zend\Mvc\Controller\Plugin\Redirect::class => 'RedirectHandlerModule\Controller\Plugin\RedirectFactory',
26-
'zendmvccontrollerpluginredirect' => 'RedirectHandlerModule\Controller\Plugin\RedirectFactory',
23+
'redirect' => 'RedirectHandlerModule\Controller\Plugin\RedirectFactory',
24+
'Redirect' => 'RedirectHandlerModule\Controller\Plugin\RedirectFactory',
25+
\Laminas\Mvc\Controller\Plugin\Redirect::class => 'RedirectHandlerModule\Controller\Plugin\RedirectFactory',
26+
'laminasmvccontrollerpluginredirect' => 'RedirectHandlerModule\Controller\Plugin\RedirectFactory',
2727
],
2828
],
2929
];

phpcs.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<ruleset name="Zend Framework Coding Standard">
3-
<rule ref="./vendor/zendframework/zend-coding-standard/ruleset.xml"/>
3+
<rule ref="./vendor/laminas/laminas-coding-standard/ruleset.xml"/>
44

55
<!-- Paths to check -->
66
<file>src</file>

src/Controller/Plugin/Redirect.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121

2222
namespace RedirectHandlerModule\Controller\Plugin;
2323

24-
use Zend\EventManager\EventManagerAwareInterface;
25-
use Zend\EventManager\EventManagerAwareTrait;
26-
use Zend\Mvc\Controller\ControllerManager;
27-
use Zend\Mvc\Controller\Plugin\Redirect as BaseRedirect;
28-
use Zend\Uri\Uri;
24+
use Laminas\EventManager\EventManagerAwareInterface;
25+
use Laminas\EventManager\EventManagerAwareTrait;
26+
use Laminas\Mvc\Controller\ControllerManager;
27+
use Laminas\Mvc\Controller\Plugin\Redirect as BaseRedirect;
28+
use Laminas\Uri\Uri;
2929

3030
class Redirect extends BaseRedirect implements EventManagerAwareInterface
3131
{
@@ -54,7 +54,7 @@ public function __construct(
5454
*
5555
* @param string $url
5656
*
57-
* @return \Zend\Http\PhpEnvironment\Response
57+
* @return \Laminas\Http\PhpEnvironment\Response
5858
*/
5959
public function toUrl($url)
6060
{

test/Controller/Plugin/RedirectFactoryTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function testInvoke($config)
7878
{
7979
$services = $this->prophesize(ContainerInterface::class);
8080

81-
$controllerManager = $this->prophesize('Zend\Mvc\Controller\ControllerManager');
81+
$controllerManager = $this->prophesize('Laminas\Mvc\Controller\ControllerManager');
8282
$services->get('ControllerManager')->willReturn($controllerManager)
8383
->shouldBeCalled();
8484

test/Controller/Plugin/RedirectTest.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121

2222
use PHPUnit\Framework\TestCase;
2323
use RedirectHandlerModule\Controller\Plugin\Redirect;
24-
use Zend\EventManager\EventManager;
25-
use Zend\Http\Headers;
26-
use Zend\Http\PhpEnvironment\Request;
27-
use Zend\Http\PhpEnvironment\Response;
28-
use Zend\Mvc\Controller\AbstractActionController;
29-
use Zend\Mvc\Controller\ControllerManager;
30-
use Zend\Mvc\MvcEvent;
31-
use Zend\Router\Http\TreeRouteStack;
32-
use Zend\Router\RouteMatch;
24+
use Laminas\EventManager\EventManager;
25+
use Laminas\Http\Headers;
26+
use Laminas\Http\PhpEnvironment\Request;
27+
use Laminas\Http\PhpEnvironment\Response;
28+
use Laminas\Mvc\Controller\AbstractActionController;
29+
use Laminas\Mvc\Controller\ControllerManager;
30+
use Laminas\Mvc\MvcEvent;
31+
use Laminas\Router\Http\TreeRouteStack;
32+
use Laminas\Router\RouteMatch;
3333

3434
class RedirectTest extends TestCase
3535
{

0 commit comments

Comments
 (0)