Skip to content
This repository has been archived by the owner on Mar 28, 2021. It is now read-only.

Commit

Permalink
Prepare 1.5.0 release
Browse files Browse the repository at this point in the history
- resolve issue #3
- adding PHPStan
- update league\uri-components requirement
- update package settings (travis,scrutinizr)
  • Loading branch information
nyamsprod committed Mar 14, 2018
1 parent 7b13444 commit ae8d49a
Show file tree
Hide file tree
Showing 58 changed files with 272 additions and 201 deletions.
27 changes: 21 additions & 6 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
build:
nodes:
analysis:
project_setup:
override: true
tests:
override:
- php-scrutinizer-run --enable-security-analysis
filter:
paths: [src/*]
excluded_paths: [tests/*]
paths:
- src/
excluded_paths:
- tests/
checks:
php:
code_rating: true
duplication: true
tools:
external_code_coverage:
timeout: 600
timeout: 3600
runs: 2
php_code_coverage: false
php_loc:
enabled: true
excluded_dirs: [tests, vendor]
php_cpd:
excluded_dirs:
- tests/
- vendor/
php_cpd: false
php_sim:
enabled: true
excluded_dirs: [tests, vendor]
filter:
paths: ['src/']
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ sudo: false
matrix:
include:
- php: 7.0
env: COLLECT_COVERAGE=true VALIDATE_CODING_STYLE=true IGNORE_PLATFORMS=false
env: COLLECT_COVERAGE=true VALIDATE_CODING_STYLE=true RUN_PHPSTAN=false IGNORE_PLATFORMS=false
- php: 7.1
env: COLLECT_COVERAGE=true VALIDATE_CODING_STYLE=true IGNORE_PLATFORMS=false
env: COLLECT_COVERAGE=true VALIDATE_CODING_STYLE=true RUN_PHPSTAN=true IGNORE_PLATFORMS=false
- php: 7.2
env: COLLECT_COVERAGE=false VALIDATE_CODING_STYLE=false IGNORE_PLATFORMS=true
env: COLLECT_COVERAGE=false VALIDATE_CODING_STYLE=false RUN_PHPSTAN=false IGNORE_PLATFORMS=false
- php: nightly
env: COLLECT_COVERAGE=false VALIDATE_CODING_STYLE=false IGNORE_PLATFORMS=true
env: COLLECT_COVERAGE=false VALIDATE_CODING_STYLE=false RUN_PHPSTAN=false IGNORE_PLATFORMS=true
allow_failures:
- php: nightly
fast_finish: true
Expand All @@ -29,7 +29,8 @@ install:

script:
- composer phpunit
- if [ "$VALIDATE_CODING_STYLE" == "true" ]; then composer phpcs; fi
- if [ "$RUN_PHPSTAN" == "true" ]; then composer phpstan; fi

after_script:
- if [ "$COLLECT_COVERAGE" == "true" ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/clover.xml; fi
- if [ "$VALIDATE_CODING_STYLE" == "true" ]; then composer phpcs; fi
- if [ "$COLLECT_COVERAGE" == "true" ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/clover.xml; fi
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

- All Notable changes to `uri-manipulations` will be documented in this file

## 1.5.0 - 2018-03-14

### Added

- None

### Fixed

- `League\Uri\Modifiers\Formatter::format` with Opaque URI.
- the library now requires `League\Uri\Components` 1.8.x
- Using PHPStan
- bug fix issue [#3](https://github.com/thephpleague/uri-manipulations/issues/3)

### Deprecated

- None

### Removed

- `mbstring` extension requirement

## 1.4.0 - 2018-02-06

### Added
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ System Requirements
You need:

- **PHP >= 7.0** but the latest stable version of PHP is recommended
- the `mbstring` extension
- the `intl` extension

Dependencies
Expand All @@ -42,7 +41,13 @@ Full documentation can be found at [uri.thephpleague.com](http://uri.thephpleagu
Testing
-------

`League URI Manipulation` has a [PHPUnit](https://phpunit.de) test suite and a coding style compliance test suite using [PHP CS Fixer](http://cs.sensiolabs.org/). To run the tests, run the following command from the project folder.
`League Uri Manipulations` has a :

- a [PHPUnit](https://phpunit.de) test suite
- a coding style compliance test suite using [PHP CS Fixer](http://cs.sensiolabs.org/).
- a code analysis compliance test suite using [PHPStan](https://github.com/phpstan/phpstan).

To run the tests, run the following command from the project folder.

``` bash
$ composer test
Expand Down
29 changes: 22 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,20 @@
},
"minimun-stability" : "dev",
"require": {
"league/uri-components": "^1.7.0",
"league/uri-interfaces": "^1.0",
"php" : ">=7.0",
"ext-intl" : "*",
"league/uri-components": "^1.8.0",
"league/uri-interfaces": "^1.0",
"psr/http-message": "^1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.0",
"guzzlehttp/psr7": "^1.2",
"league/uri-schemes": "^1.0",
"league/uri-schemes": "^1.2",
"phpunit/phpunit": "^6.0",
"phpstan/phpstan": "^0.9.2",
"phpstan/phpstan-strict-rules": "^0.9.0",
"phpstan/phpstan-phpunit": "^0.9.4",
"zendframework/zend-diactoros": "1.4.0"
},
"autoload": {
Expand All @@ -57,15 +61,26 @@
"league/uri-schemes": "Allow manipulating URI objects"
},
"scripts": {
"phpcs": "php-cs-fixer fix -v --diff --dry-run --allow-risky=yes;",
"phpstan-src": "phpstan analyse -l 7 -c phpstan.src.neon src",
"phpstan-tests": "phpstan analyse -l 7 -c phpstan.tests.neon tests",
"phpstan": [
"@phpstan-src",
"@phpstan-tests"
],
"phpunit": "phpunit --coverage-text",
"post-install-cmd": "\\League\\Uri\\Installer\\ICANNSection::update",
"post-update-cmd": "\\League\\Uri\\Installer\\ICANNSection::update",
"test": "phpunit --coverage-text; php-cs-fixer fix -v --diff --dry-run --allow-risky=yes;",
"phpunit": "phpunit --coverage-text",
"phpcs": "php-cs-fixer fix -v --diff --dry-run --allow-risky=yes;"
"test": [
"@phpunit",
"@phpcs",
"@phpstan-src",
"@phpstan-tests"
]
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "1.x-dev"
}
},
"config": {
Expand Down
2 changes: 2 additions & 0 deletions phpstan.src.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
12 changes: 12 additions & 0 deletions phpstan.tests.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
- vendor/phpstan/phpstan-phpunit/strictRules.neon
parameters:
ignoreErrors:
- '#Parameter \#1 \$uri of function League\\Uri\\resolve expects League\\Uri\\Interfaces\\Uri|Psr\\Http\\Message\\UriInterface, string given.#'
- '#Access to an undefined property League\\Uri\\Components\\Query::\$unknownProperty.#'
- '#Parameter \#1 \$offsets of method League\\Uri\\Components\\HierarchicalPath::withoutSegments\(\) expects array<int>, array<int, string> given.#'
- '#Parameter \#2 \$sort of function League\\Uri\\sort_query expects callable|int, array<int, string> given.#'
reportUnmatchedIgnoredErrors: false
2 changes: 1 addition & 1 deletion src/Modifiers/AddBasePath.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/AddLeadingSlash.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/AddRootLabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/AddTrailingSlash.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/AppendLabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/AppendQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/AppendSegment.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/Basename.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/CallableAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/DataUriParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/DataUriToAscii.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/DataUriToBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/DecodeUnreservedCharacters.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/Dirname.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down
12 changes: 6 additions & 6 deletions src/Modifiers/Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/
declare(strict_types=1);
Expand Down Expand Up @@ -139,7 +139,7 @@ public function preserveFragment(bool $status)
* <li>Psr\Http\Message\UriInterface
* </ul>
*
* @param Component|Uri|UriInterface $input
* @param mixed $input
*
* @return string
*/
Expand All @@ -165,7 +165,7 @@ public function __invoke($input)
*
* @see __invoke()
*
* @param Component|Uri|UriInterface $input
* @param mixed $input
*
* @return string
*/
Expand All @@ -177,7 +177,7 @@ public function format($input)
/**
* Format an Uri according to the Formatter properties
*
* @param Uri|UriInterface $uri
* @param LeagueUriInterface|UriInterface $uri
*
* @return string
*/
Expand Down Expand Up @@ -207,13 +207,13 @@ protected function formatUri($uri): string
}

$path = (new Path($uri->getPath()))->getContent($this->enc_type);
if (!in_array('', [$authority, $path]) && '/' != $path[0]) {
if (null !== $authority && '' !== $path && '/' !== $path[0]) {
$path = '/'.$path;
}

$query = $uri->getQuery();
if ('' != $query || $this->preserve_query) {
$query = '?'.Uri\build_query(Uri\parse_query((string) $query), $this->query_separator, $this->enc_type);
$query = '?'.Uri\build_query(Uri\parse_query($query), $this->query_separator, $this->enc_type);
}

$fragment = $uri->getFragment();
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/HostMiddlewareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @copyright 2016 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri-manipulations/blob/master/LICENSE (MIT License)
* @version 1.4.0
* @version 1.5.0
* @link https://github.com/thephpleague/uri-manipulations
*/

Expand Down
Loading

0 comments on commit ae8d49a

Please sign in to comment.