Your project must not contain invalid function or method calls 9

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

  1. {
  2. $info = [];
  3. $checker = new PropertyExistenceChecker($className);
  4. foreach ($this->header as $name) {
  5. $info[$name] = $checker->propertyExists($name);

    Parameter #1 $name of method JG\BatchEntityImportBundle\Service\PropertyExistenceChecker::propertyExists() expects string, mixed given.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Jarosław Grygierek
  6. }
  7. return $info;
  8. }
  1. $this->header = $this->clearHeader($header);
  2. foreach ($recordsData as $data) {
  3. $clearedData = $this->clearRecordData($data);
  4. if ($clearedData) {
  5. $this->records[] = new MatrixRecord($clearedData, $this->getEntityIdValue($data));

    Parameter #1 $data of method JG\BatchEntityImportBundle\Model\Matrix\Matrix::getEntityIdValue() expects array, mixed given.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Jarek
  6. }
  7. }
  8. }
  9. public function getHeader(): array
  1. }
  2. private function clearHeader(array $header): array
  3. {
  4. $header = array_values(
  5. array_filter($header, $this->isColumnNameValid(...)),

    Parameter #2 $callback of function array_filter expects (callable(mixed): bool)|null, Closure(string|null): bool given.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Jarek
  6. );
  7. return \array_map(static fn (string $name): string => \str_replace(' ', '_', $name), $header);
  8. }
  1. {
  2. $header = array_values(
  3. array_filter($header, $this->isColumnNameValid(...)),
  4. );
  5. return \array_map(static fn (string $name): string => \str_replace(' ', '_', $name), $header);

    Parameter #1 $callback of function array_map expects (callable(mixed): mixed)|null, Closure(string): string given.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Jarek
  6. }
  7. private function clearRecordData(array $data): array
  8. {
  9. return array_filter($data, $this->isColumnNameValid(...), ARRAY_FILTER_USE_KEY);
  1. $configuration = new Configuration();
  2. $config = $processor->processConfiguration($configuration, $configs);
  3. $templates = $config['templates'];
  4. $container->setParameter('batch_entity_import.templates', $templates);
  5. $container->setParameter('batch_entity_import.templates.select_file', $templates['select_file']);

    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 Permalink
    Last edited by Jarek
  6. $container->setParameter('batch_entity_import.templates.edit_matrix', $templates['edit_matrix']);
  7. $container->setParameter('batch_entity_import.templates.layout', $templates['layout']);
  8. }
  9. }
  1. $templates = $config['templates'];
  2. $container->setParameter('batch_entity_import.templates', $templates);
  3. $container->setParameter('batch_entity_import.templates.select_file', $templates['select_file']);
  4. $container->setParameter('batch_entity_import.templates.edit_matrix', $templates['edit_matrix']);
  5. $container->setParameter('batch_entity_import.templates.layout', $templates['layout']);

    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 Permalink
    Last edited by Jarosław Grygierek
  6. }
  7. }
  1. $config = $processor->processConfiguration($configuration, $configs);
  2. $templates = $config['templates'];
  3. $container->setParameter('batch_entity_import.templates', $templates);
  4. $container->setParameter('batch_entity_import.templates.select_file', $templates['select_file']);
  5. $container->setParameter('batch_entity_import.templates.edit_matrix', $templates['edit_matrix']);

    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 Permalink
    Last edited by Jarek
  6. $container->setParameter('batch_entity_import.templates.layout', $templates['layout']);
  7. }
  8. }
  1. $processor = new Processor();
  2. $configuration = new Configuration();
  3. $config = $processor->processConfiguration($configuration, $configs);
  4. $templates = $config['templates'];
  5. $container->setParameter('batch_entity_import.templates', $templates);

    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 Permalink
    Last edited by Jarek
  6. $container->setParameter('batch_entity_import.templates.select_file', $templates['select_file']);
  7. $container->setParameter('batch_entity_import.templates.edit_matrix', $templates['edit_matrix']);
  8. $container->setParameter('batch_entity_import.templates.layout', $templates['layout']);
  9. }
  10. }
  1. $setterName = ColumnNameHelper::getSetterName($name);
  2. if (isset($fieldDefinitions[$name])) {
  3. $fieldDefinition = $fieldDefinitions[$name];
  4. if (ArrayTextType::class === $fieldDefinition->getClass()) {
  5. $value = $this->parseValueForArrayType($fieldDefinition, $value);

    Parameter #2 $value of method JG\BatchEntityImportBundle\Model\Configuration\AbstractImportConfiguration::parseValueForArrayType() expects string|null, mixed given.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Pierre Svgnt
  6. }
  7. }
  8. try {
  9. if (\interface_exists(TranslatableInterface::class) && $entity instanceof TranslatableInterface && $locale) {

Your project should use return types 3

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

  1. }
  2. return null;
  3. }
  4. private function clearHeader(array $header): array

    Method JG\BatchEntityImportBundle\Model\Matrix\Matrix::clearHeader() return type has no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Jarek
  5. {
  6. $header = array_values(
  7. array_filter($header, $this->isColumnNameValid(...)),
  8. );
  1. public function allowOverrideEntity(): bool
  2. {
  3. return true;
  4. }
  5. public function getAllowedFileExtensions(): array

    Method JG\BatchEntityImportBundle\Model\Configuration\AbstractImportConfiguration::getAllowedFileExtensions() return type has no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Jarek
  6. {
  7. return ['csv', 'xls', 'xlsx', 'ods'];
  8. }
  9. private function parseValueForArrayType(FormFieldDefinition $fieldDefinition, ?string $value): array
  1. public function getEntityTranslationRelationName(): ?string
  2. {
  3. return null;
  4. }
  5. public function getMatrixConstraints(): array

    Method JG\BatchEntityImportBundle\Model\Configuration\AbstractImportConfiguration::getMatrixConstraints() return type has no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Jarek
  6. {
  7. return [];
  8. }
  9. public function import(Matrix $matrix): void

Your project should not use invalid return types

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

  1. private function getEntityIdValue(array $data): int|string|null
  2. {
  3. foreach ($data as $name => $value) {
  4. if (self::RESERVED_ENTITY_ID_COLUMN_NAME === $name) {
  5. return $value;

    Method JG\BatchEntityImportBundle\Model\Matrix\Matrix::getEntityIdValue() should return int|string|null but returns mixed.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Jarek
  6. }
  7. }
  8. return null;
  9. }

Your project should not use invalid parameter and return typehints 2

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

  1. }
  2. return null;
  3. }
  4. private function clearHeader(array $header): array

    Method JG\BatchEntityImportBundle\Model\Matrix\Matrix::clearHeader() has parameter $header with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Jarek
  5. {
  6. $header = array_values(
  7. array_filter($header, $this->isColumnNameValid(...)),
  8. );
  1. }
  2. return $info;
  3. }
  4. private function getEntityIdValue(array $data): int|string|null

    Method JG\BatchEntityImportBundle\Model\Matrix\Matrix::getEntityIdValue() has parameter $data with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Jarek
  5. {
  6. foreach ($data as $name => $value) {
  7. if (self::RESERVED_ENTITY_ID_COLUMN_NAME === $name) {
  8. return $value;
  9. }