Skip to content

Commit

Permalink
Supporting of PHP 8.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
bupy7 committed Dec 30, 2023
1 parent f20e9e3 commit 3d9ce91
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 21 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,26 @@ jobs:
- 8.0
- 8.1
- 8.2
- 8.3
include:
- phpunit: phpunit.xml
- php: 5.6
phpunit: phpunit.legacy.xml
- php: 7.0
phpunit: phpunit.legacy.xml
- php: 7.1
phpunit: phpunit.legacy.xml
- php: 7.2
phpunit: phpunit.legacy.xml
- php: 7.3
phpunit: phpunit.legacy.xml
- php: 7.4
phpunit: phpunit.legacy.xml
- php: 8.0
phpunit: phpunit.legacy.xml

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -34,10 +52,10 @@ jobs:

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -47,7 +65,7 @@ jobs:
run: composer install --no-plugins

- name: Run test suite
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration ${{ matrix.phpunit }}

- name: Upload coverage results to Coveralls
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
/.php-cs-fixer.cache
/docker-compose.yml
/.phpunit.result.cache
/.phpunit.cache
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ php-html-form
- *Dep*: Deprecated.
- *Fix*: Fixed.

2.0.3 [2023-12-30]
------------------

- Add: Supporting of PHP 8.3.

2.0.2 [2022-12-12]
------------------

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ The MIT License (MIT)

Copyright (c) 2016 Adam Wathan <[email protected]>

Copyright (c) 2022 Vasily Belosloodcev <[email protected]>
Copyright (c) 2023 Vasily Belosloodcev <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ You have to install [PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)
don't use build-in Docker image:

```
composer global require friendsofphp/php-cs-fixer "^3.13.0"
composer global require friendsofphp/php-cs-fixer
```

License
Expand Down
2 changes: 1 addition & 1 deletion phpcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* Configuration of code style fixer and checker for this library.
* This configuration compatible with friendsofphp/php-cs-fixer "^3.13.0".
* This configuration compatible with friendsofphp/php-cs-fixer "^3.43.1".
*/

use PhpCsFixer\Finder;
Expand Down
27 changes: 27 additions & 0 deletions phpunit.legacy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
bootstrap="./tests/bootstrap.php"
verbose="true"
colors="true">

<testsuites>
<testsuite name="PHP HTML Form">
<directory>tests</directory>
<exclude>tests/TestCase.php</exclude>
<exclude>tests/bootstrap.php</exclude>
<exclude>tests/InputContractTest.php</exclude>
<exclude>tests/TextSubclassContractTest.php</exclude>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="coverage-html" target="build/coverage"/>
</logging>
</phpunit>
28 changes: 17 additions & 11 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="./tests/bootstrap.php"
verbose="true"
colors="true">
colors="true"
cacheDirectory=".phpunit.cache"
>
<coverage>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage"/>
</report>
</coverage>

<testsuites>
<testsuite name="PHP HTML Form">
Expand All @@ -15,13 +22,12 @@
<exclude>tests/TextSubclassContractTest.php</exclude>
</testsuite>
</testsuites>
<filter>
<whitelist>

<logging/>

<source>
<include>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="coverage-html" target="build/coverage"/>
</logging>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion tests/FormBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function testButton($value, $name, $expected)
$this->assertEquals($expected, $result);
}

public function buttonProvider()
public static function buttonProvider()
{
return [
['Click Me', 'click-me', '<button type="button" name="click-me">Click Me</button>'],
Expand Down
4 changes: 2 additions & 2 deletions workenv/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.2-cli-alpine
FROM php:8.3-cli-alpine

RUN apk add --no-cache $PHPIZE_DEPS && apk add --update --no-cache linux-headers

Expand All @@ -13,6 +13,6 @@ RUN if [ ${GITHUB_OAUTH_TOKEN} != false ]; then \
;fi
RUN export COMPOSER_DISABLE_XDEBUG_WARN=1

RUN composer global require friendsofphp/php-cs-fixer "^3.13.0"
RUN composer global require friendsofphp/php-cs-fixer "^3.43.1"

CMD ["php", "-a"]

0 comments on commit 3d9ce91

Please sign in to comment.