Skip to content

Commit

Permalink
Merge pull request #66 from koriym/php8.2_support
Browse files Browse the repository at this point in the history
Enable PHP 8.2 compat
  • Loading branch information
koriym authored Dec 13, 2022
2 parents c422d0d + 845e6dc commit dd0a6ec
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 79 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Continuous Integration

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
operating-system:
- ubuntu-latest
- windows-latest
- macOS-latest
php-version:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
tools: composer:2.2

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Run test suite
run: php -d xdebug.mode=coverage ./vendor/bin/phpunit --coverage-clover=coverage.xml

- name: Upload coverage report
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: false
50 changes: 0 additions & 50 deletions .github/workflows/php.yml

This file was deleted.

14 changes: 6 additions & 8 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
filter:
paths: ["src/*"]
tools:
external_code_coverage: true
php_code_coverage: true
php_sim: true
php_mess_detector: true
php_pdepend: true
php_analyzer: true
php_cpd: true
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2011-2021, Aura for PHP
Copyright (c) 2011-2022, Aura for PHP
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
comment: false
8 changes: 4 additions & 4 deletions src/Context/GetoptParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ protected function setLongOptionValue($input)
$option = $this->getOption($name);

if ($this->longOptionRequiresValue($option, $value)) {
$value = array_shift($this->input);
$value = (string) array_shift($this->input);
}

return $this->longOptionRequiresValue($option, $value, $name)
Expand All @@ -249,12 +249,12 @@ protected function splitLongOptionInput($input)
$pos = strpos($input, '=');
if ($pos === false) {
$name = $input;
$value = null;
$value = '';
} else {
$name = substr($input, 0, $pos);
$value = substr($input, $pos + 1);
}
return array($name, $value);
return array($name, (string) $value);
}

/**
Expand All @@ -263,7 +263,7 @@ protected function splitLongOptionInput($input)
*
* @param StdClass $option An option struct.
*
* @param mixed $value The option value.
* @param string $value The option value.
*
* @param string $name The option name as passed.
*
Expand Down

0 comments on commit dd0a6ec

Please sign in to comment.