Skip to content

Commit fe8d585

Browse files
authored
Merge pull request #19 from ayanozturk/master
Upgrade dependencies, require PHP 7.1
2 parents b5eecc8 + c10e064 commit fe8d585

71 files changed

Lines changed: 644 additions & 654 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/unittest.yml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Install dependencies
13+
uses: pxgamer/composer-action@master
14+
with:
15+
command: install --optimize-autoloader --prefer-dist
16+
- name: Run unit tests
17+
uses: pxgamer/phpunit-action@master

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/vendor/
22
/coverage/
33
/composer.lock
4+
.phpunit.result.cache

‎.scrutinizer.yml‎

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
checks:
2-
php:
3-
code_rating: true
4-
remove_extra_empty_lines: true
5-
remove_php_closing_tag: true
6-
remove_trailing_whitespace: true
7-
tools:
8-
external_code_coverage:
9-
timeout: 600
10-
runs: 3
11-
php_code_coverage: false
12-
php_code_sniffer:
13-
config:
14-
standard: PSR2
15-
filter:
16-
paths: ['src']
17-
php_loc:
18-
enabled: true
19-
excluded_dirs: [bin, stub, vendor, tests]
20-
php_cpd:
21-
enabled: true
22-
excluded_dirs: [bin, stub, vendor, tests]
1+
build:
2+
environment:
3+
php: 7.2
4+
nodes:
5+
analysis:
6+
tests:
7+
override:
8+
- php-scrutinizer-run
9+
- phpcs-run
10+
- command: vendor/bin/phpunit --coverage-clover 'coverage/clover.xml'
11+
coverage:
12+
file: coverage/clover.xml
13+
format: clover
14+
filter:
15+
paths:
16+
- src/
17+
18+
dependency_paths:
19+
- vendor/
20+
21+
excluded_paths:
22+
- tests/
23+
- stub/

‎.travis.yml‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
language: php
22
php:
3-
- 5.4
4-
- 5.5
5-
- 5.6
6-
- 7.0
7-
- hhvm
8-
matrix:
9-
allow_failures:
10-
- php: 7.0
3+
- 7.1
4+
- 7.2
5+
- 7.3
116
before_script:
127
- travis_retry composer self-update
138
- travis_retry composer update --prefer-lowest
14-
- 'curl -H "Accept: text/plain" https://security.sensiolabs.org/check_lock -F lock=@composer.lock'
159
script:
1610
- vendor/bin/phpcs --report-full --standard=PSR2 src
1711
- mkdir -p build/logs

‎README.md‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
# Phprest
22

3-
[![Author](http://img.shields.io/badge/author-@adammbalogh-blue.svg?style=flat-square)](https://twitter.com/adammbalogh)
4-
[![Build Status](https://img.shields.io/travis/phprest/phprest/master.svg?style=flat-square)](https://travis-ci.org/phprest/phprest)
5-
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/phprest/phprest.svg?style=flat-square)](https://scrutinizer-ci.com/g/phprest/phprest/code-structure)
6-
[![Quality Score](https://img.shields.io/scrutinizer/g/phprest/phprest.svg?style=flat-square)](https://scrutinizer-ci.com/g/phprest/phprest)
3+
[![Build Status](https://travis-ci.com/ayanozturk/phprest.svg?branch=master)](https://travis-ci.com/ayanozturk/phprest)
4+
[![Code Coverage](https://scrutinizer-ci.com/g/ayanozturk/phprest/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/ayanozturk/phprest/?branch=master)
5+
[![Quality Score](https://scrutinizer-ci.com/g/ayanozturk/phprest/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ayanozturk/phprest/?branch=master)
76
[![Software License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE)
8-
[![Packagist Version](https://img.shields.io/packagist/v/phprest/phprest.svg?style=flat-square)](https://packagist.org/packages/phprest/phprest)
9-
[![Total Downloads](https://img.shields.io/packagist/dt/phprest/phprest.svg?style=flat-square)](https://packagist.org/packages/phprest/phprest)
10-
11-
# Game over
12-
13-
This project is not maintained anymore!
147

158
# Description
169

‎composer.json‎

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "phprest/phprest",
3-
"description": "Php Rest Framework.",
2+
"name": "ayanozturk/phprest",
3+
"description": "PHP Rest Framework.",
44
"keywords": ["phprest", "framework", "micro", "rest", "restful", "api"],
55
"license": "MIT",
66
"type": "library",
@@ -10,25 +10,31 @@
1010
"email": "baloghbh@gmail.com",
1111
"homepage": "http://code-chronicle.blogspot.com",
1212
"role": "Developer"
13+
},
14+
{
15+
"name": "Ayan Ozturk",
16+
"email": "ayanozturk@gmail.com",
17+
"homepage": "https://ayanozturk.com",
18+
"role": "Developer"
1319
}
1420
],
1521
"require": {
16-
"php": ">=5.4.0",
17-
"symfony/http-kernel": "~2.5.12|~2.6.8|~2.7",
18-
"league/route": "~1.2.3",
19-
"league/container": "~1.1",
20-
"league/event": "~2.1",
21-
"willdurand/negotiation": "~1.3.4",
22-
"willdurand/hateoas": "~2.3.0",
23-
"stack/builder": "~1.0.3",
24-
"monolog/monolog": "~1.12.0",
25-
"symfony/console": "~2.8.11",
26-
"league/booboo": "~1.0.0"
22+
"php": "^7.2",
23+
"league/booboo": "^1.1",
24+
"league/container": "^1.3",
25+
"league/event": "^2.2",
26+
"league/route": "^1.2",
27+
"monolog/monolog": "^1.12",
28+
"stack/builder": "^1.0",
29+
"symfony/console": "^3.4",
30+
"symfony/http-kernel": "^3.2",
31+
"willdurand/hateoas": "^2.3",
32+
"willdurand/negotiation": "^1.5"
2733
},
2834
"require-dev": {
29-
"phpunit/phpunit": "~4.2.5",
30-
"mockery/mockery": "~0.9.2",
31-
"squizlabs/php_codesniffer": "~2.3.0"
35+
"mockery/mockery": "^1.2",
36+
"phpunit/phpunit": "^8.0",
37+
"squizlabs/php_codesniffer": "^3.4"
3238
},
3339
"bin": ["bin/phprest"],
3440
"autoload": {
@@ -50,5 +56,8 @@
5056
"phprest/phprest-service-request-filter": "For filtering Entites.",
5157
"phprest/phprest-service-validator": "For validating Entities.",
5258
"phprest/phprest-service-orm": "For managing Relational Databases."
59+
},
60+
"config": {
61+
"sort-packages": true
5362
}
5463
}

‎phpcs.xml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="PHPRest">
3+
<description>The coding standard for PHP Rest</description>
4+
5+
<file>./src</file>
6+
7+
<rule ref="PSR2" />
8+
</ruleset>

‎phpunit.xml.dist‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
convertNoticesToExceptions="true"
99
convertWarningsToExceptions="true"
1010
processIsolation="false"
11-
stopOnFailure="false"
12-
syntaxCheck="true">
11+
stopOnFailure="false">
1312
<testsuites>
1413
<testsuite name="Phprest">
1514
<directory>tests/</directory>

‎src/Annotation/Route.php‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Phprest\Annotation;
44

5+
use InvalidArgumentException;
56
use Phprest\Application;
67

78
/**
@@ -29,7 +30,7 @@ class Route
2930
/**
3031
* @param mixed $options
3132
*
32-
* @throws \InvalidArgumentException
33+
* @throws InvalidArgumentException
3334
*/
3435
public function __construct($options)
3536
{
@@ -47,28 +48,28 @@ public function __construct($options)
4748

4849
$this->method = $options['method'];
4950
$this->path = $options['path'];
50-
$this->version = ! is_null($version) ? '{version:' . $version . '}' : '{version:any}';
51+
$this->version = null !== $version ? '{version:' . $version . '}' : '{version:any}';
5152
}
5253

5354
/**
5455
* @param array $options
5556
*
5657
* @return void
5758
*/
58-
protected function validate(array $options)
59+
protected function validate(array $options): void
5960
{
6061
if (! isset($options['method'])) {
61-
throw new \InvalidArgumentException('method property is missing');
62+
throw new InvalidArgumentException('method property is missing');
6263
} elseif (! in_array($options['method'], ['GET', 'POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE', 'HEAD'])) {
63-
throw new \InvalidArgumentException('method property is not valid');
64+
throw new InvalidArgumentException('method property is not valid');
6465
} elseif (! isset($options['path'])) {
65-
throw new \InvalidArgumentException('path property is missing');
66+
throw new InvalidArgumentException('path property is missing');
6667
} elseif (isset($options['since'])
6768
&& ! preg_match('#^' . Application::API_VERSION_REG_EXP . '$#', $options['since'])) {
68-
throw new \InvalidArgumentException('since property is not valid');
69+
throw new InvalidArgumentException('since property is not valid');
6970
} elseif (isset($options['until'])
7071
&& ! preg_match('#^' . Application::API_VERSION_REG_EXP . '$#', $options['until'])) {
71-
throw new \InvalidArgumentException('until property is not valid');
72+
throw new InvalidArgumentException('until property is not valid');
7273
}
7374
}
7475

@@ -120,7 +121,7 @@ protected function getSinceUntilRegExp($sinceVersion, $untilVersion)
120121
*
121122
* @return string
122123
*/
123-
protected function getSinceRegExp($version)
124+
protected function getSinceRegExp($version): string
124125
{
125126
$version = str_pad($version, 3, '.0');
126127

@@ -137,7 +138,7 @@ protected function getSinceRegExp($version)
137138
*
138139
* @return string
139140
*/
140-
protected function getUntilRegExp($version)
141+
protected function getUntilRegExp($version): string
141142
{
142143
$version = str_pad($version, 3, '.0');
143144

0 commit comments

Comments
 (0)