File tree 12 files changed +91
-36
lines changed
12 files changed +91
-36
lines changed Original file line number Diff line number Diff line change 10
10
runs-on : ubuntu-20.04
11
11
steps :
12
12
- name : Checkout
13
- uses : actions/checkout@v2
13
+ uses : actions/checkout@v4
14
14
- name : Install PHP
15
15
uses : shivammathur/setup-php@v2
16
16
with :
Original file line number Diff line number Diff line change @@ -10,15 +10,15 @@ jobs:
10
10
runs-on : ubuntu-20.04
11
11
steps :
12
12
- name : Checkout
13
- uses : actions/checkout@v2
13
+ uses : actions/checkout@v4
14
14
- name : Install PHP
15
15
uses : shivammathur/setup-php@v2
16
16
with :
17
17
php-version : " 7.1"
18
18
ini-values : memory_limit=-1
19
19
tools : composer:v2
20
20
- name : Cache dependencies
21
- uses : actions/cache@v2
21
+ uses : actions/cache@v4
22
22
with :
23
23
path : |
24
24
~/.composer/cache
Original file line number Diff line number Diff line change 15
15
- " 7.2"
16
16
- " 7.3"
17
17
- " 7.4"
18
+ - " 8.4"
18
19
steps :
19
20
- name : Checkout
20
- uses : actions/checkout@v2
21
+ uses : actions/checkout@v4
21
22
- name : Install PHP
22
23
uses : shivammathur/setup-php@v2
23
24
with :
26
27
ini-values : memory_limit=-1
27
28
tools : composer:v2
28
29
- name : Cache dependencies
29
- uses : actions/cache@v2
30
+ uses : actions/cache@v4
30
31
with :
31
32
path : |
32
33
~/.composer/cache
39
40
40
41
- name : Run PHPUnit
41
42
run : make test-coveralls
43
+ env :
44
+ PHPUNIT_VERSION : " ${{ matrix.php-version == '8.4' && '10' || '07' }}"
42
45
43
46
- name : Upload code coverage
44
47
if : ${{ matrix.php-version == '7.1' }}
Original file line number Diff line number Diff line change
1
+ .phpunit.result.cache
1
2
build
2
3
composer.lock
3
4
vendor
Original file line number Diff line number Diff line change 1
- FROM php:7.1-cli-buster
1
+ ARG PHP_TAG=7.1-cli-buster
2
+ FROM php:${PHP_TAG}
2
3
3
- RUN docker-php-ext-enable opcache && \
4
- docker-php-source delete
4
+ RUN <<-EOF
5
+ docker-php-ext-enable opcache
6
+ EOF
5
7
6
- RUN echo '\
7
- display_errors=On\n \
8
- error_reporting=E_ALL\n \
9
- date.timezone=UTC\n \
10
- ' >> /usr/local/etc/php/conf.d/php.ini
8
+ RUN <<-EOF
9
+ cat <<-SHELL >> /usr/local/etc/php/conf.d/php.ini
10
+ display_errors=On
11
+ error_reporting=E_ALL
12
+ date.timezone=UTC
13
+ SHELL
14
+ EOF
11
15
12
16
ENV COMPOSER_ALLOW_SUPERUSER 1
13
17
14
- RUN apt-get update && \
15
- apt-get install unzip && \
16
- curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet && \
17
- mv composer.phar /usr/local/bin/composer && \
18
- echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"\n ' >> /root/.bashrc
18
+ RUN <<-EOF
19
+ apt-get update
20
+ apt-get install unzip
21
+ curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet
22
+ mv composer.phar /usr/local/bin/composer
23
+ cat <<-SHELL >> /root/.bashrc
24
+ export PATH="$HOME/.composer/vendor/bin:$PATH"
25
+ SHELL
26
+ EOF
19
27
20
28
RUN composer global require squizlabs/php_codesniffer
Original file line number Diff line number Diff line change 1
1
# customization
2
2
3
- PACKAGE_NAME = icanboogie/inflector
4
3
PHPUNIT = vendor/bin/phpunit
5
4
6
5
# do not edit the following lines
@@ -13,24 +12,32 @@ test-dependencies: vendor
13
12
14
13
.PHONY : test
15
14
test : test-dependencies
16
- @$(PHPUNIT )
15
+ @XDEBUG_MODE=none $(PHPUNIT ) --configuration=phpunit10.xml
17
16
18
17
.PHONY : test-coverage
19
18
test-coverage : test-dependencies
20
19
@mkdir -p build/coverage
21
- @$(PHPUNIT ) --coverage-html build/coverage
20
+ @XDEBUG_MODE=coverage $(PHPUNIT ) --coverage-html build/coverage
22
21
23
22
.PHONY : test-coveralls
24
23
test-coveralls : test-dependencies
25
24
@mkdir -p build/logs
26
- @$(PHPUNIT ) --coverage-clover build/logs/clover.xml
25
+ @XDEBUG_MODE=coverage $(PHPUNIT ) --coverage-clover build/logs/clover.xml
27
26
28
27
.PHONY : test-container
29
- test-container :
30
- @docker-compose run --rm app bash
28
+ test-container : test-container-71
29
+
30
+ .PHONY : test-container-71
31
+ test-container-71 :
32
+ @-docker-compose run --rm app71 bash
33
+ @docker-compose down -v
34
+
35
+ .PHONY : test-container-84
36
+ test-container-84 :
37
+ @-docker-compose run --rm app84 bash
31
38
@docker-compose down -v
32
39
33
40
.PHONY : lint
34
41
lint :
35
- @phpcs
36
- @vendor/bin/phpstan
42
+ @XDEBUG_MODE=off phpcs -s
43
+ @XDEBUG_MODE=off vendor/bin/phpstan
Original file line number Diff line number Diff line change 25
25
"ext-mbstring" : " *"
26
26
},
27
27
"require-dev" : {
28
- "icanboogie/common" : " ^2.0 " ,
29
- "phpstan/phpstan" : " ^0.12.92 " ,
30
- "phpunit/phpunit" : " ^7.5"
28
+ "icanboogie/common" : " ^2.1 " ,
29
+ "phpstan/phpstan" : " ^0.12.100|^2.0 " ,
30
+ "phpunit/phpunit" : " ^7.5.20|^10.0 "
31
31
},
32
32
"conflict" : {
33
33
"icanboogie/common" : " <2.0"
Original file line number Diff line number Diff line change 1
1
---
2
- version : " 3.2"
3
2
services :
4
- app :
5
- build : .
3
+ app71 :
4
+ build :
5
+ context : .
6
+ args :
7
+ PHP_TAG : " 7.1-cli-buster"
6
8
environment :
7
9
PHP_IDE_CONFIG : ' serverName=icanboogie-inflector'
8
- volumes :
10
+ PHPUNIT_VERSION : " 07"
11
+ volumes : &vol
9
12
- .:/app:delegated
10
13
- ~/.composer:/root/.composer:delegated
11
14
working_dir : /app
15
+ app84 :
16
+ build :
17
+ context : .
18
+ args :
19
+ PHP_TAG : " 8.4.0RC4-cli-bookworm"
20
+ environment :
21
+ PHP_IDE_CONFIG : ' serverName=icanboogie-inflector'
22
+ PHPUNIT_VERSION : " 10"
23
+ volumes : *vol
24
+ working_dir : /app
Original file line number Diff line number Diff line change 15
15
16
16
class InflectionsNotFound extends LogicException
17
17
{
18
-
19
18
}
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ public static function get(string $locale = self::DEFAULT_LOCALE): self
67
67
*/
68
68
private $ inflections ;
69
69
70
- public function __construct (Inflections $ inflections = null )
70
+ public function __construct (? Inflections $ inflections = null )
71
71
{
72
72
$ this ->inflections = $ inflections ?? new Inflections ();
73
73
}
Original file line number Diff line number Diff line change 5
5
executionOrder =" depends,defects"
6
6
beStrictAboutOutputDuringTests =" true"
7
7
verbose =" true"
8
- colors =" true" >
8
+ colors =" true"
9
+ >
9
10
<testsuites >
10
11
<testsuite name =" icanboogie/inflector" >
11
12
<directory >./tests</directory >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3
+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/10.5/phpunit.xsd"
4
+ beStrictAboutCoverageMetadata =" true"
5
+ beStrictAboutOutputDuringTests =" true"
6
+ bootstrap =" tests/bootstrap.php"
7
+ colors =" true"
8
+ displayDetailsOnTestsThatTriggerDeprecations =" true"
9
+ displayDetailsOnTestsThatTriggerNotices =" true"
10
+ displayDetailsOnTestsThatTriggerWarnings =" true"
11
+ executionOrder =" depends,defects"
12
+ >
13
+ <testsuites >
14
+ <testsuite name =" icanboogie/inflector" >
15
+ <directory >tests</directory >
16
+ </testsuite >
17
+ </testsuites >
18
+ <source >
19
+ <include >
20
+ <directory >lib</directory >
21
+ </include >
22
+ </source >
23
+ </phpunit >
You can’t perform that action at this time.
0 commit comments