Skip to content

Commit 46f55ef

Browse files
author
Artem Stepin
committed
added tests for php 8.0+
1 parent f69d5dd commit 46f55ef

File tree

6 files changed

+94
-22
lines changed

6 files changed

+94
-22
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_size = 4
8+
indent_style = space
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
trim_trailing_whitespace = false
15+
16+
[*.yml]
17+
indent_size = 2
18+
19+
[*.json]
20+
indent_size = 2

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto eol=lf
3+
4+
.editorconfig export-ignore
5+
.gitattributes export-ignore
6+
.gitignore export-ignore
7+
phpstan.neon export-ignore
8+
phpunit.xml export-ignore
9+
README.md export-ignore
10+
tests/ export-ignore

.github/workflows/tests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ on: [push]
55
jobs:
66
build-test:
77
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
php-versions: ['7.4', '8.0']
811

912
steps:
1013
- uses: actions/checkout@v2
1114
- uses: php-actions/composer@v5
1215
with:
13-
php_version: 7.4
16+
php_version: ${{ matrix.php-versions }}
17+
args: --prefer-stable
1418
- name: PHPUnit tests
1519
uses: php-actions/phpunit@v3
1620
with:
1721
configuration: phpunit.xml
18-
php_version: 7.4
22+
php_version: ${{ matrix.php-versions }}

.php_cs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__);
5+
6+
$header = <<<TXT
7+
Assert
8+
LICENSE
9+
This source file is subject to the MIT license that is bundled
10+
with this package in the file LICENSE.txt.
11+
If you did not receive a copy of the license and are unable to
12+
obtain it through the world-wide-web, please send an email
13+
to stepin.artem@gmail.com so I can send you a copy immediately.
14+
TXT;
15+
16+
$rules = [
17+
'@PSR2' => true,
18+
'@Symfony' => true,
19+
'cast_spaces' => [
20+
'space' => 'none',
21+
],
22+
'concat_space' => [
23+
'spacing' => 'none',
24+
],
25+
'native_function_invocation' => [
26+
'scope' => 'namespaced',
27+
],
28+
'psr4' => true,
29+
'phpdoc_align' => [
30+
'align' => 'left',
31+
],
32+
'array_syntax' => [
33+
'syntax' => 'short',
34+
],
35+
'header_comment' => [
36+
'header' => $header,
37+
'commentType' => PhpCsFixer\Fixer\Comment\HeaderCommentFixer::HEADER_PHPDOC,
38+
],
39+
'yoda_style' => false,
40+
];
41+
42+
$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__;
43+
44+
return PhpCsFixer\Config::create()
45+
->setRiskyAllowed(true)
46+
->setRules($rules)
47+
->setFinder($finder)
48+
->setCacheFile($cacheDir . '/.php_cs.cache');

LICENSE

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
1-
MIT License
1+
Copyright (c) 2020, Artem Stepin
2+
All rights reserved.
23

3-
Copyright (c) 2016 Shawn Tan
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
46

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
7+
- Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
- Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
}
3333
},
3434
"require": {
35-
"php": "^7.4",
35+
"php": "^7.4 || ^8.0",
3636
"ext-curl": "*",
3737
"ext-json": "*",
3838
"psr/http-message": "^1.0",

0 commit comments

Comments
 (0)