Passed
Push — master ( f355fb...7ec9f6 )
by F. Javier
03:59
created
src/Utility/Utils.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -27,39 +27,39 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public static function loadEnv(string $dir): void
29 29
     {
30
-        require_once $dir . '/vendor/autoload.php';
30
+        require_once $dir.'/vendor/autoload.php';
31 31
 
32 32
         if (!class_exists(Dotenv::class)) {
33
-            fwrite(STDERR, 'ERROR: No se ha cargado la clase Dotenv' . PHP_EOL);
33
+            fwrite(STDERR, 'ERROR: No se ha cargado la clase Dotenv'.PHP_EOL);
34 34
             exit(1);
35 35
         }
36 36
 
37 37
         try {
38 38
             // Load environment variables from .env file
39
-            if (file_exists($dir . '/.env')) {
39
+            if (file_exists($dir.'/.env')) {
40 40
                 $dotenv = Dotenv::createMutable($dir, '.env');
41 41
                 $dotenv->load();
42 42
             } else {
43
-                fwrite(STDERR, 'ERROR: no existe el fichero .env' . PHP_EOL);
43
+                fwrite(STDERR, 'ERROR: no existe el fichero .env'.PHP_EOL);
44 44
                 exit(1);
45 45
             }
46 46
 
47 47
             // Overload (if they exist) with .env.docker or .env.local
48
-            if (isset($_SERVER['DOCKER']) && file_exists($dir . '/.env.docker')) {
48
+            if (isset($_SERVER['DOCKER']) && file_exists($dir.'/.env.docker')) {
49 49
                 $dotenv = Dotenv::createMutable($dir, '.env.docker');
50 50
                 $dotenv->load();
51
-            } elseif (file_exists($dir . '/.env.local')) {
51
+            } elseif (file_exists($dir.'/.env.local')) {
52 52
                 $dotenv = Dotenv::createMutable($dir, '.env.local');
53 53
                 $dotenv->load();
54 54
             }
55 55
 
56 56
             // Requiring Variables to be set
57
-            $dotenv->required([ 'DATABASE_NAME', 'DATABASE_USER', 'DATABASE_PASSWD', 'SERVER_VERSION' ]);
58
-            $dotenv->required([ 'ENTITY_DIR' ]);
57
+            $dotenv->required(['DATABASE_NAME', 'DATABASE_USER', 'DATABASE_PASSWD', 'SERVER_VERSION']);
58
+            $dotenv->required(['ENTITY_DIR']);
59 59
         } catch (Throwable $e) {
60 60
             fwrite(
61 61
                 STDERR,
62
-                'EXCEPCIÓN: ' . $e->getCode() . ' - ' . $e->getMessage()
62
+                'EXCEPCIÓN: '.$e->getCode().' - '.$e->getMessage()
63 63
             );
64 64
             exit(1);
65 65
         }
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         } catch (Throwable $e) {
83 83
             fwrite(
84 84
                 STDERR,
85
-                'EXCEPCIÓN: ' . $e->getCode() . ' - ' . $e->getMessage()
85
+                'EXCEPCIÓN: '.$e->getCode().' - '.$e->getMessage()
86 86
             );
87 87
             exit(1);
88 88
         }
Please login to merge, or discard this patch.
src/Utility/DoctrineConnector.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  */
22 22
 final class DoctrineConnector
23 23
 {
24
-    private static EntityManager|null $instance = null;
24
+    private static EntityManager | null $instance = null;
25 25
 
26 26
     /**
27 27
      * Generate the Entity Manager
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
                 $_ENV['SERVER_VERSION'],
44 44
             )
45 45
         ) {
46
-            fwrite(STDERR, 'Faltan variables de entorno por definir' . PHP_EOL);
46
+            fwrite(STDERR, 'Faltan variables de entorno por definir'.PHP_EOL);
47 47
             exit(1);
48 48
         }
49 49
 
@@ -59,13 +59,13 @@  discard block
 block discarded – undo
59 59
             'serverVersion' => $_ENV['SERVER_VERSION'],
60 60
         ];
61 61
 
62
-        $entityDir = dirname(__DIR__, 2) . '/' . $_ENV['ENTITY_DIR'];
62
+        $entityDir = dirname(__DIR__, 2).'/'.$_ENV['ENTITY_DIR'];
63 63
         // $queryCache = new PhpFilesAdapter('doctrine_queries');
64 64
         // $metadataCache = new PhpFilesAdapter('doctrine_metadata');
65 65
         // $resultsCache = new PhpFilesAdapter('doctrine_results');
66 66
         $config = ORMSetup::createAttributeMetadataConfiguration(
67
-            paths: [ $entityDir ],            // paths to mapped entities
68
-            isDevMode: true,                  // developper mode
67
+            paths: [$entityDir], // paths to mapped entities
68
+            isDevMode: true, // developper mode
69 69
             proxyDir: (string) ini_get('sys_temp_dir') // Proxy dir
70 70
         );
71 71
         // $config->setQueryCache($queryCache);
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             self::$instance = new EntityManager($connection, $config);
82 82
         } catch (Throwable $e) {
83 83
             $msg = sprintf('ERROR (%d): %s', $e->getCode(), $e->getMessage());
84
-            fwrite(STDERR, $msg . PHP_EOL);
84
+            fwrite(STDERR, $msg.PHP_EOL);
85 85
             exit(1);
86 86
         }
87 87
 
Please login to merge, or discard this patch.