diff --git a/config/bootstrap.php b/config/bootstrap.php index 55560fb..1d758f4 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -2,22 +2,29 @@ use Symfony\Component\Dotenv\Dotenv; -require dirname(__DIR__).'/vendor/autoload.php'; +require dirname(__DIR__) . '/vendor/autoload.php'; if (!class_exists(Dotenv::class)) { - throw new LogicException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); + throw new LogicException( + 'Please run "composer require symfony/dotenv" to load the ".env" files + configuring the application.' + ); } // Load cached env vars if the .env.local.php file exists // Run "composer dump-env prod" to create it (requires symfony/flex >=1.2) -if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) { +if ( + is_array($env = @include dirname(__DIR__) . '/.env.local.php') && + (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV']) +) { (new Dotenv(false))->populate($env); } else { // load all the .env files - (new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env'); + (new Dotenv(false))->loadEnv(dirname(__DIR__) . '/.env'); } $_SERVER += $_ENV; $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev'; $_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV']; -$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0'; +$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] + || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0'; diff --git a/public/index.php b/public/index.php index 0e30370..1b7309a 100644 --- a/public/index.php +++ b/public/index.php @@ -4,7 +4,7 @@ use App\Kernel; use Symfony\Component\ErrorHandler\Debug; use Symfony\Component\HttpFoundation\Request; -require dirname(__DIR__).'/config/bootstrap.php'; +require dirname(__DIR__) . '/config/bootstrap.php'; if ($_SERVER['APP_DEBUG']) { umask(0000); @@ -13,7 +13,10 @@ if ($_SERVER['APP_DEBUG']) { } if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) { - Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST); + Request::setTrustedProxies( + explode(',', $trustedProxies), + Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST + ); } if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) { diff --git a/src/Collection/EventCollection.php b/src/Collection/EventCollection.php index 3d26995..1d27780 100644 --- a/src/Collection/EventCollection.php +++ b/src/Collection/EventCollection.php @@ -15,5 +15,4 @@ final class EventCollection extends Collection return !Arr::get($rsvp, 'member.event_context.host'); }); } - -} \ No newline at end of file +} diff --git a/src/Command/GetRaffleWinnerCommand.php b/src/Command/GetRaffleWinnerCommand.php index 6614144..f4b1d63 100644 --- a/src/Command/GetRaffleWinnerCommand.php +++ b/src/Command/GetRaffleWinnerCommand.php @@ -97,7 +97,7 @@ final class GetRaffleWinnerCommand extends Command '%s - %s', $this->eventData['group']['name'], $this->eventData['name'] - )); + )); $io->section(sprintf('%s \'yes\' RSVPs (excluding hosts)', $this->yesRsvps->count())); $io->listing($this->yesRsvps->pluck('member.name')->sort()->toArray()); @@ -192,5 +192,4 @@ final class GetRaffleWinnerCommand extends Command exec(sprintf('xdg-open %s', $photo)); } } - -} \ No newline at end of file +} diff --git a/src/Kernel.php b/src/Kernel.php index 1cd0572..a1db9a3 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -17,7 +17,7 @@ class Kernel extends BaseKernel public function registerBundles(): iterable { - $contents = require $this->getProjectDir().'/config/bundles.php'; + $contents = require $this->getProjectDir() . '/config/bundles.php'; foreach ($contents as $class => $envs) { if ($envs[$this->environment] ?? $envs['all'] ?? false) { yield new $class(); @@ -32,23 +32,23 @@ class Kernel extends BaseKernel protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void { - $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php')); + $container->addResource(new FileResource($this->getProjectDir() . '/config/bundles.php')); $container->setParameter('container.dumper.inline_class_loader', \PHP_VERSION_ID < 70400 || $this->debug); $container->setParameter('container.dumper.inline_factories', true); - $confDir = $this->getProjectDir().'/config'; + $confDir = $this->getProjectDir() . '/config'; - $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob'); - $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob'); - $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob'); - $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob'); + $loader->load($confDir . '/{packages}/*' . self::CONFIG_EXTS, 'glob'); + $loader->load($confDir . '/{packages}/' . $this->environment . '/*' . self::CONFIG_EXTS, 'glob'); + $loader->load($confDir . '/{services}' . self::CONFIG_EXTS, 'glob'); + $loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob'); } protected function configureRoutes(RouteCollectionBuilder $routes): void { - $confDir = $this->getProjectDir().'/config'; + $confDir = $this->getProjectDir() . '/config'; - $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob'); - $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob'); - $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob'); + $routes->import($confDir . '/{routes}/' . $this->environment . '/*' . self::CONFIG_EXTS, '/', 'glob'); + $routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, '/', 'glob'); + $routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob'); } }