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: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
test:
strategy:
matrix:
php-version: [8.1, 8.2, 8.3, 8.4]
php-version: [8.1, 8.2, 8.3, 8.4, 8.5]
runs-on: ubuntu-22.04
container:
image: fsiopenpl/docker-php-apache:alpine-${{ matrix.php-version }}
Expand Down
55 changes: 29 additions & 26 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"require": {
"php": "^8.1",
"psr/event-dispatcher": "^1.0",
"symfony/event-dispatcher" : "^4.4.30|^5.4|^6.0",
"symfony/property-access": "^4.4.30|^5.4|^6.0",
"symfony/options-resolver": "^5.4|^6.0",
"symfony/event-dispatcher" : "^4.4.30|^5.4|^6.0|^7.0",
"symfony/property-access": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/options-resolver": "^5.4|^6.0|^7.0",
"twig/twig": "^3.9"
},
"require-dev": {
Expand All @@ -26,7 +26,7 @@
"doctrine/orm": "^2.14|^3.0",
"doctrine/persistence": "^2.4|^3.0",
"friendsofsymfony/elastica-bundle": "^6.3",
"fsi/files": "^2.0.2|^3.0@dev",
"fsi/files": "^2.0.2|^3.0",
"gedmo/doctrine-extensions": "^3.5",
"nyholm/psr7": "^1.8",
"oneup/flysystem-bundle": "^4.4",
Expand All @@ -38,28 +38,28 @@
"ruflin/elastica": "^7.2",
"seec/phpunit-consecutive-params": "^1.1.1",
"squizlabs/php_codesniffer": "^3.7",
"symfony/browser-kit": "^4.4.30|^5.4|^6.0",
"symfony/cache": "^4.4.30|^5.4|^6.0",
"symfony/clock": "^6.4",
"symfony/css-selector": "^4.4.30|^5.4|^6.0",
"symfony/config": "^4.4.30|^5.4|^6.0",
"symfony/doctrine-bridge": "^4.4.30|^5.4|^6.0",
"symfony/dom-crawler": "^4.4.30|^5.4|^6.0",
"symfony/dependency-injection": "^4.4.30|^5.4|^6.0",
"symfony/form": "^4.4.30|^5.4|^6.0",
"symfony/finder": "^4.4.30|^5.4|^6.0",
"symfony/framework-bundle": "^4.4.30|^5.4|^6.0",
"symfony/http-client": "^4.4.30|^5.4|^6.0",
"symfony/http-kernel": "^4.4.30|^5.4|^6.0",
"symfony/routing": "^4.4.30|^5.4|^6.0",
"symfony/security-core": "^4.4.30|^5.4|^6.0",
"symfony/security-csrf": "^4.4.30|^5.4|^6.0",
"symfony/translation": "^4.4.30|^5.4|^6.0",
"symfony/twig-bridge": "^4.4.30|^5.4|^6.0",
"symfony/twig-bundle": "^4.4.30|^5.4|^6.0",
"symfony/validator": "^4.4.30|^5.4|^6.0",
"symfony/var-exporter": "^4.4.30|^5.4|^6.0",
"symfony/yaml": "^4.4.30|^5.4|^6.0"
"symfony/browser-kit": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/cache": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/clock": "^6.4|^7.0",
"symfony/css-selector": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/config": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/doctrine-bridge": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/dom-crawler": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/dependency-injection": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/form": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/finder": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/framework-bundle": "^4.4.40|^5.4|^6.0|^7.0",
"symfony/http-client": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/http-kernel": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/routing": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/security-core": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/security-csrf": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/translation": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/twig-bridge": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/twig-bundle": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/validator": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/var-exporter": "^4.4.30|^5.4|^6.0|^7.0",
"symfony/yaml": "^4.4.30|^5.4|^6.0|^7.0"
},
"autoload": {
"psr-4": {
Expand All @@ -71,6 +71,9 @@
"Tests\\FSi\\": "tests"
}
},
"conflict": {
"symfony/property-info": ">=8.0"
},
"config": {
"bin-dir": "vendor/bin",
"allow-plugins": {
Expand Down
2 changes: 1 addition & 1 deletion src/Bundle/DataGridBundle/DataGridBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function build(ContainerBuilder $container): void

public function getContainerExtension(): ?ExtensionInterface
{
if (null === $this->extension) {
if (false === $this->extension instanceof FSIDataGridExtension) {
$this->extension = new FSIDataGridExtension();
}

Expand Down
9 changes: 8 additions & 1 deletion src/Bundle/DataGridBundle/Form/Type/RowType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormTypeInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

final class RowType extends AbstractType
{
/**
* @param FormBuilderInterface<FormBuilderInterface> $builder
* @param array{fields:array<string,array{name:string,type:string,options:array<string,mixed>}>} $options
* @param array{
* fields:array<string,array{
* name:string,
* type:class-string<FormTypeInterface>|null,
* options:array<string,mixed>
* }>
* } $options
*/
public function buildForm(FormBuilderInterface $builder, array $options): void
{
Expand Down
2 changes: 1 addition & 1 deletion src/Bundle/DataSourceBundle/DataSourceBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function build(ContainerBuilder $container): void

public function getContainerExtension(): ?ExtensionInterface
{
if (null === $this->extension) {
if (false === $this->extension instanceof FSIDataSourceExtension) {
$this->extension = new FSIDataSourceExtension();
}

Expand Down
5 changes: 0 additions & 5 deletions tests/Bundle/DataGridBundle/BundleIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@

final class BundleIntegrationTest extends WebTestCase
{
/**
* @var string
*/
protected static $class = TestKernel::class;

public function testDataGridRenderingAndEditing(): void
{
$client = self::createClient();
Expand Down
5 changes: 0 additions & 5 deletions tests/Bundle/DataSourceBundle/BundleIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@

final class BundleIntegrationTest extends WebTestCase
{
/**
* @var string
*/
protected static $class = TestKernel::class;

private KernelBrowser $client;
private ?int $groupId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,29 @@ public function testFields(string $type): void
$dataSource = $this->createMock(DataSourceInterface::class);
$dataSource->method('getName')->willReturn('datasource');

$formOptions = [];
if ($type === DateTimeTypeInterface::class) {
$parameters = [
'date' => ['year' => 2012, 'month' => 12, 'day' => 12],
'time' => ['hour' => 12, 'minute' => 12],
];
$parameters2 = new DateTimeImmutable('2012-12-12 12:12:00');
$formOptions = [
'years' => range(2012, (int) date('Y')),
'date_widget' => 'choice',
'time_widget' => 'choice',
];
} elseif ($type === TimeTypeInterface::class) {
$parameters = ['hour' => 12, 'minute' => 12];
$parameters2 = new DateTimeImmutable(date('Y-m-d', 0) . ' 12:12:00');
$formOptions = ['widget' => 'choice'];
} elseif ($type === DateTypeInterface::class) {
$parameters = ['year' => 2012, 'month' => 12, 'day' => 12];
$parameters2 = new DateTimeImmutable('2012-12-12');
$formOptions = [
'years' => range(2012, (int) date('Y')),
'widget' => 'choice',
];
} elseif ($type === NumberTypeInterface::class) {
$parameters = 123;
$parameters2 = 123;
Expand All @@ -192,9 +203,7 @@ public function testFields(string $type): void

$options = $optionsResolver->resolve([
'comparison' => 'eq',
'form_options' => true === in_array($type, [DateTypeInterface::class, DateTimeTypeInterface::class], true)
? ['years' => range(2012, (int) date('Y'))]
: []
'form_options' => $formOptions,
]);

$field = new Field('datasource', $fieldType, 'name', $options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ private function createDataSource(string $driver): DataSourceInterface
'field' => 'doctrine-dbal' === $driver ? 'e.create_time' : 'createTime',
'form_options' => [
'label' => 'Create time',
'input' => 'datetime_immutable'
'input' => 'datetime_immutable',
'widget' => 'choice',
],
'form_order' => -2,
]);
Expand Down