@@ -29,7 +29,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $_ENV['ENTITY_DIR'] |
41 | 41 | ) |
42 | 42 | ) { |
43 | - fwrite(STDERR, 'Faltan variables de entorno por definir' . PHP_EOL); |
|
43 | + fwrite(STDERR, 'Faltan variables de entorno por definir'.PHP_EOL); |
|
44 | 44 | exit(1); |
45 | 45 | } |
46 | 46 | |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | 'charset' => $_ENV['DATABASE_CHARSET'] ?? 'UTF8', |
56 | 56 | ]; |
57 | 57 | |
58 | - $entityDir = dirname(__DIR__, 2) . '/' . $_ENV['ENTITY_DIR']; |
|
58 | + $entityDir = dirname(__DIR__, 2).'/'.$_ENV['ENTITY_DIR']; |
|
59 | 59 | $debug = $_ENV['DEBUG'] ?? false; |
60 | 60 | $config = Setup::createAnnotationMetadataConfiguration( |
61 | - [ $entityDir ], // paths to mapped entities |
|
62 | - $debug, // developper mode |
|
63 | - ini_get('sys_temp_dir'), // Proxy dir |
|
64 | - null, // Cache implementation |
|
61 | + [$entityDir], // paths to mapped entities |
|
62 | + $debug, // developper mode |
|
63 | + ini_get('sys_temp_dir'), // Proxy dir |
|
64 | + null, // Cache implementation |
|
65 | 65 | false // use Simple Annotation Reader |
66 | 66 | ); |
67 | 67 | $config->setAutoGenerateProxyClasses(true); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $entityManager = EntityManager::create($dbParams, $config); |
74 | 74 | } catch (Throwable $e) { |
75 | 75 | $msg = sprintf('ERROR (%d): %s', $e->getCode(), $e->getMessage()); |
76 | - fwrite(STDERR, $msg . PHP_EOL); |
|
76 | + fwrite(STDERR, $msg.PHP_EOL); |
|
77 | 77 | exit(1); |
78 | 78 | } |
79 | 79 |