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
2 changes: 2 additions & 0 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ runs:
run: |
composer require --quiet --no-update "symfony/console:${{ inputs.symfony-version }}"
composer require --quiet --no-update "symfony/framework-bundle:${{ inputs.symfony-version }}"
composer require --quiet --no-update "symfony/routing:${{ inputs.symfony-version }}"
composer require --quiet --no-update "symfony/messenger:${{ inputs.symfony-version }}"
composer require --quiet --no-update "symfony/process:${{ inputs.symfony-version }}"
composer require --quiet --no-update "symfony/serializer:${{ inputs.symfony-version }}"
composer require --quiet --no-update "symfony/property-info:${{ inputs.symfony-version }}"
composer require --quiet --no-update "symfony/validator:${{ inputs.symfony-version }}"
composer require --quiet --no-update "symfony/filesystem:${{ inputs.symfony-version }}" --dev
composer require --quiet --no-update "symfony/finder:${{ inputs.symfony-version }}" --dev
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
- php-version: '8.4'
symfony-version: '6.4.*'
- php-version: '8.2'
symfony-version: '7.3.*'
symfony-version: '7.4.*'
- php-version: '8.4'
symfony-version: '7.3.*'
symfony-version: '7.4.*'
steps:
- name: "Checkout"
uses: actions/checkout@v2
Expand All @@ -42,7 +42,7 @@ jobs:
uses: ./.github/actions/install
with:
php-version: '8.4'
symfony-version: '7.3.*'
symfony-version: '7.4.*'
- name: "Run static analyzis with phpstan/phpstan"
run: vendor/bin/phpstan analyze

Expand All @@ -56,7 +56,7 @@ jobs:
uses: ./.github/actions/install
with:
php-version: '8.4'
symfony-version: '7.3.*'
symfony-version: '7.4.*'
- name: "Run checkstyle with symplify/easy-coding-standard"
run: vendor/bin/ecs

Expand All @@ -70,7 +70,7 @@ jobs:
uses: ./.github/actions/install
with:
php-version: '8.4'
symfony-version: '7.3.*'
symfony-version: '7.4.*'
- name: "Run tests with phpunit/phpunit"
run: vendor/bin/phpunit --testsuite=Convention

Expand All @@ -85,7 +85,7 @@ jobs:
uses: ./.github/actions/install
with:
php-version: '8.4'
symfony-version: '7.3.*'
symfony-version: '7.4.*'
coverage-mode: 'xdebug'
- name: "Run tests with phpunit/phpunit"
run: |
Expand Down
16 changes: 13 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
services:
php84:
container_name: yokai-batch-php84
extends:
file: $HOME/.led/docker-base.yaml
service: localuser
hostname: php84
image: ledup/php:8.4-rl9
volumes:
- .:/src
working_dir: /src
php83:
container_name: yokai-batch-php83
extends:
file: $HOME/.led/docker-base.yaml
service: localuser
hostname: php83
image: ledup/php:8.3
image: ledup/php:8.3-rl9
volumes:
- .:/src
working_dir: /src
Expand All @@ -15,7 +25,7 @@ services:
file: $HOME/.led/docker-base.yaml
service: localuser
hostname: php82
image: ledup/php:8.2
image: ledup/php:8.2-rl9
volumes:
- .:/src
working_dir: /src
Expand All @@ -25,7 +35,7 @@ services:
file: $HOME/.led/docker-base.yaml
service: localuser
hostname: php81
image: ledup/php:8.1
image: ledup/php:8.1-rl9
volumes:
- .:/src
working_dir: /src
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,6 @@ parameters:
count: 1
path: src/batch-openspout/src/Writer/FlatFileWriter.php

-
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#"
count: 1
path: src/batch-symfony-framework/src/DependencyInjection/Configuration.php

-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
count: 3
Expand Down
5 changes: 0 additions & 5 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,3 @@ parameters:
- src/batch-symfony-messenger/src/
- src/batch-symfony-serializer/src/
- src/batch-symfony-validator/src/

ignoreErrors:
# The DependencyInjection returns are complex to deal with
- message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface\:\:#'
path: ./src/batch-symfony-framework/src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Symfony\Component\Routing\Generator\UrlGenerator;
use Symfony\Component\Routing\Loader\XmlFileLoader;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Security\Core\Authorization\AccessDecision;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Csrf\CsrfTokenManager;
Expand Down Expand Up @@ -418,8 +419,11 @@ public function __construct(private bool $granted)
{
}

public function isGranted(mixed $attribute, mixed $subject = null): bool
{
public function isGranted(
mixed $attribute,
mixed $subject = null,
AccessDecision|null $accessDecision = null,
): bool {
return $this->granted;
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Yokai\Batch\Tests\Bridge\Symfony\Framework\UserInterface;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Authorization\AccessDecision;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Yokai\Batch\Bridge\Symfony\Framework\UserInterface\JobSecurity;
Expand Down Expand Up @@ -39,8 +40,11 @@ public function __construct(private array $attributes)
{
}

public function isGranted(mixed $attribute, mixed $subject = null): bool
{
public function isGranted(
mixed $attribute,
mixed $subject = null,
AccessDecision|null $accessDecision = null,
): bool {
return \in_array($attribute, $this->attributes, true)
&& ($subject === null || $subject instanceof JobExecution);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Yokai\Batch\Tests\Bridge\Symfony\Framework\UserInterface;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Authorization\AccessDecision;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Twig\Environment;
use Twig\Loader\ArrayLoader;
Expand Down Expand Up @@ -44,8 +45,11 @@ public function __construct(private bool $granted)
{
}

public function isGranted(mixed $attribute, mixed $subject = null): bool
{
public function isGranted(
mixed $attribute,
mixed $subject = null,
AccessDecision|null $accessDecision = null,
): bool {
return $this->granted;
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use PHPUnit\Framework\TestCase;
use Symfony\Component\Uid\Factory\UuidFactory;
use Symfony\Component\Uid\UuidV6;
use Symfony\Component\Uid\UuidV7;
use Yokai\Batch\Bridge\Symfony\Uid\Factory\TimeBasedUuidJobExecutionIdGenerator;

final class TimeBasedUuidJobExecutionIdGeneratorTest extends TestCase
Expand All @@ -15,6 +16,6 @@ public function testGenerate(): void
{
$id = (new TimeBasedUuidJobExecutionIdGenerator(new UuidFactory()))->generate();

self::assertTrue(UuidV6::isValid($id));
self::assertTrue(UuidV7::isValid($id) || UuidV6::isValid($id));
}
}
Loading