Skip to content

Commit 8aca0a6

Browse files
committed
use require_once instead of require
1 parent 6cca73c commit 8aca0a6

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
return (new PhpCsFixer\Config)
1717
->setUnsupportedPhpVersionAllowed(true)

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
@@ -3,5 +3,5 @@
33
declare(strict_types=1);
44

55
/** @var Mezzio\Application $web */
6-
$web = (require __DIR__ . '/../src/web.php')(getenv('APP_ENV'));
6+
$web = (require_once __DIR__ . '/../src/web.php')(getenv('APP_ENV'));
77
$web->run();

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
@@ -28,11 +28,11 @@
2828
use Mezzio\Router\RouteCollector;
2929
use Psr\Container\ContainerInterface;
3030

31-
require __DIR__.'/../vendor/autoload.php';
31+
require_once __DIR__.'/../vendor/autoload.php';
3232

3333
return static function (string $env) {
3434
/** @var ContainerInterface $container */
35-
$container = (require __DIR__.'/container.php')($env);
35+
$container = (require_once __DIR__.'/container.php')($env);
3636

3737
/** @var MiddlewareFactory $middlewareFactory */
3838
$middlewareFactory = $container->get(MiddlewareFactory::class);

0 commit comments

Comments
 (0)