apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -17,7 +17,9 @@ use Doctrine\ORM\Mapping as ORM;
* CustomField.
*
* @ORM\Entity
*
* @ORM\Table(name="customfield")
*
* @ORM\HasLifecycleCallbacks
*/
class CustomField
@@ -39,10 +41,10 @@ class CustomField
private ?\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup $customFieldGroup = null;
/**
* @var int
*
* @ORM\Id
*
* @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null;
@@ -60,8 +62,6 @@ class CustomField
private array $options = [];
/**
* @var float
*
* @ORM\Column(type="float")
*/
private ?float $ordering = null;
@@ -72,15 +72,11 @@ class CustomField
private false $required = false;
/**
* @var string
*
* @ORM\Column(type="string", length=255)
*/
private ?string $slug = null;
/**
* @var string
*
* @ORM\Column(type="string", length=255)
*/
private ?string $type = null;
@@ -214,11 +210,9 @@ class CustomField
/**
* Set customFieldGroup.
*
* @param CustomFieldsGroup $customFieldGroup
*
* @return CustomField
*/
public function setCustomFieldsGroup(?CustomFieldsGroup $customFieldGroup = null)
public function setCustomFieldsGroup(CustomFieldsGroup $customFieldGroup = null)
{
$this->customFieldGroup = $customFieldGroup;
@@ -273,8 +267,6 @@ class CustomField
}
/**
* @param $slug
*
* @return $this
*/
public function setSlug($slug)

View File

@@ -18,6 +18,7 @@ use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(
* repositoryClass="Chill\CustomFieldsBundle\EntityRepository\CustomFieldLongChoice\OptionRepository")
*
* @ORM\Table(name="custom_field_long_choice_options")
*/
class Option
@@ -29,6 +30,7 @@ class Option
/**
* @var Collection<Option>
*
* @ORM\OneToMany(
* targetEntity="Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option",
* mappedBy="parent")
@@ -36,10 +38,10 @@ class Option
private Collection $children;
/**
* @var int
*
* @ORM\Id
*
* @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null;
@@ -58,6 +60,7 @@ class Option
* @ORM\ManyToOne(
* targetEntity="Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option",
* inversedBy="children")
*
* @ORM\JoinColumn(nullable=true)
*/
private ?\Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option $parent = null;
@@ -147,8 +150,6 @@ class Option
}
/**
* @param $active
*
* @return $this
*/
public function setActive($active)
@@ -159,8 +160,6 @@ class Option
}
/**
* @param $internal_key
*
* @return $this
*/
public function setInternalKey($internal_key)
@@ -171,8 +170,6 @@ class Option
}
/**
* @param $key
*
* @return $this
*/
public function setKey($key)
@@ -185,7 +182,7 @@ class Option
/**
* @return $this
*/
public function setParent(?Option $parent = null)
public function setParent(Option $parent = null)
{
$this->parent = $parent;
$this->key = $parent->getKey();

View File

@@ -17,6 +17,7 @@ use Doctrine\ORM\Mapping as ORM;
* CustomFieldsDefaultGroup.
*
* @ORM\Entity
*
* @ORM\Table(
* name="customfieldsdefaultgroup",
* uniqueConstraints={@ORM\UniqueConstraint(
@@ -27,8 +28,6 @@ use Doctrine\ORM\Mapping as ORM;
class CustomFieldsDefaultGroup
{
/**
* @var CustomFieldsGroup
*
* @ORM\ManyToOne(
* targetEntity="Chill\CustomFieldsBundle\Entity\CustomFieldsGroup")
*
@@ -37,17 +36,15 @@ class CustomFieldsDefaultGroup
private ?\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup $customFieldsGroup = null;
/**
* @var string
*
* @ORM\Column(type="string", length=255)
*/
private ?string $entity = null;
/**
* @var int
*
* @ORM\Id
*
* @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null;
@@ -85,7 +82,7 @@ class CustomFieldsDefaultGroup
/**
* Set customFieldsGroup.
*
* @param CustomFieldsGroup $customFieldsGroup *
* @param CustomFieldsGroup $customFieldsGroup *
*
* @return CustomFieldsDefaultGroup
*/

View File

@@ -19,6 +19,7 @@ use Doctrine\ORM\Mapping as ORM;
* CustomFieldGroup.
*
* @ORM\Entity
*
* @ORM\Table(name="customfieldsgroup")
*/
class CustomFieldsGroup
@@ -34,25 +35,25 @@ class CustomFieldsGroup
* The custom fields are asc-ordered regarding to their property "ordering".
*
* @var Collection<CustomField>
*
* @ORM\OneToMany(
* targetEntity="Chill\CustomFieldsBundle\Entity\CustomField",
* mappedBy="customFieldGroup")
*
* @ORM\OrderBy({"ordering": "ASC"})
*/
private Collection $customFields;
/**
* @var string
*
* @ORM\Column(type="string", length=255)
*/
private ?string $entity = null;
/**
* @var int
*
* @ORM\Id
*
* @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null;
@@ -138,9 +139,9 @@ class CustomFieldsGroup
/**
* Get name.
*/
public function getName(?string $language = null): array|string
public function getName(string $language = null): array|string
{
//TODO set this in a service, PLUS twig function
// TODO set this in a service, PLUS twig function
if (null !== $language) {
if (isset($this->name[$language])) {
return $this->name[$language];