Skip to content

Commit 6ecb1d9

Browse files
committed
use require_once instead of require
1 parent bfdcc5d commit 6ecb1d9

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

.php-cs-fixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
;
1212

1313
/** @var array $config */
14-
$config = require __DIR__ . '/vendor/chubbyphp/chubbyphp-dev-helper/phpcs.php';
14+
$config = require_once __DIR__ . '/vendor/chubbyphp/chubbyphp-dev-helper/phpcs.php';
1515

1616
$config['rules']['static_lambda'] = false;
1717

config/dev.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Chubbyphp\Cors\Negotiation\Origin\AllowOriginRegex;
66
use Monolog\Level;
77

8-
$config = require __DIR__.'/prod.php';
8+
$config = require_once __DIR__.'/prod.php';
99

1010
$config['chubbyphp']['cors']['allowOrigins']['^https?\:\/\/(localhost|127\.\d+.\d+.\d+)(\:\d+)?$'] = AllowOriginRegex::class;
1111
$config['debug'] = true;

config/phpunit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
$config = require __DIR__.'/dev.php';
5+
$config = require_once __DIR__.'/dev.php';
66
$config['doctrine']['dbal']['connection']['dbname'] .= '_phpunit';
77

88
return $config;

public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
use Slim\Psr7\Factory\ServerRequestFactory;
66

77
/** @var Slim\App $web */
8-
$web = (require __DIR__ . '/../src/web.php')(getenv('APP_ENV'));
8+
$web = (require_once __DIR__ . '/../src/web.php')(getenv('APP_ENV'));
99
$web->run((new ServerRequestFactory())->createFromGlobals());

src/console.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
use Symfony\Component\Console\Input\ArgvInput;
1212
use Symfony\Component\Console\Input\InputOption;
1313

14-
require __DIR__.'/../vendor/autoload.php';
14+
require_once __DIR__.'/../vendor/autoload.php';
1515

1616
$input = new ArgvInput();
1717

1818
$env = $input->getParameterOption(['--env', '-e'], 'dev');
1919

2020
/** @var ContainerInterface $container */
21-
$container = (require __DIR__.'/container.php')($env);
21+
$container = (require_once __DIR__.'/container.php')($env);
2222

2323
$console = new Application();
2424
$console->getDefinition()->addOption(

src/container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Chubbyphp\Laminas\Config\ContainerFactory;
99

1010
return static function (string $env) {
11-
$config = require __DIR__.'/../config/'.$env.'.php';
11+
$config = require_once __DIR__.'/../config/'.$env.'.php';
1212

1313
foreach ($config['directories'] ?? [] as $directory) {
1414
if (!is_dir($directory)) {

src/web.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
use Slim\Interfaces\RouteCollectorInterface;
2525
use Slim\Routing\RouteCollectorProxy;
2626

27-
require __DIR__.'/../vendor/autoload.php';
27+
require_once __DIR__.'/../vendor/autoload.php';
2828

2929
return static function (string $env) {
3030
/** @var ContainerInterface $container */
31-
$container = (require __DIR__.'/container.php')($env);
31+
$container = (require_once __DIR__.'/container.php')($env);
3232

3333
/** @var ResponseFactoryInterface $responseFactory */
3434
$responseFactory = $container->get(ResponseFactoryInterface::class);

0 commit comments

Comments
 (0)