Skip to content

Commit

Permalink
⬆️ allow Symfony 7
Browse files Browse the repository at this point in the history
  • Loading branch information
garak committed Dec 28, 2023
1 parent e76e65c commit fc85d26
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 26 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,50 @@ on:

jobs:
phpstan:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
name: PHPStan
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: PHPStan
uses: docker://oskarstark/phpstan-ga
env:
REQUIRE_DEV: true
with:
args: analyse
cs-fixer:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
name: PHP-CS-Fixer
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Fix CS
uses: docker://oskarstark/php-cs-fixer-ga
tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
php:
- '8.0'
- '8.1'
- '8.2'
- '8.3'
include:
- description: 'Symfony 6.0'
- description: 'Symfony 6.4'
php: '8.0'
composer_option: '--prefer-lowest'
- description: 'Symfony 6.1'
php: '8.1'
symfony: 6.1.*
- description: 'Symfony 6.2'
- description: 'Symfony 6.4'
php: '8.2'
symfony: 6.2.*-dev
symfony: 6.4.*
- description: 'Symfony 7.0'
php: '8.3'
symfony: 7.0.*
name: PHP ${{ matrix.php }} tests (${{ matrix.description }})
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: ${{ matrix.php }}-${{ matrix.symfony }}-${{ matrix.composer_option }}
Expand Down
3 changes: 2 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP71Migration:risky' => true,
'@PHP80Migration' => true,
'@PHP80Migration:risky' => true,
'@PHPUnit84Migration:risky' => true,
'declare_strict_types' => false,
'native_function_invocation' => ['include' => ['@all']],
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
"require": {
"php": "^8.0",
"p-chess/chess": "^0.4",
"symfony/config": "^5.4 || ^6.0",
"symfony/dependency-injection": "^5.4 || ^6.0",
"symfony/http-kernel": "^5.4 || ^6.0",
"symfony/routing": "^5.4 || ^6.0",
"symfony/config": "^5.4 || ^6.4 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.4 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.4 || ^7.0",
"symfony/routing": "^5.4 || ^6.4 || ^7.0",
"twig/twig": "^3.0"
},
"require-dev": {
"dg/bypass-finals": "^1.3",
"phpunit/phpunit": "^9.5",
"symfony/phpunit-bridge": "^6.2"
"phpunit/phpunit": "^9.6",
"symfony/phpunit-bridge": "^7.0"
},
"config": {
"sort-packages": true
Expand Down
2 changes: 1 addition & 1 deletion src/ChessProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

interface ChessProviderInterface
{
public function getChess(mixed $identifier = null, ?string $fen = null): Chess;
public function getChess(mixed $identifier = null, string $fen = null): Chess;
}
4 changes: 2 additions & 2 deletions src/HtmlOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract public function getCancelUrl(mixed $identifier = null): string;

abstract public function getPromotionUrl(string $from, string $to, mixed $identifier = null): string;

public function generateLinks(Chess $chess, ?string $from = null, mixed $identifier = null): array
public function generateLinks(Chess $chess, string $from = null, mixed $identifier = null): array
{
$links = [];
$allowedMoves = self::getAllowedMoves($chess, $from);
Expand Down Expand Up @@ -58,7 +58,7 @@ public function generateLinks(Chess $chess, ?string $from = null, mixed $identif
/**
* @return array<string, array<int, string>>
*/
private static function getAllowedMoves(Chess $chess, ?string $from = null): array
private static function getAllowedMoves(Chess $chess, string $from = null): array
{
$moves = $chess->moves($from ? Board::SQUARES[$from] : null);
$return = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Mover.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class Mover
*
* @return array<string, array<int, string>>
*/
public static function getAllowedMoves(Chess $chess, ?string $from = null): array
public static function getAllowedMoves(Chess $chess, string $from = null): array
{
$moves = $chess->moves($from ? Board::SQUARES[$from] : null);
$return = [];
Expand Down
2 changes: 1 addition & 1 deletion src/SessionChessProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function __construct(private RequestStack $requestStack, private string $
{
}

public function getChess(mixed $identifier = null, ?string $fen = null, ?History $history = null): Chess
public function getChess(mixed $identifier = null, string $fen = null, History $history = null): Chess
{
$name = $this->name.$identifier;
$chess = $this->getSession()->has($name) ? $this->getSession()->get($name) : new Chess($fen, $history);
Expand Down
2 changes: 1 addition & 1 deletion src/SimpleChessProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

final class SimpleChessProvider implements ChessProviderInterface
{
public function getChess(mixed $identifier = null, ?string $fen = null): Chess
public function getChess(mixed $identifier = null, string $fen = null): Chess
{
return new Chess($fen);
}
Expand Down

0 comments on commit fc85d26

Please sign in to comment.