Please note that this service is under alpha statement, we are actively working on it. It may be unstable and might completely change without warning. Help us by reporting!

sigmapix/SigmapixSonataImportBundle

Analysis #10114 FAILED

Diff

Download raw diff

diff --git a/Admin/ImportableAdminTrait.php b/Admin/ImportableAdminTrait.php
index a7cc6b70f32f6331ba6bc31867b13c81d0c4765d..3c751ae927c535dbf0b59372b27e0e57ea306cd2 100644
--- a/Admin/ImportableAdminTrait.php
+++ b/Admin/ImportableAdminTrait.php
@@ -113,7 +113,7 @@ trait ImportableAdminTrait
                     'mapped' => $field->getOption('mapped'),
                     'label' => $field->getOption('label'),
                     'label_format' => $field->getOption('label_format'), // This will be used for DateTimeConverter
-                    'translation_domain' => $field->getOption('translation_domain')
+                    'translation_domain' => $field->getOption('translation_domain'),
                 ]);
             }
         }
diff --git a/Controller/CRUDController.php b/Controller/CRUDController.php
index ff5a6cb83c2e9e6540fae4570e23729cf75de3d7..af9ab7179ea1f70ef789cced777733480dbdcd13 100644
--- a/Controller/CRUDController.php
+++ b/Controller/CRUDController.php
@@ -56,7 +56,7 @@ class CRUDController extends Controller
             $exporter = $this->get('sonata.exporter.exporter');
         }
 
-        if (!in_array($format, $allowedExportFormats)) {
+        if (!\in_array($format, $allowedExportFormats)) {
             throw new \RuntimeException(
                 sprintf(
                     'Export in format `%s` is not allowed for class: `%s`. Allowed formats are: `%s`',
diff --git a/Service/ImportService.php b/Service/ImportService.php
index db759074c88e5dde045b8ece56825608a4592fd4..896fcfdf3dc8c7c7b66f6685d537801253323823 100644
--- a/Service/ImportService.php
+++ b/Service/ImportService.php
@@ -63,13 +63,15 @@ final class ImportService
         $columnHeaders = array_filter($reader->getColumnHeaders(), function ($h) {return null !== $h; });
         $columnHeaders = array_map(
             function ($h) {
-                if (!empty($h) && is_string($h)) {
+                if (!empty($h) && \is_string($h)) {
                     $h = utf8_encode($h);
                 }
+
                 return trim($h);
             }, $columnHeaders);
         $headers = array_flip($columnHeaders);
         array_walk($headers, function (&$v, $k) use ($headers) { $v = $k; });
+
         return $headers;
     }
 
@@ -95,20 +97,22 @@ final class ImportService
         // Convert
         $columnHeaders = array_map(
             function ($h) {
-                if (!empty($h) && is_string($h)) {
+                if (!empty($h) && \is_string($h)) {
                     $h = utf8_encode($h);
                 }
+
                 return trim($h);
             }, $reader->getColumnHeaders());
         // Replace columnsHeader names with entity field name in our $mapping
         $columnHeaders = array_map(function ($h) use ($mapping) {
             $k = array_search($h, (array) $mapping, true);
+
             return false === $k ? $h : $k;
         }, $columnHeaders);
         $reader->setColumnHeaders($columnHeaders);
 
         /** @var DoctrineWriter $writer */
-        $writer = new $this->doctrineWriterClass($this->em, get_class($form->getData()));
+        $writer = new $this->doctrineWriterClass($this->em, \get_class($form->getData()));
         if (method_exists($writer, 'setContainer')) {
             $writer->setContainer($this->container);
         }
@@ -156,7 +160,7 @@ final class ImportService
         $fileExtension = $file->guessExtension();
         $excelExtensions = ['xls', 'xlsx', 'zip'];
 
-        if (in_array($fileExtension, $excelExtensions)) {
+        if (\in_array($fileExtension, $excelExtensions)) {
             $reader = new ExcelReader(new \SplFileObject($pathFile), 0, 0, true);
         } else {
             $reader = new CsvReader(new \SplFileObject($pathFile), ';');