Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
cklei-carly authored and github-actions[bot] committed Dec 3, 2024
1 parent 8b9f9b5 commit a40d1d8
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/FieldTypes/Configs/FieldTypeBaseConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
abstract class FieldTypeBaseConfig implements Contracts\FieldTypeConfig
{
use Macroable;

abstract public function applyConfig(Forms\Components\Component $component): void;

abstract public function getFormSchema(): array;
Expand Down
3 changes: 1 addition & 2 deletions tests/FieldGroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use SolutionForest\FilamentFieldGroup\Tests\Support\TestModels\Field;
use SolutionForest\FilamentFieldGroup\Tests\Support\TestModels\FieldGroup;
use SolutionForest\FilamentFieldGroup\Supports\FieldGroupConfig;
use SolutionForest\FilamentFieldGroup\Tests\TestCase;

class FieldGroupTest extends TestCase
Expand Down Expand Up @@ -57,4 +56,4 @@ public function it_deletes_related_fields_when_deleted()
'id' => $field->id,
]);
}
}
}
6 changes: 3 additions & 3 deletions tests/FieldTest/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public function it_can_macroable()

$this->assertEquals('test', $fieldType->testMacro());
}

/**
* Builds a form component and performs assertions using the provided field type callback.
*
* @param callable(TField) $fieldTypeCallback A callback function that defines the field type to be used in the form component.
* @param callable(TField) $fieldTypeCallback A callback function that defines the field type to be used in the form component.
* @return TFieldComponent The form component.
*/
protected function initializeFormComponentAndVerify($fieldTypeCallback)
Expand All @@ -51,6 +51,6 @@ protected function initializeFormComponentAndVerify($fieldTypeCallback)
*/
private function buildFieldType()
{
return new static::$fieldTypeClass();
return new static::$fieldTypeClass;
}
}
2 changes: 1 addition & 1 deletion tests/FieldTest/ColorPickerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ public function it_can_apply_config()

$this->assertEquals($defaultValue, $field->getDefaultState());
}
}
}
2 changes: 1 addition & 1 deletion tests/FieldTest/DateTimePickerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ public function it_can_apply_config()

$this->assertEquals($defaultValue, $field->getDefaultState());
}
}
}
6 changes: 3 additions & 3 deletions tests/FieldTest/EmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class EmailTest extends BaseTestCase
public function it_can_apply_config()
{
$placeholder = 'Enter email here';

$field = $this->initializeFormComponentAndVerify(function (Email $email) use ($placeholder) {
$email->placeholder = $placeholder;

return $email;
});

$this->assertEquals($placeholder, $field->getPlaceholder());
}
}
}
2 changes: 1 addition & 1 deletion tests/FieldTest/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ public function it_can_apply_config()
$this->assertEquals($maxFileSize, $field->getMaxSize());
$this->assertEquals($maxFiles, $field->getMaxFiles());
}
}
}
4 changes: 2 additions & 2 deletions tests/FieldTest/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class ImageTest extends BaseTestCase
/** @test */
public function it_can_apply_config()
{
$field = $this->initializeFormComponentAndVerify(fn (Image $image) => $image);
$field = $this->initializeFormComponentAndVerify(fn (Image $image) => $image);

$this->assertEquals(['image/*'], $field->getAcceptedFileTypes());
}
}
}
6 changes: 3 additions & 3 deletions tests/FieldTest/NumberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ public function it_can_apply_config()
$placeholder = 'Enter number here';
$min = 1;
$max = 10;

$field = $this->initializeFormComponentAndVerify(function (Number $number) use ($placeholder, $min, $max) {
$number->placeholder = $placeholder;
$number->minValue = $min;
$number->maxValue = $max;

return $number;
});

$this->assertEquals($placeholder, $field->getPlaceholder());
$this->assertEquals($min, $field->getMinValue());
$this->assertEquals($max, $field->getMaxValue());
}
}
}
4 changes: 2 additions & 2 deletions tests/FieldTest/PasswordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class PasswordTest extends BaseTestCase
/** @test */
public function it_can_apply_config()
{
$field = $this->initializeFormComponentAndVerify(fn (Password $password) => $password);
$field = $this->initializeFormComponentAndVerify(fn (Password $password) => $password);

$this->assertEquals(true, $field->isPassword());
}
}
}
1 change: 0 additions & 1 deletion tests/FieldTest/RadioTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ public function it_can_apply_config()
$this->assertEquals($options, $field->getOptions());
}
}

1 change: 0 additions & 1 deletion tests/FieldTest/SelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ public function it_can_apply_config()
$this->assertEquals($options, $field->getOptions());
}
}

2 changes: 1 addition & 1 deletion tests/FieldTest/TextAreaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ public function it_can_apply_config()
$this->assertEquals($placeholder, $field->getPlaceholder());
$this->assertEquals($defaultValue, $field->getDefaultState());
}
}
}
3 changes: 1 addition & 2 deletions tests/FieldTest/TextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function it_can_apply_config()
$suffixLabel = 'Suffix';
$placeholder = 'Enter text';
$defaultValue = 'Default Value';

$field = $this->initializeFormComponentAndVerify(function (Text $text) use ($maxLength, $minLength, $prefixLabel, $suffixLabel, $placeholder, $defaultValue) {
$text->maxLength = $maxLength;
$text->minLength = $minLength;
Expand All @@ -46,4 +46,3 @@ public function it_can_apply_config()
$this->assertEquals($defaultValue, $field->getDefaultState());
}
}

1 change: 0 additions & 1 deletion tests/FieldTest/ToggleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ public function it_can_apply_config()
});
}
}

2 changes: 1 addition & 1 deletion tests/FieldTest/UrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ public function it_can_apply_config()
$this->assertEquals($placeholder, $field->getPlaceholder());
$this->assertEquals($defaultValue, $field->getDefaultState());
}
}
}
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getEnvironmentSetUp($app)
/**
* Builds a form component for the specified field type.
*
* @param \SolutionForest\FilamentFieldGroup\FieldTypes\Configs\Contracts\FieldTypeConfig $fieldType The type of the field for which the form component is to be built.
* @param \SolutionForest\FilamentFieldGroup\FieldTypes\Configs\Contracts\FieldTypeConfig $fieldType The type of the field for which the form component is to be built.
* @return array{0: \Filament\Forms\Components\Component, 1: \Filament\Forms\Components\Component}
*/
protected function buildFormComponentForFieldType($fieldType)
Expand All @@ -77,7 +77,7 @@ protected function buildFormComponentForFieldType($fieldType)
Field::factory([
'type' => $fieldTypeConfig['name'],
'config' => $config,
]),
]),
'fields'
)
->create();
Expand Down

0 comments on commit a40d1d8

Please sign in to comment.