Passed
Push — master ( 97f23a...e2c088 )
by F. Javier
01:50
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
 
@@ -78,33 +78,33 @@  discard block
 block discarded – undo
78 78
     public static function loadEnv(string $dir): void
79 79
     {
80 80
         /** @noinspection PhpIncludeInspection */
81
-        require_once $dir . '/vendor/autoload.php';
81
+        require_once $dir.'/vendor/autoload.php';
82 82
 
83 83
         if (!class_exists(\Dotenv\Dotenv::class)) {
84
-            fwrite(STDERR, 'ERROR: No se ha cargado la clase Dotenv' . PHP_EOL);
84
+            fwrite(STDERR, 'ERROR: No se ha cargado la clase Dotenv'.PHP_EOL);
85 85
             die(1);
86 86
         }
87 87
 
88 88
         try {
89 89
             // Load environment variables from .env file
90
-            if (file_exists($dir . '/.env')) {
90
+            if (file_exists($dir.'/.env')) {
91 91
                 $dotenv = \Dotenv\Dotenv::createMutable($dir, '.env');
92 92
                 $dotenv->load();
93 93
             } else {
94
-                fwrite(STDERR, 'ERROR: no existe el fichero .env' . PHP_EOL);
94
+                fwrite(STDERR, 'ERROR: no existe el fichero .env'.PHP_EOL);
95 95
                 die(1);
96 96
             }
97 97
 
98 98
             // Overload (if they exist) with .env.docker or .env.local
99
-            if (filter_has_var(INPUT_SERVER, 'DOCKER') && file_exists($dir . '/.env.docker')) {
99
+            if (filter_has_var(INPUT_SERVER, 'DOCKER') && file_exists($dir.'/.env.docker')) {
100 100
                 $dotenv = \Dotenv\Dotenv::createMutable($dir, '.env.docker');
101 101
                 $dotenv->load();
102
-            } elseif (file_exists($dir . '/.env.local')) {
102
+            } elseif (file_exists($dir.'/.env.local')) {
103 103
                 $dotenv = \Dotenv\Dotenv::createMutable($dir, '.env.local');
104 104
                 $dotenv->load();
105 105
             }
106 106
         } catch (\Throwable $e) {
107
-            die(get_class($e) . ': ' . $e->getMessage() . PHP_EOL);
107
+            die(get_class($e).': '.$e->getMessage().PHP_EOL);
108 108
         }
109 109
     }
110 110
 }
Please login to merge, or discard this patch.