@@ -26,33 +26,33 @@ |
||
26 | 26 | public static function loadEnv(string $dir): void |
27 | 27 | { |
28 | 28 | /** @noinspection PhpIncludeInspection */ |
29 | - require_once $dir . '/vendor/autoload.php'; |
|
29 | + require_once $dir.'/vendor/autoload.php'; |
|
30 | 30 | |
31 | 31 | if (!class_exists(Dotenv::class)) { |
32 | - fwrite(STDERR, 'ERROR: No se ha cargado la clase Dotenv' . PHP_EOL); |
|
32 | + fwrite(STDERR, 'ERROR: No se ha cargado la clase Dotenv'.PHP_EOL); |
|
33 | 33 | exit(1); |
34 | 34 | } |
35 | 35 | |
36 | 36 | try { |
37 | 37 | // Load environment variables from .env file |
38 | - if (file_exists($dir . '/.env')) { |
|
38 | + if (file_exists($dir.'/.env')) { |
|
39 | 39 | $dotenv = Dotenv::createMutable($dir, '.env'); |
40 | 40 | $dotenv->load(); |
41 | 41 | } else { |
42 | - fwrite(STDERR, 'ERROR: no existe el fichero .env' . PHP_EOL); |
|
42 | + fwrite(STDERR, 'ERROR: no existe el fichero .env'.PHP_EOL); |
|
43 | 43 | exit(1); |
44 | 44 | } |
45 | 45 | |
46 | 46 | // Overload (if they exist) with .env.docker or .env.local |
47 | - if (filter_has_var(INPUT_SERVER, 'DOCKER') && file_exists($dir . '/.env.docker')) { |
|
47 | + if (filter_has_var(INPUT_SERVER, 'DOCKER') && file_exists($dir.'/.env.docker')) { |
|
48 | 48 | $dotenv = Dotenv::createMutable($dir, '.env.docker'); |
49 | 49 | $dotenv->load(); |
50 | - } elseif (file_exists($dir . '/.env.local')) { |
|
50 | + } elseif (file_exists($dir.'/.env.local')) { |
|
51 | 51 | $dotenv = Dotenv::createMutable($dir, '.env.local'); |
52 | 52 | $dotenv->load(); |
53 | 53 | } |
54 | 54 | } catch (Throwable $e) { |
55 | - fwrite(STDERR, 'EXCEPCIÓN: ' . $e->getCode() . ' - ' . $e->getMessage()); |
|
55 | + fwrite(STDERR, 'EXCEPCIÓN: '.$e->getCode().' - '.$e->getMessage()); |
|
56 | 56 | exit(1); |
57 | 57 | } |
58 | 58 | } |
@@ -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,12 +55,12 @@ 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 | $config = Setup::createAnnotationMetadataConfiguration( |
60 | - [ $entityDir ], // paths to mapped entities |
|
61 | - false, // developper mode |
|
62 | - ini_get('sys_temp_dir'), // Proxy dir |
|
63 | - null, // Cache implementation |
|
60 | + [$entityDir], // paths to mapped entities |
|
61 | + false, // developper mode |
|
62 | + ini_get('sys_temp_dir'), // Proxy dir |
|
63 | + null, // Cache implementation |
|
64 | 64 | false // use Simple Annotation Reader |
65 | 65 | ); |
66 | 66 | $config->setAutoGenerateProxyClasses(true); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $entityManager = EntityManager::create($dbParams, $config); |
70 | 70 | } catch (Throwable $e) { |
71 | 71 | $msg = sprintf('ERROR (%d): %s', $e->getCode(), $e->getMessage()); |
72 | - fwrite(STDERR, $msg . PHP_EOL); |
|
72 | + fwrite(STDERR, $msg.PHP_EOL); |
|
73 | 73 | exit(1); |
74 | 74 | } |
75 | 75 |