mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 17:15:02 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\CustomFieldsBundle\Service;
|
||||
|
||||
use LogicException;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
@@ -45,8 +44,8 @@ class CustomFieldProvider implements ContainerAwareInterface
|
||||
* Add a new custom field to the provider.
|
||||
*
|
||||
* @param type $serviceName The name of the service (declared in service.yml)
|
||||
* @param type $type The type of the service (that is used in the form to
|
||||
* add this type)
|
||||
* @param type $type The type of the service (that is used in the form to
|
||||
* add this type)
|
||||
*/
|
||||
public function addCustomField($serviceName, $type)
|
||||
{
|
||||
@@ -56,7 +55,7 @@ class CustomFieldProvider implements ContainerAwareInterface
|
||||
/**
|
||||
* Get all the custom fields known by the provider.
|
||||
*
|
||||
* @return array Array of the known custom fields indexed by the type.
|
||||
* @return array array of the known custom fields indexed by the type
|
||||
*/
|
||||
public function getAllFields()
|
||||
{
|
||||
@@ -77,8 +76,7 @@ class CustomFieldProvider implements ContainerAwareInterface
|
||||
return $this->servicesByType[$type];
|
||||
}
|
||||
|
||||
throw new LogicException('the custom field with type ' . $type . ' '
|
||||
. 'is not found');
|
||||
throw new \LogicException('the custom field with type '.$type.' is not found');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,10 +84,10 @@ class CustomFieldProvider implements ContainerAwareInterface
|
||||
*
|
||||
* @see \Symfony\Component\DependencyInjection\ContainerAwareInterface::setContainer()
|
||||
*/
|
||||
public function setContainer(?ContainerInterface $container = null)
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
if (null === $container) {
|
||||
throw new LogicException('container should not be null');
|
||||
throw new \LogicException('container should not be null');
|
||||
}
|
||||
|
||||
$this->container = $container;
|
||||
|
@@ -25,9 +25,9 @@ class CustomFieldsHelper
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param EntityManagerInterface $em The entity manager
|
||||
* @param CustomFieldProvider $provider The customfield provider that
|
||||
* contains all the declared custom fields
|
||||
* @param EntityManagerInterface $em The entity manager
|
||||
* @param CustomFieldProvider $provider The customfield provider that
|
||||
* contains all the declared custom fields
|
||||
*/
|
||||
public function __construct(private readonly EntityManagerInterface $em, private readonly CustomFieldProvider $provider) {}
|
||||
|
||||
@@ -45,13 +45,13 @@ class CustomFieldsHelper
|
||||
/**
|
||||
* Render the value of a custom field.
|
||||
*
|
||||
* @param array $fields the **raw** array, as stored in the db
|
||||
* @param CustomField $customField the customField entity
|
||||
* @param string $documentType The type of document in which the rendered value is displayed ('html' or 'csv').
|
||||
* @param array $fields the **raw** array, as stored in the db
|
||||
* @param CustomField $customField the customField entity
|
||||
* @param string $documentType the type of document in which the rendered value is displayed ('html' or 'csv')
|
||||
*
|
||||
* @return The representation of the value the customField
|
||||
*
|
||||
* @throws CustomFieldsHelperException if slug is missing
|
||||
*
|
||||
* @return The representation of the value the customField.
|
||||
*/
|
||||
public function renderCustomField(array $fields, CustomField $customField, $documentType = 'html')
|
||||
{
|
||||
|
@@ -11,9 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\CustomFieldsBundle\Service;
|
||||
|
||||
use Exception;
|
||||
|
||||
class CustomFieldsHelperException extends Exception
|
||||
class CustomFieldsHelperException extends \Exception
|
||||
{
|
||||
public static function customFieldsGroupNotFound($entity)
|
||||
{
|
||||
|
Reference in New Issue
Block a user