Skip to content

Commit 69fa9ff

Browse files
committed
v1.0
1 parent d8fbe12 commit 69fa9ff

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8-
## [UNRELEASED]
8+
## [1.0.0] - 2018-01-24
99

1010
### Added
1111

@@ -63,7 +63,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
6363

6464
First version
6565

66-
[UNRELEASED]: https://github.com/middlewares/trailing-slash/compare/v0.5.0...HEAD
66+
[1.0.0]: https://github.com/middlewares/trailing-slash/compare/v0.5.0...v1.0.0
6767
[0.5.0]: https://github.com/middlewares/trailing-slash/compare/v0.4.0...v0.5.0
6868
[0.4.0]: https://github.com/middlewares/trailing-slash/compare/v0.3.0...v0.4.0
6969
[0.3.0]: https://github.com/middlewares/trailing-slash/compare/v0.2.0...v0.3.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $response = $dispatcher->dispatch(new ServerRequest());
3636

3737
## Options
3838

39-
#### `__construct(false)`
39+
#### `__construct(booll $trailingSlash = false)`
4040

4141
Set `true` to add the slash instead remove so, for example, `post/23` is converted to `/post/23/`. Note that if the path contains an extension, the slash is **NOT** added. For example, `images/image.png` remains the same, instead be converted to `images/image.png/`.
4242

tests/TrailingSlashTest.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace Middlewares\Tests;
45

@@ -9,7 +10,7 @@
910

1011
class TrailingSlashTest extends TestCase
1112
{
12-
public function removeProvider()
13+
public function removeProvider(): array
1314
{
1415
return [
1516
['/foo/bar', '/foo/bar'],
@@ -21,10 +22,8 @@ public function removeProvider()
2122

2223
/**
2324
* @dataProvider removeProvider
24-
* @param mixed $uri
25-
* @param mixed $result
2625
*/
27-
public function testRemove($uri, $result)
26+
public function testRemove(string $uri, string $result)
2827
{
2928
$request = Factory::createServerRequest([], 'GET', $uri);
3029

@@ -36,11 +35,10 @@ function ($request, $next) {
3635
},
3736
], $request);
3837

39-
$this->assertInstanceOf('Psr\\Http\\Message\\ResponseInterface', $response);
4038
$this->assertEquals($result, (string) $response->getBody());
4139
}
4240

43-
public function addProvider()
41+
public function addProvider(): array
4442
{
4543
return [
4644
['/foo/bar', '/foo/bar/'],
@@ -54,10 +52,8 @@ public function addProvider()
5452

5553
/**
5654
* @dataProvider addProvider
57-
* @param mixed $uri
58-
* @param mixed $result
5955
*/
60-
public function testAdd($uri, $result)
56+
public function testAdd(string $uri, string $result)
6157
{
6258
$request = Factory::createServerRequest([], 'GET', $uri);
6359

@@ -69,7 +65,6 @@ function ($request, $next) {
6965
},
7066
], $request);
7167

72-
$this->assertInstanceOf('Psr\\Http\\Message\\ResponseInterface', $response);
7368
$this->assertEquals($result, (string) $response->getBody());
7469
}
7570

@@ -81,7 +76,6 @@ public function testRedirect()
8176
(new TrailingSlash())->redirect(),
8277
], $request);
8378

84-
$this->assertInstanceOf('Psr\\Http\\Message\\ResponseInterface', $response);
8579
$this->assertEquals(301, (string) $response->getStatusCode());
8680
$this->assertEquals('/foo/bar', $response->getHeaderLine('location'));
8781
}

0 commit comments

Comments
 (0)