Skip to content

Commit

Permalink
remove container, as simple enough
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jun 18, 2024
1 parent f35bae6 commit 1d690a4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 21 deletions.
16 changes: 7 additions & 9 deletions bin/rng.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

declare(strict_types=1);

use Illuminate\Container\Container;
use Rector\ReleaseNotesGenerator\ChangelogContentsFactory;
use Rector\ReleaseNotesGenerator\Command\GenerateCommand;
use Rector\ReleaseNotesGenerator\GithubApiCaller;
use Rector\ReleaseNotesGenerator\GitResolver;
use Symfony\Component\Console\Application;

$possibleAutoloadPaths = [
Expand All @@ -21,17 +22,14 @@
}
}

$gitResolver = new GitResolver();
$githubApiCaller = new GithubApiCaller();
$changelogContentsFactory = new ChangelogContentsFactory();

$container = new Container();
$container->when(GithubApiCaller::class)
->needs('$githubToken')
->give(getenv('GITHUB_TOKEN'));


$generateChangelogCommand = $container->make(GenerateCommand::class);
$generateCommand = new GenerateCommand($gitResolver, $githubApiCaller, $changelogContentsFactory);

$application = new Application();
$application->add($generateChangelogCommand);
$application->add($generateCommand);
$application->setDefaultCommand('generate', true);

exit($application->run());
10 changes: 4 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,18 @@
"require": {
"php": "^8.2",
"symfony/console": "^6.4|^7.0",
"illuminate/container": "^10.39",
"nategood/httpful": "^0.3.2",
"webmozart/assert": "^1.11",
"nette/utils": "^3.2|^4.0",
"symfony/process": "^6.4|^7.0"
},
"require-dev": {
"rector/rector": "^1.0",
"symplify/easy-coding-standard": "^12.1",
"rector/rector": "^1.1",
"symplify/easy-coding-standard": "^12.3",
"phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^10.5",
"phpstan/phpstan-webmozart-assert": "^1.2.2",
"phpstan/extension-installer": "^1.3",
"symplify/phpstan-extensions": "^11.4"
"phpstan/extension-installer": "^1.3"
},
"autoload": {
"psr-4": {
Expand All @@ -43,6 +41,6 @@
"scripts": {
"check-cs": "vendor/bin/ecs check --ansi",
"fix-cs": "vendor/bin/ecs check --fix --ansi",
"phpstan": "vendor/bin/phpstan analyse --ansi --error-format symplify"
"phpstan": "vendor/bin/phpstan analyse --ansi"
}
}
6 changes: 5 additions & 1 deletion ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
return ECSConfig::configure()
->withPreparedSets(symplify: true, common: true, cleanCode: true, psr12: true)
->withRootFiles()
->withPaths([__DIR__ . '/src', __DIR__ . '/tests']);
->withPaths([
__DIR__ . '/bin',
__DIR__ . '/src',
__DIR__ . '/tests',
]);
5 changes: 0 additions & 5 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,3 @@ parameters:
- bin
- src
- tests

ignoreErrors:
-
message: '#Parameter \#1 \$implementation of method Illuminate\\Contracts\\Container\\ContextualBindingBuilder\:\:give\(\) expects array\|Closure\|string, string\|false given#'
path: bin/rng.php

0 comments on commit 1d690a4

Please sign in to comment.