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. protected 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 5

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. public function list(?DatasourceParams $requestParams): iterable
  2. {
  3. /** @var ConfigInterface[] $list */
  4. $list = array_filter(
  5. [...parent::list($requestParams)],
  6. fn (ConfigInterface $config): bool => $this->canView($config),
    Parameter #2 $callback of function array_filter expects (callable(mixed): bool)|null, Closure(Lle\ConfigBundle\Contracts\ConfigInterface): bool given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Bastien Munck
  7. );
  8. $resultWithTenant = [];
  9. foreach ($list as $item) {
  10. if ($item->getTenantId()) {
  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. $container->setParameter('lle_config.group_roles', $processedConfig['group_roles']);
  6. if ($processedConfig['tenant_service']) {
  7. $container->setAlias('lle_config.tenant_service', $processedConfig['tenant_service']);
  8. }
  1. $configuration = new Configuration();
  2. $processedConfig = $this->processConfiguration($configuration, $configs);
  3. $container->setParameter('lle_config.using_tenant', $processedConfig['using_tenant']);
  4. $container->setParameter('lle_config.group_roles', $processedConfig['group_roles']);
    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 Bastien Munck
  5. if ($processedConfig['tenant_service']) {
  6. $container->setAlias('lle_config.tenant_service', $processedConfig['tenant_service']);
  7. }
  8. // the credential bundle is optional: tagged "credential.warmup" through its autoconfiguration
  1. $processedConfig = $this->processConfiguration($configuration, $configs);
  2. $container->setParameter('lle_config.using_tenant', $processedConfig['using_tenant']);
  3. $container->setParameter('lle_config.group_roles', $processedConfig['group_roles']);
  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. // the credential bundle is optional: tagged "credential.warmup" through its autoconfiguration
  8. if (interface_exists(CredentialWarmupInterface::class)) {
  9. $container->register(ConfigCredentialWarmup::class)

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. protected EntityManagerInterface $em,
  7. #[AutowireIterator('lle.config.warmup')]
  8. /** @var iterable<WarmupInterface> */
  9. protected iterable $warmups,
  10. ) {

Your project should use return types 4

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

  1. }
  2. return $config;
  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 = array_filter(
  8. [...parent::list($requestParams)],
  9. fn (ConfigInterface $config): bool => $this->canView($config),
  1. }
  2. return $eipFields;
  3. }
  4. 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
  5. {
  6. $group = Field::new('group')->setRuptGroup(1);
  7. $label = Field::new('label')->setLabel('field.code');
  8. $transLabel = Field::new('label')
  9. ->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 3

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. throw new AccessDeniedException(self::ACCESS_DENIED_MESSAGE);
  2. }
  3. // an empty text field arrives as null: store an empty string ("0" is a value, not an empty field)
  4. if (in_array($resource->getValueType(), [ConfigInterface::PASSWORD, ConfigInterface::STRING]) && $resource->getValueString() === null) {
    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
  5. $resource->setValueString('');
  6. }
  7. if (in_array($resource->getValueType(), [ConfigInterface::TEXT]) && $resource->getValueText() === null) {
  8. $resource->setValueText('');
  9. }
  1. // an empty text field arrives as null: store an empty string ("0" is a value, not an empty field)
  2. if (in_array($resource->getValueType(), [ConfigInterface::PASSWORD, ConfigInterface::STRING]) && $resource->getValueString() === null) {
  3. $resource->setValueString('');
  4. }
  5. if (in_array($resource->getValueType(), [ConfigInterface::TEXT]) && $resource->getValueText() === null) {
    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
  6. $resource->setValueText('');
  7. }
  8. // an empty number is ignored (0 is a value): reload the entity so that a later flush() cannot write it
  9. if (
  10. ($resource->getValueType() === ConfigInterface::INT && $resource->getValueInt() === null)

Your project should not use invalid return types

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

  1. $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. 3

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