Your project must not contain invalid function or method calls 7

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

  1. private static function addKeysToRows(array $header, array &$data): void
  2. {
  3. array_walk(
  4. $data,
  5. static function (array &$row) use ($header): void {

    Parameter #2 $callback of function array_walk expects callable(mixed, int|string): mixed, Closure(array): void given.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarosław Grygierek
  6. $row = array_combine($header, $row);
  7. },
  8. );
  9. }
  1. private static function addKeysToRows(array $header, array &$data): void
  2. {
  3. array_walk(
  4. $data,
  5. static function (array &$row) use ($header): void {
  6. $row = array_combine($header, $row);

    Parameter #1 $keys of function array_combine expects array<int|string>, array given.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  7. },
  8. );
  9. }
  10. private static function getReader(UploadedFile $file): BaseReader
  1. foreach ($delimiters as $delimiter) {
  2. $delimiterCount[$delimiter] = substr_count($csvContent, $delimiter);
  3. }
  4. return array_search(max($delimiterCount), $delimiterCount, true);

    Parameter #1 ...$arg1 of function max expects non-empty-array, array<string, int<0, max>> given.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarosław Grygierek
  5. }
  6. }
  1. */
  2. public function __construct(string $entityClass)
  3. {
  4. $this->reflectionClass = new ReflectionClass($entityClass);
  5. if (\interface_exists(TranslatableInterface::class) && is_subclass_of($entityClass, TranslatableInterface::class)) {
  6. $this->translationReflectionClass = new ReflectionClass($this->reflectionClass->newInstanceWithoutConstructor()->translate());

    Call to an undefined method object::translate().

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Micheal
  7. }
  8. }
  9. public function propertyExists(string $name): bool
  10. {
  1. }
  2. }
  3. private function isRecordDuplicatedInDatabase(EntityManagerInterface $em, string $class, array $criteria): bool
  4. {
  5. $query = $em->createQuery($this->buildDQL($class, $criteria));

    Parameter #2 $criteria of method JG\BatchEntityImportBundle\Validator\Constraints\DatabaseEntityUniqueValidator::buildDQL() expects array<string, array<int, array{string, bool|float|int|string}>>, array given.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. $this->passParametersToQuery($query, $criteria);
  7. return !empty($query->getArrayResult());
  8. }
  1. }
  2. private function isRecordDuplicatedInDatabase(EntityManagerInterface $em, string $class, array $criteria): bool
  3. {
  4. $query = $em->createQuery($this->buildDQL($class, $criteria));
  5. $this->passParametersToQuery($query, $criteria);

    Parameter #2 $criteria of method JG\BatchEntityImportBundle\Validator\Constraints\DatabaseEntityUniqueValidator::passParametersToQuery() expects array<string, array<int, array{string, bool|float|int|string}>>, array given.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. return !empty($query->getArrayResult());
  7. }
  8. /**
  1. * @return string[]
  2. */
  3. private function getHashedMatrixRecordsDataForDuplicationCheck(array $records, array $fieldsUsedInDuplicationCheck): array
  4. {
  5. return array_map(
  6. fn (MatrixRecord $record): string => $this->getHash($this->getMatrixRecordDataForDuplicationCheck($record, $fieldsUsedInDuplicationCheck)),

    Parameter #2 $fieldsUsedInDuplicationCheck of method JG\BatchEntityImportBundle\Validator\Constraints\MatrixRecordUniqueValidator::getMatrixRecordDataForDuplicationCheck() expects array<string>, array given.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarosław Grygierek
  7. $records,
  8. );
  9. }
  10. /**

Your project must not contain invalid instantiations 4

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

  1. $data = $spreadsheet->getActiveSheet()->toArray();
  2. /** @var string[] $header */
  3. $header = array_shift($data);
  4. self::addKeysToRows($header, $data);
  5. return new Matrix($header, $data);

    Parameter #2 $recordsData of class JG\BatchEntityImportBundle\Model\Matrix\Matrix constructor expects array<int, array<string, mixed>>, array given.

    Time to fix: about 1 hour
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. }
  7. /**
  8. * @param array<int, array<string, mixed>> $data
  9. */
  1. $data = $spreadsheet->getActiveSheet()->toArray();
  2. /** @var string[] $header */
  3. $header = array_shift($data);
  4. self::addKeysToRows($header, $data);
  5. return new Matrix($header, $data);

    Parameter #1 $header of class JG\BatchEntityImportBundle\Model\Matrix\Matrix constructor expects array<int, string>, array<string> given.

    Time to fix: about 1 hour
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. }
  7. /**
  8. * @param array<int, array<string, mixed>> $data
  9. */
  1. /**
  2. * @throws ReflectionException
  3. */
  4. public function __construct(string $entityClass)
  5. {
  6. $this->reflectionClass = new ReflectionClass($entityClass);

    Parameter #1 $objectOrClass of class ReflectionClass constructor expects class-string<T of object>|T of object, string given.

    Time to fix: about 1 hour
    Read doc Open Issue Permalink
    Last edited by Micheal
  7. if (\interface_exists(TranslatableInterface::class) && is_subclass_of($entityClass, TranslatableInterface::class)) {
  8. $this->translationReflectionClass = new ReflectionClass($this->reflectionClass->newInstanceWithoutConstructor()->translate());
  9. }
  10. }
  1. */
  2. public function __construct(string $entityClass)
  3. {
  4. $this->reflectionClass = new ReflectionClass($entityClass);
  5. if (\interface_exists(TranslatableInterface::class) && is_subclass_of($entityClass, TranslatableInterface::class)) {
  6. $this->translationReflectionClass = new ReflectionClass($this->reflectionClass->newInstanceWithoutConstructor()->translate());

    Parameter #1 $objectOrClass of class ReflectionClass constructor expects class-string<T of object>|T of object, mixed given.

    Time to fix: about 1 hour
    Read doc Open Issue Permalink
    Last edited by Micheal
  7. }
  8. }
  9. public function propertyExists(string $name): bool
  10. {

Your project should not use invalid parameter and return typehints 22

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

  1. public static function createFromPostData(array $data): Matrix
  2. {
  3. return $data ? new Matrix(array_keys($data[0]), $data) : new Matrix();
  4. }
  5. private static function addKeysToRows(array $header, array &$data): void

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

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. array_walk(
  8. $data,
  9. static function (array &$row) use ($header): void {
  10. $row = array_combine($header, $row);
  1. public static function createFromPostData(array $data): Matrix
  2. {
  3. return $data ? new Matrix(array_keys($data[0]), $data) : new Matrix();
  4. }
  5. private static function addKeysToRows(array $header, array &$data): void

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

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. array_walk(
  8. $data,
  9. static function (array &$row) use ($header): void {
  10. $row = array_combine($header, $row);
  1. private function translationPropertyExists(string $name): bool
  2. {
  3. return $this->translationReflectionClass instanceof ReflectionClass && $this->isPropertyWritable($this->translationReflectionClass, $name);
  4. }
  5. private function isPropertyWritable(ReflectionClass $entity, string $name): bool

    Method JG\BatchEntityImportBundle\Service\PropertyExistenceChecker::isPropertyWritable() has parameter $entity with generic class ReflectionClass but does not specify its types: T

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarosław Grygierek
  6. {
  7. $setterName = ColumnNameHelper::getSetterName($name);
  8. return ($entity->hasProperty($name) && $entity->getProperty($name)->isPublic())
  9. || ($entity->hasMethod($setterName) && $entity->getMethod($setterName)->isPublic());
  1. }
  2. parent::validateArguments($value, $constraint);
  3. }
  4. private function getMatrixRecordDataToCompare(MatrixRecord $matrixRecord, array $fields): array

    Method JG\BatchEntityImportBundle\Validator\Constraints\DatabaseEntityUniqueValidator::getMatrixRecordDataToCompare() has parameter $fields with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  5. {
  6. $data = [];
  7. foreach ($fields as $field) {
  8. $data[$field] = $matrixRecord->$field;
  9. }
  1. }
  2. return $data;
  3. }
  4. private function isDuplicate(array $matrixDataToCompare): bool

    Method JG\BatchEntityImportBundle\Validator\Constraints\DatabaseEntityUniqueValidator::isDuplicate() has parameter $matrixDataToCompare with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  5. {
  6. return array_key_exists($this->getHash($matrixDataToCompare), $this->duplicatedRecords);
  7. }
  8. private function isCorrectRecord(array $matrixDataToCompare): bool
  1. private function isDuplicate(array $matrixDataToCompare): bool
  2. {
  3. return array_key_exists($this->getHash($matrixDataToCompare), $this->duplicatedRecords);
  4. }
  5. private function isCorrectRecord(array $matrixDataToCompare): bool

    Method JG\BatchEntityImportBundle\Validator\Constraints\DatabaseEntityUniqueValidator::isCorrectRecord() has parameter $matrixDataToCompare with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. return array_key_exists($this->getHash($matrixDataToCompare), $this->correctRecords);
  8. }
  9. private function addDuplicate(array $matrixDataToCompare): void
  1. private function isCorrectRecord(array $matrixDataToCompare): bool
  2. {
  3. return array_key_exists($this->getHash($matrixDataToCompare), $this->correctRecords);
  4. }
  5. private function addDuplicate(array $matrixDataToCompare): void

    Method JG\BatchEntityImportBundle\Validator\Constraints\DatabaseEntityUniqueValidator::addDuplicate() has parameter $matrixDataToCompare with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. $this->duplicatedRecords[$this->getHash($matrixDataToCompare)] = true;
  8. }
  9. private function markAsCorrectRecord(array $matrixDataToCompare): void
  1. private function addDuplicate(array $matrixDataToCompare): void
  2. {
  3. $this->duplicatedRecords[$this->getHash($matrixDataToCompare)] = true;
  4. }
  5. private function markAsCorrectRecord(array $matrixDataToCompare): void

    Method JG\BatchEntityImportBundle\Validator\Constraints\DatabaseEntityUniqueValidator::markAsCorrectRecord() has parameter $matrixDataToCompare with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. $this->correctRecords[$this->getHash($matrixDataToCompare)] = true;
  8. }
  9. /**
  1. }
  2. /**
  3. * @return array<string, array<int, array{0: string, 1: scalar}>>
  4. */
  5. private function buildCriteria(MatrixRecord $matrixRecord, array $matrixDataToCompare): array

    Method JG\BatchEntityImportBundle\Validator\Constraints\DatabaseEntityUniqueValidator::buildCriteria() has parameter $matrixDataToCompare with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. $criteria = [];
  8. foreach ($matrixDataToCompare as $fieldName => $value) {
  9. $criteria[ColumnNameHelper::toCamelCase($fieldName)][] = ['=', $value];
  10. }
  1. }
  2. return $criteria;
  3. }
  4. private function addCriteriaToOmitEntity(array &$criteria, object $entityToOverride): void

    Method JG\BatchEntityImportBundle\Validator\Constraints\DatabaseEntityUniqueValidator::addCriteriaToOmitEntity() has parameter $criteria with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  5. {
  6. $primaryKeyData = $this->entityManager->getUnitOfWork()->getEntityIdentifier($entityToOverride);
  7. foreach ($primaryKeyData as $primaryKeyName => $primaryValue) {
  8. $criteria[$primaryKeyName][] = ['!=', $primaryValue];
  1. foreach ($primaryKeyData as $primaryKeyName => $primaryValue) {
  2. $criteria[$primaryKeyName][] = ['!=', $primaryValue];
  3. }
  4. }
  5. private function isRecordDuplicatedInDatabase(EntityManagerInterface $em, string $class, array $criteria): bool

    Method JG\BatchEntityImportBundle\Validator\Constraints\DatabaseEntityUniqueValidator::isRecordDuplicatedInDatabase() has parameter $criteria with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. $query = $em->createQuery($this->buildDQL($class, $criteria));
  8. $this->passParametersToQuery($query, $criteria);
  9. return !empty($query->getArrayResult());
  1. /**
  2. * @param MatrixRecord[] $records
  3. *
  4. * @return string[]
  5. */
  6. private function getHashedMatrixRecordsDataForDuplicationCheck(array $records, array $fieldsUsedInDuplicationCheck): array

    Method JG\BatchEntityImportBundle\Validator\Constraints\MatrixRecordUniqueValidator::getHashedMatrixRecordsDataForDuplicationCheck() has parameter $fieldsUsedInDuplicationCheck with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  7. {
  8. return array_map(
  9. fn (MatrixRecord $record): string => $this->getHash($this->getMatrixRecordDataForDuplicationCheck($record, $fieldsUsedInDuplicationCheck)),
  10. $records,
  11. );
  1. }
  2. $this->save();
  3. }
  4. protected function prepareRecord(MatrixRecord $record, array $headerInfo): void

    Method JG\BatchEntityImportBundle\Model\Configuration\AbstractImportConfiguration::prepareRecord() has parameter $headerInfo with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarosław Grygierek
  5. {
  6. $entity = $this->getEntity($record);
  7. $data = $record->getData();
  8. $fieldDefinitions = $this->getFieldsDefinitions();
  1. );
  2. return \array_map(static fn (string $name): string => \str_replace(' ', '_', $name), $header);
  3. }
  4. private function clearRecordData(array $data): array

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

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  5. {
  6. return array_filter($data, $this->isColumnNameValid(...), ARRAY_FILTER_USE_KEY);
  7. }
  8. private function isColumnNameValid(?string $name): bool
  1. use Twig\TwigFunction;
  2. use UnexpectedValueException;
  3. class TemplateExtension extends AbstractExtension
  4. {
  5. public function __construct(private readonly array $availableTemplates = [])

    Method JG\BatchEntityImportBundle\Twig\TemplateExtension::__construct() has parameter $availableTemplates with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarosław Grygierek
  6. {
  7. }
  8. public function getFunctions(): array
  9. {
  1. $container
  2. ->registerForAutoconfiguration(ImportConfigurationAutoInjectInterface::class)
  3. ->addTag('batch_entity_import.controller');
  4. }
  5. private function setParameters(array $configs, ContainerBuilder $container): void

    Method JG\BatchEntityImportBundle\DependencyInjection\BatchEntityImportExtension::setParameters() has parameter $configs with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. $processor = new Processor();
  8. $configuration = new Configuration();
  9. $config = $processor->processConfiguration($configuration, $configs);
  1. $this->addTemplatesConfig($rootNode->children());
  2. return $treeBuilder;
  3. }
  4. private function addTemplatesConfig(NodeBuilder $parentBuilder): void

    Method JG\BatchEntityImportBundle\DependencyInjection\Configuration::addTemplatesConfig() has parameter $parentBuilder with generic class Symfony\Component\Config\Definition\Builder\NodeBuilder but does not specify its types: TParent

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  5. {
  6. $builder = $parentBuilder->arrayNode('templates')->addDefaultsIfNotSet()->children();
  7. $this->addNodeConfig($builder, 'select_file', '@BatchEntityImport/select_file.html.twig');
  8. $this->addNodeConfig($builder, 'edit_matrix', '@BatchEntityImport/edit_matrix.html.twig');
  1. $this->addNodeConfig($builder, 'select_file', '@BatchEntityImport/select_file.html.twig');
  2. $this->addNodeConfig($builder, 'edit_matrix', '@BatchEntityImport/edit_matrix.html.twig');
  3. $this->addNodeConfig($builder, 'layout', '@BatchEntityImport/layout.html.twig');
  4. }
  5. private function addNodeConfig(NodeBuilder $builder, string $name, string $value): void

    Method JG\BatchEntityImportBundle\DependencyInjection\Configuration::addNodeConfig() has parameter $builder with generic class Symfony\Component\Config\Definition\Builder\NodeBuilder but does not specify its types: TParent

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. $builder
  8. ->scalarNode($name)
  9. ->defaultValue($value)
  10. ->cannotBeEmpty()
  1. namespace JG\BatchEntityImportBundle\Model\Form;
  2. class FormFieldDefinition
  3. {
  4. public function __construct(private readonly string $class, private readonly array $options = [])

    Method JG\BatchEntityImportBundle\Model\Form\FormFieldDefinition::__construct() has parameter $options with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarosław Grygierek
  5. {
  6. }
  7. public function getClass(): string
  8. {
  1. class MatrixRecord
  2. {
  3. private ?object $entity = null;
  4. private array $data = [];
  5. public function __construct(array $data = [], public readonly int|string|null $entityId = null)

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

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. foreach ($data as $name => $value) {
  8. if (!empty(\trim((string) $name))) {
  9. $this->data[\str_replace(' ', '_', (string) $name)] = $value;
  10. }
  1. protected function prepareContext(): void
  2. {
  3. $this->context->setNode($this->context->getValue(), $this->context->getObject(), $this->context->getMetadata(), '');
  4. }
  5. protected function addErrorToMatrixRecord(MatrixRecord $record, MatrixRecordUnique|DatabaseEntityUnique $constraint, int $index, array $fields): void

    Method JG\BatchEntityImportBundle\Validator\Constraints\AbstractValidator::addErrorToMatrixRecord() has parameter $fields with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarosław Grygierek
  6. {
  7. $this->context
  8. ->buildViolation($constraint->message, ['%fields%' => implode(', ', $fields)])
  9. ->atPath(sprintf('children[records][%d][%s]', $index, $constraint->fields[0]))
  10. ->setInvalidValue($record)
  1. ->atPath(sprintf('children[records][%d][%s]', $index, $constraint->fields[0]))
  2. ->setInvalidValue($record)
  3. ->addViolation();
  4. }
  5. protected function getHash(array $data): string

    Method JG\BatchEntityImportBundle\Validator\Constraints\AbstractValidator::getHash() has parameter $data with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. return md5(implode('--', $data));
  8. }
  9. }

Your project should not use invalid return types 5

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

  1. foreach ($delimiters as $delimiter) {
  2. $delimiterCount[$delimiter] = substr_count($csvContent, $delimiter);
  3. }
  4. return array_search(max($delimiterCount), $delimiterCount, true);

    Method JG\BatchEntityImportBundle\Service\CsvDelimiterDetector::detectDelimiter() should return string but returns string|false.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarosław Grygierek
  5. }
  6. }
  1. $entityToOverride = $matrixRecord->getEntity();
  2. if (null !== $entityToOverride) {
  3. $this->addCriteriaToOmitEntity($criteria, $entityToOverride);
  4. }
  5. return $criteria;

    Method JG\BatchEntityImportBundle\Validator\Constraints\DatabaseEntityUniqueValidator::buildCriteria() should return array<string, array<int, array{string, bool|float|int|string}>> but returns array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. }
  7. private function addCriteriaToOmitEntity(array &$criteria, object $entityToOverride): void
  8. {
  9. $primaryKeyData = $this->entityManager->getUnitOfWork()->getEntityIdentifier($entityToOverride);
  1. /**
  2. * @phpstan-return non-empty-string
  3. */
  4. private function getSeparator(FormFieldDefinition $fieldDefinition): string
  5. {
  6. return $fieldDefinition->getOptions()['separator'] ?? ArrayTextType::DEFAULT_SEPARATOR;

    Method JG\BatchEntityImportBundle\Model\Configuration\AbstractImportConfiguration::getSeparator() should return non-empty-string but returns mixed.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarosław Grygierek
  7. }
  8. }
  1. /**
  2. * @param array<string, mixed> $data
  3. */
  4. private function getEntityIdValue(array $data): int|string|null
  5. {
  6. return $data[self::RESERVED_ENTITY_ID_COLUMN_NAME] ?? null;

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

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarosław Grygierek
  7. }
  8. /**
  9. * @param string[] $header
  10. *
  1. }
  2. public function getTemplate(string $name): string
  3. {
  4. if (array_key_exists($name, $this->availableTemplates)) {
  5. return $this->availableTemplates[$name];

    Method JG\BatchEntityImportBundle\Twig\TemplateExtension::getTemplate() should return string but returns mixed.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. }
  7. throw new UnexpectedValueException(sprintf('Template %s not found.', $name));
  8. }
  9. }

Your project should use return types 11

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

  1. }
  2. parent::validateArguments($value, $constraint);
  3. }
  4. private function getMatrixRecordDataToCompare(MatrixRecord $matrixRecord, array $fields): array

    Method JG\BatchEntityImportBundle\Validator\Constraints\DatabaseEntityUniqueValidator::getMatrixRecordDataToCompare() return type has no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  5. {
  6. $data = [];
  7. foreach ($fields as $field) {
  8. $data[$field] = $matrixRecord->$field;
  9. }
  1. }
  2. /**
  3. * @param string[] $fieldsUsedInDuplicationCheck
  4. */
  5. private function getMatrixRecordDataForDuplicationCheck(MatrixRecord $matrixRecord, array $fieldsUsedInDuplicationCheck): array

    Method JG\BatchEntityImportBundle\Validator\Constraints\MatrixRecordUniqueValidator::getMatrixRecordDataForDuplicationCheck() return type has no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. return array_intersect_key($matrixRecord->getData(), array_flip($fieldsUsedInDuplicationCheck));
  8. }
  9. }
  1. public function getAllowedFileExtensions(): array
  2. {
  3. return ['csv', 'xls', 'xlsx', 'ods'];
  4. }
  5. private function parseValueForArrayType(FormFieldDefinition $fieldDefinition, ?string $value): array

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

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Pierre Svgnt
  6. {
  7. return $value
  8. ? explode($this->getSeparator($fieldDefinition), $value)
  9. : [];
  10. }
  1. $this->records[] = new MatrixRecord($clearedData, $this->getEntityIdValue($data));
  2. }
  3. }
  4. }
  5. public function getHeader(): array

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

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. return $this->header;
  8. }
  9. /**
  1. public function getRecords(): array
  2. {
  3. return $this->records;
  4. }
  5. public function getHeaderInfo(string $className): array

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

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarosław Grygierek
  6. {
  7. $info = [];
  8. $checker = new PropertyExistenceChecker($className);
  9. foreach ($this->header as $name) {
  1. );
  2. return \array_map(static fn (string $name): string => \str_replace(' ', '_', $name), $header);
  3. }
  4. private function clearRecordData(array $data): array

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

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  5. {
  6. return array_filter($data, $this->isColumnNameValid(...), ARRAY_FILTER_USE_KEY);
  7. }
  8. private function isColumnNameValid(?string $name): bool
  1. public function getClass(): string
  2. {
  3. return $this->class;
  4. }
  5. public function getOptions(): array

    Method JG\BatchEntityImportBundle\Model\Form\FormFieldDefinition::getOptions() return type has no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. return $this->options;
  8. }
  9. }
  1. public function setEntity(?object $entity): void
  2. {
  3. $this->entity = $entity;
  4. }
  5. public function getData(): array

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

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. {
  7. return $this->data;
  8. }
  9. public function __isset(string $name): bool
  1. }
  2. return implode($this->separator, $value);
  3. }
  4. public function reverseTransform(mixed $value): array

    Method JG\BatchEntityImportBundle\Form\Type\ArrayTextType::reverseTransform() return type has no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Pierre Svgnt
  5. {
  6. if (!is_string($value)) {
  7. throw new UnexpectedValueException('Only strings are allowed');
  8. }
  1. public function getEntityTranslationRelationName(): ?string;
  2. /**
  3. * Use this method to pass constraints to the main Matrix form.
  4. */
  5. public function getMatrixConstraints(): array;

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

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. /**
  7. * Use this method to set allowed file extensions.
  8. */
  9. public function getAllowedFileExtensions(): array;
  1. public function getMatrixConstraints(): array;
  2. /**
  3. * Use this method to set allowed file extensions.
  4. */
  5. public function getAllowedFileExtensions(): array;

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

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Jarek
  6. /**
  7. * Import data from matrix to database.
  8. */
  9. public function import(Matrix $matrix): void;