Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion bin/castor
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env php
<?php

use Castor\Console\Application;
use Castor\Console\ApplicationFactory;

$memoryLimit = $_SERVER['CASTOR_MEMORY_LIMIT'] ?? false;
Expand Down
11 changes: 9 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"symfony/cache": "^7.4.5",
"symfony/config": "^7.4.4",
"symfony/console": "^7.4.4",
"symfony/dependency-injection": "^7.4.5",
"symfony/dependency-injection": "dev-di-kernel",
"symfony/deprecation-contracts": "^3.6.0",
"symfony/dotenv": "^7.4.0",
"symfony/error-handler": "^7.4.4",
Expand All @@ -58,19 +58,26 @@
"symfony/string": "^7.4.4",
"symfony/translation-contracts": "^3.6.1",
"symfony/var-dumper": "^7.4.4",
"symfony/var-exporter": "^8.1.x-dev",
"symfony/yaml": "^7.4.1"
},
"require-dev": {
"phpunit/php-code-coverage": "^11.0.12",
"phpunit/phpunit": "^11.5.53"
},
"repositories": [
{
"url": "../symfony/symfony/src/Symfony/Component/DependencyInjection",
"type": "path"
}
],
"bin": [
"bin/castor"
],
"config": {
"bump-after-update": true,
"platform": {
"php": "8.2.27"
"php": "8.5"
},
"sort-packages": true
}
Expand Down
89 changes: 32 additions & 57 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ parameters:
count: 1
path: examples/basic/assertion/ensure.php

-
message: '#^Class RepackedApplication not found\.$#'
identifier: class.notFound
count: 1
path: src/Console/ApplicationFactory.php

-
message: '#^Default value of the parameter \#1 \$data \(array\{\}\) of method Castor\\Context\:\:__construct\(\) is incompatible with type array\{name\: string, production\: bool, foo\?\: string\}\.$#'
identifier: parameter.defaultValue
Expand Down
11 changes: 1 addition & 10 deletions src/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Castor\Console;

use Castor\Container;
use Castor\Exception\ProblemException;
use Castor\Kernel;
use Castor\Runner\ProcessRunner;
Expand All @@ -16,7 +15,6 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Process\Exception\ProcessFailedException;

/** @internal */
Expand All @@ -30,7 +28,6 @@ class Application extends SymfonyApplication
private Command $command;

public function __construct(
private readonly ContainerBuilder $containerBuilder,
private readonly Kernel $kernel,
#[Autowire(lazy: true)]
private readonly SymfonyStyle $io,
Expand Down Expand Up @@ -58,13 +55,7 @@ public function doRun(InputInterface $input, OutputInterface $output): int
return parent::doRun($input, $output);
}

$this->containerBuilder->set(InputInterface::class, $input);
$this->containerBuilder->set(OutputInterface::class, $output);

// @phpstan-ignore argument.type
Container::set($this->containerBuilder->get(Container::class));

$this->kernel->boot($input, $output);
$this->kernel->init($input, $output);

try {
return parent::doRun($input, $output);
Expand Down
Loading
Loading