Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit 8649d2d

Browse files
committed
Add PHP 8.0
Remove PHP 7.0, 7.1, 7.2
1 parent 5c06967 commit 8649d2d

File tree

13 files changed

+161
-155
lines changed

13 files changed

+161
-155
lines changed

.cs.php

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,48 @@
11
<?php
22

3-
return PhpCsFixer\Config::create()
3+
return (new PhpCsFixer\Config())
44
->setUsingCache(false)
55
->setRiskyAllowed(true)
66
//->setCacheFile(__DIR__ . '/.php_cs.cache')
7-
->setRules([
8-
'@PSR1' => true,
9-
'@PSR2' => true,
10-
'@Symfony' => true,
11-
'psr4' => true,
12-
'yoda_style' => false,
13-
'array_syntax' => ['syntax' => 'short'],
14-
'list_syntax' => ['syntax' => 'short'],
15-
'concat_space' => ['spacing' => 'one'],
16-
'cast_spaces' => ['space' => 'none'],
17-
'compact_nullable_typehint' => true,
18-
'increment_style' => ['style' => 'post'],
19-
'declare_equal_normalize' => ['space' => 'single'],
20-
'no_short_echo_tag' => true,
21-
'protected_to_private' => false,
22-
'phpdoc_align' => false,
23-
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
24-
'phpdoc_order' => true, // psr-5
25-
'phpdoc_no_empty_return' => false,
26-
'align_multiline_comment' => true, // psr-5
27-
'general_phpdoc_annotation_remove' => [
28-
'annotations' => [
29-
'author',
30-
'package',
7+
->setRules(
8+
[
9+
'@PSR1' => true,
10+
'@PSR2' => true,
11+
'@Symfony' => true,
12+
'psr4' => true,
13+
// custom rules
14+
'align_multiline_comment' => ['comment_type' => 'phpdocs_only'], // psr-5
15+
'phpdoc_to_comment' => false,
16+
'no_superfluous_phpdoc_tags' => false,
17+
'array_indentation' => true,
18+
'array_syntax' => ['syntax' => 'short'],
19+
'cast_spaces' => ['space' => 'none'],
20+
'concat_space' => ['spacing' => 'one'],
21+
'compact_nullable_typehint' => true,
22+
'declare_equal_normalize' => ['space' => 'single'],
23+
'increment_style' => ['style' => 'post'],
24+
'list_syntax' => ['syntax' => 'short'],
25+
'no_short_echo_tag' => true,
26+
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
27+
'phpdoc_align' => false,
28+
'phpdoc_no_empty_return' => false,
29+
'phpdoc_order' => true, // psr-5
30+
'phpdoc_no_useless_inheritdoc' => false,
31+
'protected_to_private' => false,
32+
'yoda_style' => false,
33+
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
34+
'ordered_imports' => [
35+
'sort_algorithm' => 'alpha',
36+
'imports_order' => ['class', 'const', 'function']
3137
],
32-
],
33-
])
34-
->setFinder(PhpCsFixer\Finder::create()
35-
->in(__DIR__ . '/src')
36-
->in(__DIR__ . '/tests')
37-
->name('*.php')
38-
->ignoreDotFiles(true)
39-
->ignoreVCS(true));
38+
'single_line_throw' => false,
39+
]
40+
)
41+
->setFinder(
42+
PhpCsFixer\Finder::create()
43+
->in(__DIR__ . '/src')
44+
->in(__DIR__ . '/tests')
45+
->name('*.php')
46+
->ignoreDotFiles(true)
47+
->ignoreVCS(true)
48+
);

.github/workflows/build.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
run:
7+
runs-on: ${{ matrix.operating-system }}
8+
strategy:
9+
matrix:
10+
operating-system: [ubuntu-latest]
11+
php-versions: ['7.3', '7.4', '8.0']
12+
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v1
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php-versions }}
22+
extensions: mbstring, intl, zip
23+
coverage: none
24+
25+
- name: Check PHP Version
26+
run: php -v
27+
28+
- name: Check Composer Version
29+
run: composer -V
30+
31+
- name: Check PHP Extensions
32+
run: php -m
33+
34+
- name: Validate composer.json and composer.lock
35+
run: composer validate
36+
37+
- name: Install dependencies for PHP 7
38+
if: matrix.php-versions < '8.0'
39+
run: composer update --prefer-dist --no-progress
40+
41+
- name: Install dependencies for PHP 8
42+
if: matrix.php-versions >= '8.0'
43+
run: composer update --prefer-dist --no-progress --ignore-platform-reqs
44+
45+
- name: Run test suite
46+
run: composer check
47+
env:
48+
PHP_CS_FIXER_IGNORE_ENV: 1

.github/workflows/php.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.gitignore

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
.idea/
21
composer.lock
2+
.DS_STORE
3+
cache.properties
4+
.php_cs.cache
5+
.vscode
6+
.phpunit.result.cache
7+
8+
.idea/
39
nbproject/
4-
vendor/
510
build/
11+
vendor/

.scrutinizer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ tools:
1414

1515
build:
1616
environment:
17-
php: 7.2
17+
php: 7.4
1818
mysql: false
1919
node: false
2020
postgresql: false
@@ -36,7 +36,7 @@ build:
3636
tests:
3737
before:
3838
-
39-
command: composer test-coverage
39+
command: composer test:coverage
4040
coverage:
4141
file: 'build/logs/clover.xml'
4242
format: 'clover'

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2020 odan
3+
Copyright (c) 2021 odan
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

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

33
Caching and compression for Plates template assets (JavaScript and CSS).
44

5-
[![Latest Version](https://img.shields.io/github/release/odan/plates-asset-cache.svg)](https://github.com/odan/plates-asset-cache/releases)
6-
[![Build Status](https://github.com/odan/plates-asset-cache/workflows/PHP/badge.svg)](https://github.com/odan/plates-asset-cache/actions)
7-
[![Crutinizer](https://img.shields.io/scrutinizer/g/odan/plates-asset-cache.svg)](https://scrutinizer-ci.com/g/odan/plates-asset-cache)
5+
[![Latest Version on Packagist](https://img.shields.io/github/release/odan/plates-asset-cache.svg)](https://github.com/odan/plates-asset-cache/releases)
6+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)
7+
[![Build Status](https://github.com/odan/plates-asset-cache/workflows/build/badge.svg)](https://github.com/odan/plates-asset-cache/actions)
88
[![Code Coverage](https://scrutinizer-ci.com/g/odan/plates-asset-cache/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/odan/plates-asset-cache/code-structure)
9+
[![Quality Score](https://scrutinizer-ci.com/g/odan/plates-asset-cache/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/odan/plates-asset-cache/?branch=master)
910
[![Total Downloads](https://img.shields.io/packagist/dt/odan/plates-asset-cache.svg)](https://packagist.org/packages/odan/plates-asset-cache/stats)
10-
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)
1111

1212

1313
## Installation
@@ -18,7 +18,7 @@ composer require odan/plates-asset-cache
1818

1919
## Requirements
2020

21-
* PHP 7.0+
21+
* PHP 7.3+ or 8.0+
2222

2323
## Configuration
2424

@@ -183,4 +183,4 @@ return $response;
183183

184184
## License
185185

186-
* MIT
186+
The MIT License (MIT). Please see [License File](LICENSE) for more information.

composer.json

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,44 +19,45 @@
1919
}
2020
],
2121
"require": {
22-
"php": "^7.0",
23-
"symfony/cache": "^3.2|^4",
24-
"tubalmartin/cssmin": "^4.1",
25-
"mrclay/jsmin-php": "^2.4"
22+
"php": "^7.3 || ^8.0",
23+
"symfony/cache": "^5",
24+
"tubalmartin/cssmin": "^4",
25+
"mrclay/jsmin-php": "^2"
2626
},
2727
"require-dev": {
2828
"league/plates": "3.*",
29-
"mikey179/vfsstream": "^1.6",
30-
"overtrue/phplint": "^1.1",
31-
"phpunit/phpunit": "^7.0|^6.0",
32-
"phpstan/phpstan": "*",
33-
"squizlabs/php_codesniffer": "^3.4"
29+
"friendsofphp/php-cs-fixer": "^2",
30+
"overtrue/phplint": "^2",
31+
"phpstan/phpstan": "0.*",
32+
"phpunit/phpunit": "^9",
33+
"squizlabs/php_codesniffer": "^3",
34+
"mikey179/vfsstream": "^1"
3435
},
3536
"scripts": {
36-
"test": "phpunit --configuration phpunit.xml",
37-
"test-coverage": "phpunit --configuration phpunit.xml --coverage-clover build/logs/clover.xml --coverage-html build/coverage",
38-
"check-style": "phpcs --standard=phpcs.xml",
39-
"fix-style": "phpcbf --standard=phpcs.xml",
40-
"phpstan": "phpstan analyse src tests --level=max -c phpstan.neon --no-progress",
41-
"lint": "phplint ./ --exclude=vendor --no-interaction --no-cache",
42-
"install-cs": "php -r \"@mkdir('build'); copy('https://cs.symfony.com/download/php-cs-fixer-v2.phar', 'build/php-cs-fixer-v2.phar');\"",
43-
"fix-cs": "php build/php-cs-fixer-v2.phar fix --config=.cs.php",
44-
"check-cs": "php build/php-cs-fixer-v2.phar fix --dry-run --format=txt --verbose --diff --diff-format=udiff --config=.cs.php",
45-
"check-all": [
37+
"check": [
4638
"@lint",
47-
"@check-style",
39+
"@cs:check",
40+
"@sniffer:check",
4841
"@phpstan",
49-
"@test-coverage"
50-
]
42+
"@test:coverage"
43+
],
44+
"cs:check": "php-cs-fixer fix --dry-run --format=txt --verbose --diff --diff-format=udiff --config=.cs.php",
45+
"cs:fix": "php-cs-fixer fix --config=.cs.php",
46+
"lint": "phplint ./ --exclude=vendor --no-interaction --no-cache",
47+
"phpstan": "phpstan analyse src tests --level=max -c phpstan.neon --no-progress --ansi",
48+
"sniffer:check": "phpcs --standard=phpcs.xml",
49+
"sniffer:fix": "phpcbf --standard=phpcs.xml",
50+
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
51+
"test:coverage": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always --coverage-clover build/logs/clover.xml --coverage-html build/coverage"
5152
},
5253
"autoload": {
5354
"psr-4": {
54-
"Odan\\PlatesAsset\\": "src"
55+
"Odan\\PlatesAsset\\": "src/"
5556
}
5657
},
5758
"autoload-dev": {
5859
"psr-4": {
59-
"Odan\\PlatesAsset\\Test\\": "tests"
60+
"Odan\\PlatesAsset\\Test\\": "tests/"
6061
}
6162
},
6263
"config": {

phpunit.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php" colors="true" backupGlobals="false" backupStaticAttributes="false">
2+
<phpunit bootstrap="vendor/autoload.php"
3+
colors="true"
4+
backupGlobals="false"
5+
backupStaticAttributes="false">
36
<testsuites>
47
<testsuite name="Tests">
58
<directory suffix="Test.php">tests</directory>

0 commit comments

Comments
 (0)