Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 8 additions & 19 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.2']
php: ['8.3']
setup: ['stable']

name: PHP

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -30,28 +30,19 @@ jobs:

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.setup }}-coverage-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.setup }}-coverage-${{ matrix.php }}-

- name: Code Climate Test Reporter Preparation
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer config version 1.9.0
${{ matrix.php >= 8 && matrix.php < 8.2 && 'composer require --no-update phpunit/phpunit:^8.5.33 phpunit/php-file-iterator:^2.0.5 --dev --no-interaction;' || '' }}
${{ matrix.php >= 8.2 && 'composer require --no-update phpunit/phpunit:^9.6.12 phpunit/php-file-iterator:^3.0.6 --dev --dev --no-interaction;' || '' }}
composer update --prefer-dist ${{ matrix.setup != 'next' && format('--prefer-{0}', matrix.setup) || '' }} --no-progress
composer update --prefer-dist ${{ matrix.setup != 'next' && format('--prefer-{0}', matrix.setup) || '' }} --no-progress ${{ matrix.php < 8 && matrix.setup == 'lowest' && '--no-security-blocking' || '' }}

- name: Run test suite
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml
Expand All @@ -60,9 +51,7 @@ jobs:
uses: codecov/codecov-action@v3

- name: Code Climate Test Reporter
if: ${{ env.CC_TEST_REPORTER_ID != '' }}
run: |
cp coverage.xml clover.xml
bash <(curl -s https://codecov.io/bash)
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
uses: qltysh/qlty-action/coverage@v2
with:
token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
files: clover.xml
9 changes: 4 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
setup: ['lowest', 'stable', 'next']

name: PHP ${{ matrix.php }} - ${{ matrix.setup }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -29,7 +29,7 @@ jobs:

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v5
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.setup }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
Expand All @@ -39,10 +39,9 @@ jobs:
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer config version 1.9.0
${{ matrix.php >= 7.2 && matrix.php < 8 && matrix.setup == 'lowest' && 'composer require --no-update "phpunit/phpunit:^5.7.27||^6.5.14||^7.5.20" --dev --no-interaction;' || '' }}
${{ matrix.php >= 8 && 'composer require --no-update phpunit/phpunit:^8.5.33 phpunit/php-file-iterator:^2.0.5 --dev --no-interaction && composer require --no-update phug/phug:^1.9.0 --no-interaction;' || '' }}
composer update --prefer-dist ${{ matrix.setup != 'next' && format('--prefer-{0}', matrix.setup) || '' }} --no-progress ${{ matrix.php >= 8.1 && '--ignore-platform-req=php' || '' }} --no-interaction
composer update --prefer-dist ${{ matrix.setup != 'next' && format('--prefer-{0}', matrix.setup) || '' }} --no-progress ${{ matrix.php >= 8.1 && '--ignore-platform-req=php' || '' }} --no-interaction ${{ matrix.php > 7.2 && matrix.php < 8 && matrix.setup == 'lowest' && '--no-security-blocking' || '' }}
env:
MULTI_TESTER_LABELS: install

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
"prefer-stable": true,
"minimum-stability": "stable",
"require": {
"php": ">=5.5.0",
"php": ">=7.1",
"js-phpize/js-phpize-phug": "^1.1 || ^2.0",
"nodejs-php-fallback/nodejs-php-fallback": "^1.3.1",
"phug/phug": "^1.6",
"phug/phug": "^1.6 || ^2.0.0",
"phug/js-transformer-filter": "^1.0"
},
"extra": {
Expand Down
6 changes: 0 additions & 6 deletions example/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
namespace Pug;

include_once __DIR__ . '/../vendor/autoload.php';
error_reporting(
PHP_VERSION >= 8.2 && !property_exists(Lexer::class, 'disallow')
? (E_ALL & ~E_DEPRECATED)
: E_ALL
);
ini_set('display_errors', 1);

class Application
{
Expand Down
2 changes: 1 addition & 1 deletion src/Pug/AbstractFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
abstract class AbstractFilter extends AbstractFilterBase implements FilterInterface
{
public function __invoke($code, array $options = null)
public function __invoke($code, ?array $options = null)
{
return $this->pugInvoke($code, $options);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Pug/Filter/AbstractFilterBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ abstract class AbstractFilterBase
{
use WrapTagTrait;

public function pugInvoke($code, array $options = null)
public function pugInvoke($code, ?array $options = null)
{
if (method_exists($this, 'parse')) {
$code = $this->parse($code, $options);
Expand Down
2 changes: 1 addition & 1 deletion src/Pug/Filter/Php.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
class Php implements FilterBase
{
public function __invoke($code, array $options = null)
public function __invoke($code, ?array $options = null)
{
return "<?php\n$code\n?>";
}
Expand Down
2 changes: 1 addition & 1 deletion src/Pug/FilterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ interface FilterInterface
*
* @return string
*/
public function __invoke($code, array $options = null);
public function __invoke($code, ?array $options = null);
}
4 changes: 2 additions & 2 deletions tests/lib/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ function get_html_code($name)
function init_tests()
{
error_reporting(
PHP_VERSION >= 8.2 && !property_exists(Lexer::class, 'disallow')
? (E_ALL & ~E_DEPRECATED)
(PHP_VERSION >= 8.2 && !property_exists(Lexer::class, 'disallow')) || PHP_VERSION >= 8.4
? (E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED))
: E_ALL
);
setup_autoload();
Expand Down
Loading