Skip to content

Commit f4be120

Browse files
authored
Merge pull request #110 from t0mmy742/psr12
PSR-12 + fully-qualified function calls
2 parents 9c597e8 + cb10cf4 commit f4be120

29 files changed

Lines changed: 139 additions & 22 deletions

.travis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
language: php
22

3-
dist: trusty
4-
53
matrix:
64
include:
75
- php: 7.2
@@ -17,10 +15,10 @@ before_script:
1715
- composer install -n
1816

1917
script:
18+
- if [[ "$ANALYSIS" != 'true' ]]; then vendor/bin/phpunit ; fi
2019
- if [[ "$ANALYSIS" == 'true' ]]; then vendor/bin/phpunit --coverage-clover clover.xml ; fi
21-
- vendor/bin/phpunit
22-
- vendor/bin/phpcs
23-
- vendor/bin/phpstan analyse src
20+
- if [[ "$ANALYSIS" == 'true' ]]; then vendor/bin/phpcs ; fi
21+
- if [[ "$ANALYSIS" == 'true' ]]; then vendor/bin/phpstan analyse src ; fi
2422

2523
after_success:
2624
- if [[ "$ANALYSIS" == 'true' ]]; then vendor/bin/php-coveralls --coverage_clover=clover.xml -v ; fi

composer.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,22 @@
2828
}
2929
],
3030
"require": {
31+
"php": "^7.2",
32+
"ext-SimpleXML": "*",
3133
"ext-fileinfo": "*",
3234
"ext-json": "*",
3335
"ext-libxml": "*",
34-
"ext-SimpleXML": "*",
35-
"php": "^7.2",
3636
"psr/http-factory": "^1.0",
3737
"psr/http-message": "^1.0"
3838
},
3939
"require-dev": {
40+
"adriansuter/php-autoload-override": "v0.1-beta",
41+
"laminas/laminas-diactoros": "^2.0",
4042
"nyholm/psr7": "^1.0",
43+
"php-http/psr7-integration-tests": "dev-master",
4144
"phpstan/phpstan": "^0.10.3",
4245
"phpunit/phpunit": "^8.5",
43-
"php-http/psr7-integration-tests": "dev-master",
44-
"squizlabs/php_codesniffer": "^3.3.2",
45-
"laminas/laminas-diactoros": "^2.0"
46+
"squizlabs/php_codesniffer": "^3.5"
4647
},
4748
"provide": {
4849
"psr/http-factory": "^1.0"
@@ -66,5 +67,8 @@
6667
"phpunit": "phpunit",
6768
"phpcs": "phpcs",
6869
"phpstan": "phpstan analyse src --memory-limit=-1"
69-
}
70+
},
71+
"config": {
72+
"sort-packages": true
73+
}
7074
}

phpcs.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
<arg name="colors"/>
99

1010
<!-- inherit rules from: -->
11-
<rule ref="PSR2"/>
11+
<rule ref="PSR12"/>
1212
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
1313

1414
<!-- Paths to check -->
1515
<file>src</file>
1616
<file>tests</file>
17-
</ruleset>
17+
</ruleset>

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.1/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/8.5/phpunit.xsd"
44
colors="true"
55
bootstrap="tests/bootstrap.php"
66
>

src/Factory/DecoratedResponseFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Slim Framework (https://slimframework.com)
45
*

src/Factory/DecoratedServerRequestFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Slim Framework (https://slimframework.com)
45
*

src/Factory/DecoratedUriFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Slim Framework (https://slimframework.com)
45
*

src/Response.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Slim Framework (https://slimframework.com)
45
*
@@ -15,6 +16,24 @@
1516
use Psr\Http\Message\StreamInterface;
1617
use RuntimeException;
1718

19+
use function basename;
20+
use function in_array;
21+
use function is_array;
22+
use function is_resource;
23+
use function is_string;
24+
use function json_encode;
25+
use function json_last_error;
26+
use function json_last_error_msg;
27+
use function mime_content_type;
28+
use function preg_replace;
29+
use function rawurlencode;
30+
use function sprintf;
31+
use function stream_get_meta_data;
32+
use function strlen;
33+
use function substr;
34+
35+
use const JSON_ERROR_NONE;
36+
1837
class Response implements ResponseInterface
1938
{
2039
/**
@@ -32,7 +51,7 @@ class Response implements ResponseInterface
3251
*
3352
* @var string
3453
*/
35-
const EOL = "\r\n";
54+
public const EOL = "\r\n";
3655

3756
/**
3857
* @param ResponseInterface $response

src/ServerRequest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Slim Framework (https://slimframework.com)
45
*
@@ -15,6 +16,22 @@
1516
use Psr\Http\Message\UriInterface;
1617
use RuntimeException;
1718

19+
use function array_merge;
20+
use function count;
21+
use function explode;
22+
use function is_array;
23+
use function is_null;
24+
use function is_object;
25+
use function json_decode;
26+
use function libxml_clear_errors;
27+
use function libxml_disable_entity_loader;
28+
use function libxml_use_internal_errors;
29+
use function parse_str;
30+
use function preg_split;
31+
use function property_exists;
32+
use function simplexml_load_string;
33+
use function strtolower;
34+
1835
class ServerRequest implements ServerRequestInterface
1936
{
2037
/**

src/Uri.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Slim Framework (https://slimframework.com)
45
*

0 commit comments

Comments
 (0)