Skip to content

Commit

Permalink
php 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikzogg committed Dec 2, 2021
1 parent 38932cd commit b9dd1d8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ jobs:
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
php81:
name: PHP 8.1
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2
- name: composer test
uses: docker://chubbyphp/ci-php81:latest
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
- name: sonarcloud.io
uses: sonarsource/sonarcloud-github-action@master
env:
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
"chubbyphp/chubbyphp-dev-helper": "dev-master",
"chubbyphp/chubbyphp-laminas-config-factory": "^1.0",
"chubbyphp/chubbyphp-laminas-config": "^1.0",
"chubbyphp/chubbyphp-mock": "^1.6",
"infection/infection": "^0.25.2",
"php-coveralls/php-coveralls": "^2.4.3",
"chubbyphp/chubbyphp-mock": "^1.6.1",
"infection/infection": "^0.25.3",
"php-coveralls/php-coveralls": "^2.5.1",
"phploc/phploc": "^7.0.2",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^0.12.99",
"phpstan/phpstan": "^1.1.2",
"phpunit/phpunit": "^9.5.10"
},
"autoload": {
Expand All @@ -42,7 +42,7 @@
}
},
"scripts": {
"fix:cs": "mkdir -p build && vendor/bin/php-cs-fixer fix --cache-file=build/phpcs.cache",
"fix:cs": "mkdir -p build && PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --cache-file=build/phpcs.cache",
"test": [
"@test:lint",
"@test:unit",
Expand All @@ -52,7 +52,7 @@
"@test:loc",
"@test:cs"
],
"test:cs": "mkdir -p build && vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --cache-file=build/phpcs.cache",
"test:cs": "mkdir -p build && PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --cache-file=build/phpcs.cache",
"test:infection": "vendor/bin/infection --threads=$(nproc) --min-msi=100 --verbose --coverage=build/phpunit",
"test:integration": "vendor/bin/phpunit --testsuite=Integration --cache-result-file=build/phpunit/result.cache",
"test:lint": "mkdir -p build && find src tests -name '*.php' -print0 | xargs -0 -n1 -P$(nproc) php -l | tee build/phplint.log",
Expand Down
5 changes: 4 additions & 1 deletion src/ServiceFactory/OriginNegotiatorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Chubbyphp\Cors\ServiceFactory;

use Chubbyphp\Cors\Negotiation\Origin\AllowOriginInterface;
use Chubbyphp\Cors\Negotiation\Origin\OriginNegotiator;
use Chubbyphp\Laminas\Config\Factory\AbstractFactory;
use Psr\Container\ContainerInterface;
Expand All @@ -16,7 +17,9 @@ public function __invoke(ContainerInterface $container): OriginNegotiator

$allowOrigins = [];
foreach ($config['allowOrigins'] ?? [] as $allowOrigin => $class) {
$allowOrigins[] = new $class($allowOrigin);
/** @var AllowOriginInterface $allowOrigin */
$allowOrigin = new $class($allowOrigin);
$allowOrigins[] = $allowOrigin;
}

return new OriginNegotiator($allowOrigins);
Expand Down

0 comments on commit b9dd1d8

Please sign in to comment.