Skip to content

Commit

Permalink
phpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Aug 31, 2023
1 parent c9ce2b3 commit 6af65ad
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 3 deletions.
7 changes: 7 additions & 0 deletions tests/DependentFieldConfigTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file is part of the SymfonyCasts DynamicForms package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfonycasts\DynamicForms\Tests;

use PHPUnit\Framework\TestCase;
Expand Down
8 changes: 7 additions & 1 deletion tests/FunctionalTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file is part of the SymfonyCasts DynamicForms package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfonycasts\DynamicForms\Tests;

use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
Expand Down Expand Up @@ -75,7 +82,6 @@ public function testDynamicFields()
;
}


protected static function getKernelClass(): string
{
return DynamicFormsTestKernel::class;
Expand Down
7 changes: 7 additions & 0 deletions tests/fixtures/DynamicFormsTestKernel.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file is part of the SymfonyCasts DynamicForms package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfonycasts\DynamicForms\Tests\fixtures;

use Psr\Log\NullLogger;
Expand Down
7 changes: 7 additions & 0 deletions tests/fixtures/Enum/DynamicTestFood.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file is part of the SymfonyCasts DynamicForms package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfonycasts\DynamicForms\Tests\fixtures\Enum;

enum DynamicTestFood: string
Expand Down
7 changes: 7 additions & 0 deletions tests/fixtures/Enum/DynamicTestMeal.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file is part of the SymfonyCasts DynamicForms package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfonycasts\DynamicForms\Tests\fixtures\Enum;

enum DynamicTestMeal: string
Expand Down
7 changes: 7 additions & 0 deletions tests/fixtures/Enum/DynamicTestPizzaSize.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file is part of the SymfonyCasts DynamicForms package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfonycasts\DynamicForms\Tests\fixtures\Enum;

enum DynamicTestPizzaSize: int
Expand Down
11 changes: 9 additions & 2 deletions tests/fixtures/TestDynamicForm.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file is part of the SymfonyCasts DynamicForms package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfonycasts\DynamicForms\Tests\fixtures;

use Symfony\Component\Form\AbstractType;
Expand Down Expand Up @@ -29,7 +36,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
]);

// addDynamic(string $name, array $dependencies, callable $callback): self
$builder->addDependent('mainFood', ['meal'], function(DependentField $field, ?DynamicTestMeal $meal) {
$builder->addDependent('mainFood', ['meal'], function (DependentField $field, ?DynamicTestMeal $meal) {
$field->add(EnumType::class, [
'class' => DynamicTestFood::class,
'placeholder' => null === $meal ? 'Select a meal first' : sprintf('What is for %s?', $meal->getReadable()),
Expand All @@ -39,7 +46,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
]);
});

$builder->addDependent('pizzaSize', ['mainFood', 'upperCasePizzaSizes'], function(DependentField $field, ?DynamicTestFood $food, bool $upperCasePizzaSizes) {
$builder->addDependent('pizzaSize', ['mainFood', 'upperCasePizzaSizes'], function (DependentField $field, ?DynamicTestFood $food, bool $upperCasePizzaSizes) {
if (DynamicTestFood::Pizza !== $food) {
return;
}
Expand Down

0 comments on commit 6af65ad

Please sign in to comment.