Your project should not use dependencies with incompatible licenses

More information: https://insight.symfony.com/what-we-analyse/composer.incompatible_license

The dependency "mpdf/mpdf" uses a copyleft license (GPL-2.0-only) which is incompatible with your project license (MIT).
Collective

Your project controllers should only contains actions as public methods

More information: https://insight.symfony.com/what-we-analyse/symfony.controller.non_action_public_method_in_controller_class

  1. private EntityManagerInterface $em,
  2. ) {
  3. $this->config = $config;
  4. }
  5. #[Route('/refresh-cache')]
    Non-action public method found in controller class
    Last edited by Nathan
  6. public function refreshCache(): Response
  7. {
  8. $this->denyAccessUnlessGranted('ROLE_CONFIG_REFRESH_CACHE');
  9. $configs = $this->em->getRepository(ConfigInterface::class)

Your project must not contain invalid function or method calls 10

More information: https://insight.symfony.com/what-we-analyse/php.invalid_call

  1. {
  2. /** @var AbstractConfigRepository $configRepository */
  3. $configRepository = $this->em->getRepository(ConfigInterface::class);
  4. foreach ($this->warmups as $warmup) {
  5. $warmup->warmup($configRepository);
    Cannot call method warmup() on mixed.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Nathan
  6. }
  7. $this->em->flush();
  8. $io = new SymfonyStyle($input, $output);
  1. ->setValueString($resource->getValueString())
  2. ->setValueText($resource->getValueText())
  3. ->setValueInt($resource->getValueInt())
  4. ->setValueFloat($resource->getValueFloat())
  5. ->setTri($resource->getTri())
  6. ->setTenantId($this->tenantService ? $this->tenantService->getTenantId() : null);
    Parameter #1 $tenantId of method Lle\ConfigBundle\Contracts\ConfigInterface::setTenantId() expects int, int|null given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Artahs
  7. $this->entityManager->refresh($resource);
  8. parent::save($config);
  1. $loader->load("services.yaml");
  2. $configuration = new Configuration();
  3. $processedConfig = $this->processConfiguration($configuration, $configs);
  4. $container->setParameter('lle_config.using_tenant', $processedConfig['using_tenant']);
    Parameter #2 $value of method Symfony\Component\DependencyInjection\Container::setParameter() expects array|bool|float|int|string|UnitEnum|null, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Valentin HELIES
  5. if ($processedConfig['tenant_service']) {
  6. $container->setAlias('lle_config.tenant_service', $processedConfig['tenant_service']);
  7. }
  8. }
  9. }
  1. $configuration = new Configuration();
  2. $processedConfig = $this->processConfiguration($configuration, $configs);
  3. $container->setParameter('lle_config.using_tenant', $processedConfig['using_tenant']);
  4. if ($processedConfig['tenant_service']) {
  5. $container->setAlias('lle_config.tenant_service', $processedConfig['tenant_service']);
    Parameter #2 $id of method Symfony\Component\DependencyInjection\ContainerBuilder::setAlias() expects string|Symfony\Component\DependencyInjection\Alias, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by valentin-helies
  6. }
  7. }
  8. }
  1. $item = new $configClass();
  2. $item
  3. ->setGroup($group)
  4. ->setLabel($label)
  5. ->setValueType($valueType)
  6. ->setTenantId($tenantId);
    Parameter #1 $tenantId of method Lle\ConfigBundle\Contracts\ConfigInterface::setTenantId() expects int, int|null given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Artahs
  7. return $item;
  8. }
  9. #[Required]
  1. /** @var AbstractConfigRepository $configRepository */
  2. $configRepository = $this->em->getRepository(ConfigInterface::class);
  3. switch ($type) {
  4. case ConfigInterface::BOOL:
  5. return $configRepository->getBool($group, $name, $default);
    Parameter #3 $default of method Lle\ConfigBundle\Repository\AbstractConfigRepository::getBool() expects bool, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Quentin
  6. case ConfigInterface::STRING:
  7. return $configRepository->getString($group, $name, $default);
  8. case ConfigInterface::TEXT:
  9. return $configRepository->getText($group, $name, $default);
  10. case ConfigInterface::INT:
  1. switch ($type) {
  2. case ConfigInterface::BOOL:
  3. return $configRepository->getBool($group, $name, $default);
  4. case ConfigInterface::STRING:
  5. return $configRepository->getString($group, $name, $default);
    Parameter #3 $default of method Lle\ConfigBundle\Repository\AbstractConfigRepository::getString() expects string, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Quentin
  6. case ConfigInterface::TEXT:
  7. return $configRepository->getText($group, $name, $default);
  8. case ConfigInterface::INT:
  9. return $configRepository->getInt($group, $name, $default);
  10. case ConfigInterface::FLOAT:
  1. case ConfigInterface::BOOL:
  2. return $configRepository->getBool($group, $name, $default);
  3. case ConfigInterface::STRING:
  4. return $configRepository->getString($group, $name, $default);
  5. case ConfigInterface::TEXT:
  6. return $configRepository->getText($group, $name, $default);
    Parameter #3 $default of method Lle\ConfigBundle\Repository\AbstractConfigRepository::getText() expects string, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Quentin
  7. case ConfigInterface::INT:
  8. return $configRepository->getInt($group, $name, $default);
  9. case ConfigInterface::FLOAT:
  10. return $configRepository->getFloat($group, $name, $default);
  11. default:
  1. case ConfigInterface::STRING:
  2. return $configRepository->getString($group, $name, $default);
  3. case ConfigInterface::TEXT:
  4. return $configRepository->getText($group, $name, $default);
  5. case ConfigInterface::INT:
  6. return $configRepository->getInt($group, $name, $default);
    Parameter #3 $default of method Lle\ConfigBundle\Repository\AbstractConfigRepository::getInt() expects int, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Quentin
  7. case ConfigInterface::FLOAT:
  8. return $configRepository->getFloat($group, $name, $default);
  9. default:
  10. return null;
  11. }
  1. case ConfigInterface::TEXT:
  2. return $configRepository->getText($group, $name, $default);
  3. case ConfigInterface::INT:
  4. return $configRepository->getInt($group, $name, $default);
  5. case ConfigInterface::FLOAT:
  6. return $configRepository->getFloat($group, $name, $default);
    Parameter #3 $default of method Lle\ConfigBundle\Repository\AbstractConfigRepository::getFloat() expects float, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Nathan
  7. default:
  8. return null;
  9. }
  10. }
  11. }

Your project should not use invalid parameter and return typehints

More information: https://insight.symfony.com/what-we-analyse/php.invalid_typehint

  1. use Symfony\Component\DependencyInjection\Attribute\AutowireIterator;
  2. #[AsCommand('lle:config:warmup')]
  3. class WarmupCommand extends Command
  4. {
  5. public function __construct(
    Method Lle\ConfigBundle\Command\WarmupCommand::__construct() has parameter $warmups with no value type specified in iterable type iterable.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Nathan
  6. private EntityManagerInterface $em,
  7. #[AutowireIterator('lle.config.warmup')]
  8. /** @var iterable<WarmupInterface> */
  9. private iterable $warmups,
  10. ) {

Your project should use return types 4

More information: https://insight.symfony.com/what-we-analyse/php.missing_return_typehint

  1. $metadata = $this->entityManager->getClassMetadata(ConfigInterface::class);
  2. return $metadata->name;
  3. }
  4. public function list(?DatasourceParams $requestParams): iterable
    Method Lle\ConfigBundle\Crudit\Datasource\ConfigDatasource::list() return type has no value type specified in iterable type iterable.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Valentin HELIES
  5. {
  6. /** @var ConfigInterface[] $list */
  7. $list = parent::list($requestParams);
  8. $resultWithTenant = [];
  1. )
  2. {
  3. $this->datasource = $datasource;
  4. }
  5. public function getFields(string $key): array
    Method Lle\ConfigBundle\Crudit\Config\ConfigCrudConfig::getFields() return type has no value type specified in iterable type array.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Bastien
  6. {
  7. $group = Field::new('group')->setRuptGroup(1);
  8. $label = Field::new('label')->setLabel('field.code');
  9. $transLabel = Field::new('label')
  10. ->setTemplate('@LleConfig/_trans_label.html.twig')
  1. public function getNbItems(): int
  2. {
  3. return 500;
  4. }
  5. public function getListActions(): array
    Method Lle\ConfigBundle\Crudit\Config\ConfigCrudConfig::getListActions() return type has no value type specified in iterable type array.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Nathan
  6. {
  7. return [];
  8. }
  9. public function getItemActions(): array
  1. public function getListActions(): array
  2. {
  3. return [];
  4. }
  5. public function getItemActions(): array
    Method Lle\ConfigBundle\Crudit\Config\ConfigCrudConfig::getItemActions() return type has no value type specified in iterable type array.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Nathan
  6. {
  7. return [];
  8. }
  9. public function getRootRoute(): string

Your project uses non-strict array lookups 5

More information: https://insight.symfony.com/what-we-analyse/php.strict_array_lookup

  1. }
  2. }
  3. $result = [];
  4. foreach ($list as $item) {
  5. if ($item->getTenantId() || !in_array($item->getLabel() . '-' . $item->getGroup(), $resultWithTenant)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Valentin HELIES
  6. $result[] = $item;
  7. }
  8. }
  9. return $result;
  1. * @param ConfigInterface $resource
  2. */
  3. public function save(object $resource): bool
  4. {
  5. // input type password or string set null on empty field
  6. if (in_array($resource->getValueType(), [ConfigInterface::PASSWORD, ConfigInterface::STRING]) && !$resource->getValueString()) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Bastien MUNCK
  7. $resource->setValueString('');
  8. }
  9. if (in_array($resource->getValueType(), [ConfigInterface::TEXT]) && !$resource->getValueText()) {
  10. $resource->setValueText('');
  11. }
  1. {
  2. // input type password or string set null on empty field
  3. if (in_array($resource->getValueType(), [ConfigInterface::PASSWORD, ConfigInterface::STRING]) && !$resource->getValueString()) {
  4. $resource->setValueString('');
  5. }
  6. if (in_array($resource->getValueType(), [ConfigInterface::TEXT]) && !$resource->getValueText()) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Bastien
  7. $resource->setValueText('');
  8. }
  9. if (in_array($resource->getValueType(), [ConfigInterface::INT]) && !$resource->getValueInt()) {
  10. return true;
  11. }
  1. $resource->setValueString('');
  2. }
  3. if (in_array($resource->getValueType(), [ConfigInterface::TEXT]) && !$resource->getValueText()) {
  4. $resource->setValueText('');
  5. }
  6. if (in_array($resource->getValueType(), [ConfigInterface::INT]) && !$resource->getValueInt()) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Bastien
  7. return true;
  8. }
  9. if (in_array($resource->getValueType(), [ConfigInterface::FLOAT]) && !$resource->getValueFloat()) {
  10. return true;
  11. }
  1. $resource->setValueText('');
  2. }
  3. if (in_array($resource->getValueType(), [ConfigInterface::INT]) && !$resource->getValueInt()) {
  4. return true;
  5. }
  6. if (in_array($resource->getValueType(), [ConfigInterface::FLOAT]) && !$resource->getValueFloat()) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Bastien
  7. return true;
  8. }
  9. /** @var bool $usingTenant */
  10. $usingTenant = $this->parameterBag->get('lle_config.using_tenant');

Your project should not use invalid return types

More information: https://insight.symfony.com/what-we-analyse/php.invalid_return_typehint

  1. (int) $tenantId
  2. );
  3. $item = $this->cache->getItem($cacheKey);
  4. if ($item->isHit()) {
  5. return $item->get();
    Method Lle\ConfigBundle\Service\CacheManager::get() should return bool|float|int|string|null but returns mixed.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Nathan
  6. }
  7. return null;
  8. }

Text files should end with a valid new line character. 4

More information: https://insight.symfony.com/what-we-analyse/missing_e_o_l

  1. - name: 'PHPStan Static Analysis'
  2. uses: php-actions/phpstan@v3
  3. with:
  4. configuration: tests/phpstan.neon
  5. memory_limit: 256M
    This file ends with no newline character, or with a different newline character than other files in your project. It won't render properly on a terminal, and it's considered a bad practice.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by artahs
  1. with:
  2. php_version: ${{ matrix.php_version }}
  3. php_extensions: xdebug
  4. version: 10.3
  5. configuration: tests/phpunit/phpunit.xml
  6. bootstrap: vendor/autoload.php
    This file ends with no newline character, or with a different newline character than other files in your project. It won't render properly on a terminal, and it's considered a bad practice.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by artahs
  1. php_version: ${{ matrix.php_version }}
  2. version: 2
  3. args: --profile --ignore-platform-reqs
  4. - name: 'PHP CodeSniffer Validations'
  5. run: vendor/bin/phpcs
    This file ends with no newline character, or with a different newline character than other files in your project. It won't render properly on a terminal, and it's considered a bad practice.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by artahs
  1. {% set transLabel = resource.getTransLabel|trans %}
  2. {% if 'config.' not in transLabel %}
  3. {{ transLabel }}
  4. {% endif %}
    This file ends with no newline character, or with a different newline character than other files in your project. It won't render properly on a terminal, and it's considered a bad practice.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by theo