Your project must not contain invalid function or method calls 8

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

  1. ->scalarNode('country_class')
  2. ->defaultValue(Country::class)
  3. ->validate()
  4. ->ifString()
  5. ->then(static function ($value): string {
  6. if (!class_exists($value) || !is_a($value, Country::class, true)) {
    Parameter #1 $class of function class_exists expects string, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Damien Lagae
  7. throw new InvalidConfigurationException(sprintf(
  8. 'Country class must be a valid class extending %s. "%s" given.',
  9. Country::class,
  10. $value
  11. ));
  1. ->then(static function ($value): string {
  2. if (!class_exists($value) || !is_a($value, Country::class, true)) {
  3. throw new InvalidConfigurationException(sprintf(
  4. 'Country class must be a valid class extending %s. "%s" given.',
  5. Country::class,
  6. $value
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Damien Lagae
  7. ));
  8. }
  9. return $value;
  10. })
  1. ->scalarNode('country_admin_controller')
  2. ->defaultValue(CountryCrudController::class)
  3. ->validate()
  4. ->ifString()
  5. ->then(static function ($value): string {
  6. if (!class_exists($value) || !is_a($value, CountryCrudController::class, true)) {
    Parameter #1 $class of function class_exists expects string, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Damien LAGAE
  7. throw new InvalidConfigurationException(sprintf(
  8. 'Country admin controller must be a valid class extending %s. "%s" given.',
  9. CountryCrudController::class,
  10. $value
  11. ));
  1. ->then(static function ($value): string {
  2. if (!class_exists($value) || !is_a($value, CountryCrudController::class, true)) {
  3. throw new InvalidConfigurationException(sprintf(
  4. 'Country admin controller must be a valid class extending %s. "%s" given.',
  5. CountryCrudController::class,
  6. $value
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Damien LAGAE
  7. ));
  8. }
  9. return $value;
  10. })
  1. ->scalarNode('country_repository')
  2. ->defaultValue(CountryRepository::class)
  3. ->validate()
  4. ->ifString()
  5. ->then(static function ($value): string {
  6. if (!class_exists($value) || !is_a($value, CountryRepository::class, true)) {
    Parameter #1 $class of function class_exists expects string, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Damien Lagae
  7. throw new InvalidConfigurationException(sprintf(
  8. 'Country repository must be a valid class extending %s. "%s" given.',
  9. CountryRepository::class,
  10. $value
  11. ));
  1. ->then(static function ($value): string {
  2. if (!class_exists($value) || !is_a($value, CountryRepository::class, true)) {
  3. throw new InvalidConfigurationException(sprintf(
  4. 'Country repository must be a valid class extending %s. "%s" given.',
  5. CountryRepository::class,
  6. $value
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Damien Lagae
  7. ));
  8. }
  9. return $value;
  10. })
  1. {
  2. $configuration = new Configuration();
  3. $config = $this->processConfiguration($configuration, $configs);
  4. foreach ($config as $key => $value) {
  5. $container->setParameter('enabel_partner_countries.' . $key, $value);
    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 Damien Lagae
  6. }
  7. $loader = new Loader\YamlFileLoader($container, new FileLocator(dirname(__DIR__, 2) . '/config'));
  8. $loader->load('services.yaml');
  9. }
  1. {
  2. $configs = $container->getExtensionConfig($this->getAlias());
  3. /** @var ConfigurationInterface $configuration */
  4. $configuration = $this->getConfiguration($configs, $container);
  5. $config = $this->processConfiguration($configuration, $configs);
  6. $container->prependExtensionConfig('enabel_partner_countries', $config);
    Parameter #2 $config of method Symfony\Component\DependencyInjection\ContainerBuilder::prependExtensionConfig() expects array<string, mixed>, array given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Damien Lagae
  7. $twigConfig['globals']['enabel_partner_countries'] = [];
  8. foreach ($config as $k => $v) {
  9. $twigConfig['globals']['enabel_partner_countries'][$k] = $v;
  10. }

Your project uses non-strict array lookups 2

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

  1. // Retrieve data from the Intl\Country component
  2. $countryCodes = Countries::getCountryCodes();
  3. // Create partner countries
  4. foreach ($countryCodes as $countryCode) {
  5. if (in_array($countryCode, array_keys($countries))) {
    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 Damien Lagae
  6. /** @var Country $country */
  7. $country = $countries[$countryCode];
  8. } else {
  9. /** @var Country $country */
  10. $country = new $countryClass();
  1. $country = new $countryClass();
  2. }
  3. $country->setAlpha2code($countryCode);
  4. $country->setIsPartner(false);
  5. if (in_array($countryCode, Country::PARTNER_COUNTRIES)) {
    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 Damien Lagae
  6. $country->setIsPartner(true);
  7. }
  8. $this->entityManager->persist($country);
  9. }