Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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: 0 additions & 2 deletions src/Contracts/Field/FieldTraitAwareInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,4 @@ public function setColumns(int|string $cols): self;
* @internal
*/
public function setDefaultColumns(int|string $cols): self;

public function setIcon(?string $iconCssClass, string $invokingMethod = 'FormField::setIcon()'): self;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is only implemented by FormField, and is not part of FieldTrait

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing a method from an interface is a BC break and should only be done in major version

What you can do instead is providing a blank deprecated method setIcon in the trait

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VincentLanglet : alright, it's restored. However I do not really agree with your point :

Firstly, FieldTraitAwareInterface is not used anywhere in the codebase, and I doubt anybody uses it yet, since none of the existing EasyAdmin fields implements it. (That's the goal of this PR).

Secondly, the signature in this interface does not match the only implementation of it in FormField, so I had to change the signature in FormField.

Thirdly, the goal of this interface is to have a common contract implemented by ALL the fields implementing FieldTrait. I don't see the point of adding it for a single field (FormField.)

}
4 changes: 2 additions & 2 deletions src/Field/ArrayField.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Config\Asset;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class ArrayField implements FieldInterface
final class ArrayField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/AssociationField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class AssociationField implements FieldInterface
final class AssociationField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/AvatarField.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Config\Option\Size;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class AvatarField implements FieldInterface
final class AvatarField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/BooleanField.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

use EasyCorp\Bundle\EasyAdminBundle\Config\Asset;
use EasyCorp\Bundle\EasyAdminBundle\Config\Option\TextAlign;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class BooleanField implements FieldInterface
final class BooleanField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/ChoiceField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class ChoiceField implements FieldInterface
final class ChoiceField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/CodeEditorField.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Config\Asset;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use EasyCorp\Bundle\EasyAdminBundle\Form\Type\CodeEditorType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class CodeEditorField implements FieldInterface
final class CodeEditorField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/CollectionField.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Config\Asset;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class CollectionField implements FieldInterface
final class CollectionField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/ColorField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\ColorType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class ColorField implements FieldInterface
final class ColorField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/CountryField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class CountryField implements FieldInterface
final class CountryField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/CurrencyField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\CurrencyType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class CurrencyField implements FieldInterface
final class CurrencyField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/DateField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class DateField implements FieldInterface
final class DateField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/DateTimeField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class DateTimeField implements FieldInterface
final class DateTimeField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/EmailField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class EmailField implements FieldInterface
final class EmailField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class Field implements FieldInterface
final class Field implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/FormField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use EasyCorp\Bundle\EasyAdminBundle\Form\Type\Layout\EaFormColumnOpenType;
use EasyCorp\Bundle\EasyAdminBundle\Form\Type\Layout\EaFormFieldsetOpenType;
use EasyCorp\Bundle\EasyAdminBundle\Form\Type\Layout\EaFormRowType;
Expand All @@ -13,7 +13,7 @@
/**
* @author Javier Eguiluz <[email protected]>
*/
final class FormField implements FieldInterface
final class FormField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/HiddenField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class HiddenField implements FieldInterface
final class HiddenField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/IdField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class IdField implements FieldInterface
final class IdField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/ImageField.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use EasyCorp\Bundle\EasyAdminBundle\Config\Asset;
use EasyCorp\Bundle\EasyAdminBundle\Config\Option\TextAlign;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use EasyCorp\Bundle\EasyAdminBundle\Form\Type\FileUploadType;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\Constraints\Image;
Expand All @@ -13,7 +13,7 @@
/**
* @author Javier Eguiluz <[email protected]>
*/
final class ImageField implements FieldInterface
final class ImageField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/IntegerField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class IntegerField implements FieldInterface
final class IntegerField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/LanguageField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\LanguageType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class LanguageField implements FieldInterface
final class LanguageField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/LocaleField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\LocaleType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class LocaleField implements FieldInterface
final class LocaleField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/MoneyField.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Config\Option\TextAlign;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
use Symfony\Component\Intl\Currencies;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class MoneyField implements FieldInterface
final class MoneyField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Field/NumberField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EasyCorp\Bundle\EasyAdminBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldTraitAwareInterface;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Contracts\Translation\TranslatableInterface;

/**
* @author Javier Eguiluz <[email protected]>
*/
final class NumberField implements FieldInterface
final class NumberField implements FieldTraitAwareInterface
{
use FieldTrait;

Expand Down
Loading