Skip to content

Commit 7626f33

Browse files
committed
migrate to laminas
1 parent 79cd77f commit 7626f33

File tree

11 files changed

+43
-42
lines changed

11 files changed

+43
-42
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
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 [Zend 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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ ForceHttpsModule
1010
Introduction
1111
------------
1212

13-
ForceHttpsModule is a configurable module for force https in your [ZF Mvc](https://zendframework.github.io/tutorials/getting-started/overview/) and [ZF Expressive](https://zendframework.github.io/zend-expressive/) Application.
13+
ForceHttpsModule is a configurable module for force https in your [Laminas Mvc](https://docs.laminas.dev/tutorials/) and [Mezzio](https://docs.mezzio.dev/mezzio/) Application.
1414

15-
> This is README for version ^2.0 which only support ZF3 and ZF Expressive version 3 with php ^7.1.
15+
> This is README for version ^3.0 which only support Laminas Mvc version 3 and Mezzio version 3 with php ^7.1.
16+
17+
> For version ^2.0, you can read at [version 2 readme](https://github.com/samsonasik/ForceHttpsModule/tree/2.x.x) which only support ZF3 and ZF Expressive version 3 with php ^7.1.
1618
1719
> For version 1, you can read at [version 1 readme](https://github.com/samsonasik/ForceHttpsModule/tree/1.x.x) which still support ZF2 and ZF Expressive version 1 and 2 with php ^5.6|^7.0 support.
1820
@@ -39,7 +41,7 @@ composer require samsonasik/force-https-module
3941

4042
**2. Copy config**
4143

42-
***a. For [ZF3 Mvc](https://zendframework.github.io/tutorials/getting-started/overview/) application, copy `force-https-module.local.php.dist` config to your local's autoload and configure it***
44+
***a. For [Laminas Mvc](https://docs.laminas.dev/tutorials/) application, copy `force-https-module.local.php.dist` config to your local's autoload and configure it***
4345

4446
| source | destination |
4547
|------------------------------------------------------------------------------|---------------------------------------------|
@@ -51,7 +53,7 @@ Or run copy command:
5153
cp vendor/samsonasik/force-https-module/config/force-https-module.local.php.dist config/autoload/force-https-module.local.php
5254
```
5355

54-
***b. For [ZF Expressive](https://zendframework.github.io/zend-expressive/) application, copy `expressive-force-https-module.local.php.dist` config to your local's autoload and configure it***
56+
***b. For [Mezzio](https://docs.mezzio.dev/mezzio/) application, copy `expressive-force-https-module.local.php.dist` config to your local's autoload and configure it***
5557

5658
| source | destination |
5759
|------------------------------------------------------------------------------|---------------------------------------------|
@@ -97,7 +99,7 @@ return [
9799

98100
**3. Lastly, enable it**
99101

100-
***a. For ZF Mvc application***
102+
***a. For Laminas Mvc application***
101103

102104
```php
103105
// config/modules.config.php or config/application.config.php
@@ -107,9 +109,9 @@ return [
107109
],
108110
```
109111

110-
***b. For ZF Expressive application***
112+
***b. For Mezzio application***
111113

112-
For [zend-expressive-skeleton](https://github.com/zendframework/zend-expressive-skeleton) ^3.0, you need to open `config/pipeline.php` and add:
114+
For [mezzio-skeleton](https://github.com/mezzio/mezzio-skeleton) ^3.0, you need to open `config/pipeline.php` and add:
113115

114116
```php
115117
$app->pipe(ForceHttpsModule\Middleware\ForceHttps::class);

composer.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"name": "samsonasik/force-https-module",
33
"type": "library",
4-
"description": "Force Https Module",
4+
"description": "Force Https Module for Laminas Mvc and Mezzio application",
55
"keywords": [
6-
"zf2",
7-
"zf3",
6+
"laminas3",
87
"expressive",
98
"middleware",
109
"force",
@@ -27,20 +26,20 @@
2726
"require": {
2827
"php": "^7.1",
2928
"webmozart/assert": "^1.4",
30-
"zendframework/zend-console": "^2.5"
29+
"laminas/laminas-console": "^2.5"
3130
},
3231
"conflict": {
33-
"zendframework/zend-expressive": "<3.0",
34-
"zendframework/zend-mvc": "<3.0"
32+
"mezzio/mezzio": "<3.0",
33+
"laminas/laminas-mvc": "<3.0"
3534
},
3635
"require-dev": {
3736
"kahlan/kahlan": "^4.0",
3837
"php-coveralls/php-coveralls": "^2.1",
3938
"phpstan/phpstan": "^0.10.8",
4039
"phpstan/phpstan-webmozart-assert": "^0.10.0",
41-
"zendframework/zend-coding-standard": "^1.0",
42-
"zendframework/zend-expressive": "^3.0",
43-
"zendframework/zend-mvc": "^3.0"
40+
"laminas/laminas-coding-standard": "^1.0",
41+
"mezzio/mezzio": "^3.0",
42+
"laminas/laminas-mvc": "^3.0"
4443
},
4544
"config": {
4645
"bin-dir": "bin",

phpcs.xml

Lines changed: 1 addition & 1 deletion
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>

spec/Listener/ForceHttpsSpec.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
use Kahlan\Plugin\Double;
77
use Kahlan\Plugin\Quit;
88
use Kahlan\QuitException;
9-
use Zend\Console\Console;
10-
use Zend\EventManager\EventManagerInterface;
11-
use Zend\Http\PhpEnvironment\Request;
12-
use Zend\Http\PhpEnvironment\Response;
13-
use Zend\Mvc\MvcEvent;
14-
use Zend\Router\RouteMatch;
15-
use Zend\Uri\Uri;
9+
use Laminas\Console\Console;
10+
use Laminas\EventManager\EventManagerInterface;
11+
use Laminas\Http\PhpEnvironment\Request;
12+
use Laminas\Http\PhpEnvironment\Response;
13+
use Laminas\Mvc\MvcEvent;
14+
use Laminas\Router\RouteMatch;
15+
use Laminas\Uri\Uri;
1616

1717
describe('ForceHttps', function () {
1818

spec/Middleware/ForceHttpsFactorySpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use ForceHttpsModule\Middleware\ForceHttpsFactory;
77
use Kahlan\Plugin\Double;
88
use Psr\Container\ContainerInterface;
9-
use Zend\Expressive\Router\RouterInterface;
9+
use Mezzio\Router\RouterInterface;
1010

1111
describe('ForceHttpsFactory', function () {
1212

spec/Middleware/ForceHttpsSpec.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
use Psr\Http\Message\UriInterface;
1010
use Psr\Http\Server\MiddlewareInterface;
1111
use Psr\Http\Server\RequestHandlerInterface;
12-
use Zend\Expressive\Router\Route;
13-
use Zend\Expressive\Router\RouteResult;
14-
use Zend\Expressive\Router\RouterInterface;
12+
use Mezzio\Router\Route;
13+
use Mezzio\Router\RouteResult;
14+
use Mezzio\Router\RouterInterface;
1515

1616
describe('ForceHttps', function () {
1717

src/HttpsTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
use Psr\Http\Message\ResponseInterface;
88
use Webmozart\Assert\Assert;
9-
use Zend\Expressive\Router\RouteResult;
10-
use Zend\Http\PhpEnvironment\Response;
11-
use Zend\Router\RouteMatch;
9+
use Mezzio\Router\RouteResult;
10+
use Laminas\Http\PhpEnvironment\Response;
11+
use Laminas\Router\RouteMatch;
1212

1313
trait HttpsTrait
1414
{

src/Listener/ForceHttps.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
namespace ForceHttpsModule\Listener;
66

77
use ForceHttpsModule\HttpsTrait;
8-
use Zend\Console\Console;
9-
use Zend\EventManager\AbstractListenerAggregate;
10-
use Zend\EventManager\EventManagerInterface;
11-
use Zend\Http\PhpEnvironment\Response;
12-
use Zend\Mvc\MvcEvent;
13-
use Zend\Router\RouteMatch;
8+
use Laminas\Console\Console;
9+
use Laminas\EventManager\AbstractListenerAggregate;
10+
use Laminas\EventManager\EventManagerInterface;
11+
use Laminas\Http\PhpEnvironment\Response;
12+
use Laminas\Mvc\MvcEvent;
13+
use Laminas\Router\RouteMatch;
1414

1515
class ForceHttps extends AbstractListenerAggregate
1616
{
@@ -65,7 +65,7 @@ private function setHttpStrictTransportSecurity(
6565
*/
6666
public function forceHttpsScheme(MvcEvent $e) : void
6767
{
68-
/** @var \Zend\Http\PhpEnvironment\Request $request */
68+
/** @var \Laminas\Http\PhpEnvironment\Request $request */
6969
$request = $e->getRequest();
7070
/** @var Response $response */
7171
$response = $e->getResponse();

src/Middleware/ForceHttps.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
use Psr\Http\Message\ServerRequestInterface;
1010
use Psr\Http\Server\MiddlewareInterface;
1111
use Psr\Http\Server\RequestHandlerInterface;
12-
use Zend\Expressive\Router\RouteResult;
13-
use Zend\Expressive\Router\RouterInterface;
12+
use Mezzio\Router\RouteResult;
13+
use Mezzio\Router\RouterInterface;
1414

1515
class ForceHttps implements MiddlewareInterface
1616
{

0 commit comments

Comments
 (0)