Your project must not contain invalid function or method calls 9
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_call
- {
- $info = [];
- $checker = new PropertyExistenceChecker($className);
- foreach ($this->header as $name) {
- $info[$name] = $checker->propertyExists($name);
- }
- return $info;
- }
- $this->header = $this->clearHeader($header);
- foreach ($recordsData as $data) {
- $clearedData = $this->clearRecordData($data);
- if ($clearedData) {
- $this->records[] = new MatrixRecord($clearedData, $this->getEntityIdValue($data));
- }
- }
- }
- public function getHeader(): array
- }
- private function clearHeader(array $header): array
- {
- $header = array_values(
- array_filter($header, $this->isColumnNameValid(...)),
- );
- return \array_map(static fn (string $name): string => \str_replace(' ', '_', $name), $header);
- }
- {
- $header = array_values(
- array_filter($header, $this->isColumnNameValid(...)),
- );
- return \array_map(static fn (string $name): string => \str_replace(' ', '_', $name), $header);
- }
- private function clearRecordData(array $data): array
- {
- return array_filter($data, $this->isColumnNameValid(...), ARRAY_FILTER_USE_KEY);
- $configuration = new Configuration();
- $config = $processor->processConfiguration($configuration, $configs);
- $templates = $config['templates'];
- $container->setParameter('batch_entity_import.templates', $templates);
- $container->setParameter('batch_entity_import.templates.select_file', $templates['select_file']);
- $container->setParameter('batch_entity_import.templates.edit_matrix', $templates['edit_matrix']);
- $container->setParameter('batch_entity_import.templates.layout', $templates['layout']);
- }
- }
- $templates = $config['templates'];
- $container->setParameter('batch_entity_import.templates', $templates);
- $container->setParameter('batch_entity_import.templates.select_file', $templates['select_file']);
- $container->setParameter('batch_entity_import.templates.edit_matrix', $templates['edit_matrix']);
- $container->setParameter('batch_entity_import.templates.layout', $templates['layout']);
- }
- }
- $config = $processor->processConfiguration($configuration, $configs);
- $templates = $config['templates'];
- $container->setParameter('batch_entity_import.templates', $templates);
- $container->setParameter('batch_entity_import.templates.select_file', $templates['select_file']);
- $container->setParameter('batch_entity_import.templates.edit_matrix', $templates['edit_matrix']);
- $container->setParameter('batch_entity_import.templates.layout', $templates['layout']);
- }
- }
- $processor = new Processor();
- $configuration = new Configuration();
- $config = $processor->processConfiguration($configuration, $configs);
- $templates = $config['templates'];
- $container->setParameter('batch_entity_import.templates', $templates);
- $container->setParameter('batch_entity_import.templates.select_file', $templates['select_file']);
- $container->setParameter('batch_entity_import.templates.edit_matrix', $templates['edit_matrix']);
- $container->setParameter('batch_entity_import.templates.layout', $templates['layout']);
- }
- }
- $setterName = ColumnNameHelper::getSetterName($name);
- if (isset($fieldDefinitions[$name])) {
- $fieldDefinition = $fieldDefinitions[$name];
- if (ArrayTextType::class === $fieldDefinition->getClass()) {
- $value = $this->parseValueForArrayType($fieldDefinition, $value);
- }
- }
- try {
- if (\interface_exists(TranslatableInterface::class) && $entity instanceof TranslatableInterface && $locale) {
Your project should use return types 3
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.missing_return_typehint
- }
- return null;
- }
- private function clearHeader(array $header): array
- {
- $header = array_values(
- array_filter($header, $this->isColumnNameValid(...)),
- );
- public function allowOverrideEntity(): bool
- {
- return true;
- }
- public function getAllowedFileExtensions(): array
- {
- return ['csv', 'xls', 'xlsx', 'ods'];
- }
- private function parseValueForArrayType(FormFieldDefinition $fieldDefinition, ?string $value): array
- public function getEntityTranslationRelationName(): ?string
- {
- return null;
- }
- public function getMatrixConstraints(): array
- {
- return [];
- }
- public function import(Matrix $matrix): void
Your project should not use invalid return types
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_return_typehint
- private function getEntityIdValue(array $data): int|string|null
- {
- foreach ($data as $name => $value) {
- if (self::RESERVED_ENTITY_ID_COLUMN_NAME === $name) {
- return $value;
- }
- }
- return null;
- }
Your project should not use invalid parameter and return typehints 2
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_typehint
- }
- return null;
- }
- private function clearHeader(array $header): array
- {
- $header = array_values(
- array_filter($header, $this->isColumnNameValid(...)),
- );
- }
- return $info;
- }
- private function getEntityIdValue(array $data): int|string|null
- {
- foreach ($data as $name => $value) {
- if (self::RESERVED_ENTITY_ID_COLUMN_NAME === $name) {
- return $value;
- }