Passed
Push — master ( ffa2b7...97f23a )
by F. Javier
07:20
created
src/Utility/Utils.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
             $_ENV['DATABASE_PASSWD'],
30 30
             $_ENV['ENTITY_DIR']
31 31
         )) {
32
-            fwrite(STDERR, 'Faltan variables de entorno por definir' . PHP_EOL);
32
+            fwrite(STDERR, 'Faltan variables de entorno por definir'.PHP_EOL);
33 33
             die(1);
34 34
         }
35 35
 
@@ -45,12 +45,12 @@  discard block
 block discarded – undo
45 45
         ];
46 46
 
47 47
         $debug = $_ENV['DEBUG'] ?? false;
48
-        $entityDir = dirname(__DIR__, 2) . $_ENV['ENTITY_DIR'];
48
+        $entityDir = dirname(__DIR__, 2).$_ENV['ENTITY_DIR'];
49 49
         $config = Setup::createAnnotationMetadataConfiguration(
50
-            [ $entityDir ],            // paths to mapped entities
51
-            $debug,                    // developper mode
52
-            ini_get('sys_temp_dir'),   // Proxy dir
53
-            null,                      // Cache implementation
50
+            [$entityDir], // paths to mapped entities
51
+            $debug, // developper mode
52
+            ini_get('sys_temp_dir'), // Proxy dir
53
+            null, // Cache implementation
54 54
             false                      // use Simple Annotation Reader
55 55
         );
56 56
         $config->setAutoGenerateProxyClasses(true);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             $entityManager = EntityManager::create($dbParams, $config);
63 63
         } catch (\Throwable $e) {
64 64
             $msg = sprintf('ERROR (%d): %s', $e->getCode(), $e->getMessage());
65
-            fwrite(STDERR, $msg . PHP_EOL);
65
+            fwrite(STDERR, $msg.PHP_EOL);
66 66
             die(1);
67 67
         }
68 68
 
@@ -77,33 +77,33 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public static function loadEnv(string $dir): void
79 79
     {
80
-        require_once $dir . '/vendor/autoload.php';
80
+        require_once $dir.'/vendor/autoload.php';
81 81
 
82 82
         if (!class_exists(\Dotenv\Dotenv::class)) {
83
-            fwrite(STDERR, 'ERROR: No se ha cargado la clase Dotenv' . PHP_EOL);
83
+            fwrite(STDERR, 'ERROR: No se ha cargado la clase Dotenv'.PHP_EOL);
84 84
             die(1);
85 85
         }
86 86
 
87 87
         try {
88 88
             // Load environment variables from .env file
89
-            if (file_exists($dir . '/.env')) {
89
+            if (file_exists($dir.'/.env')) {
90 90
                 $dotenv = \Dotenv\Dotenv::createMutable($dir, '.env');
91 91
                 $dotenv->load();
92 92
             } else {
93
-                fwrite(STDERR, 'ERROR: no existe el fichero .env' . PHP_EOL);
93
+                fwrite(STDERR, 'ERROR: no existe el fichero .env'.PHP_EOL);
94 94
                 die(1);
95 95
             }
96 96
 
97 97
             // Overload (if they exist) with .env.docker or .env.local
98
-            if (isset($_SERVER['DOCKER']) && file_exists($dir . '/.env.docker')) {
98
+            if (isset($_SERVER['DOCKER']) && file_exists($dir.'/.env.docker')) {
99 99
                 $dotenv = \Dotenv\Dotenv::createMutable($dir, '.env.docker');
100 100
                 $dotenv->load();
101
-            } elseif (file_exists($dir . '/.env.local')) {
101
+            } elseif (file_exists($dir.'/.env.local')) {
102 102
                 $dotenv = \Dotenv\Dotenv::createMutable($dir, '.env.local');
103 103
                 $dotenv->load();
104 104
             }
105 105
         } catch (\Throwable $e) {
106
-            die(get_class($e) . ': ' . $e->getMessage() . PHP_EOL);
106
+            die(get_class($e).': '.$e->getMessage().PHP_EOL);
107 107
         }
108 108
     }
109 109
 }
Please login to merge, or discard this patch.