diff --git a/bin/console.php b/bin/console.php index 4d953e8..19bbd00 100644 --- a/bin/console.php +++ b/bin/console.php @@ -1,9 +1,24 @@ addDirectory(__DIR__ . '/../src/Commands', 'App\Commands'); + +$config = new GithubActionConfig(); +$commands = new GithubApiCommands($config); +$owner = new CodeOwnersFile(); + +$app->add(new Assignee($config, $commands)); +$app->add(new BranchNameConvention($config, $commands, $owner)); +$app->add(new CommitMessages($config, $commands)); +$app->add(new Labels($commands, $config)); $app->run(); diff --git a/composer.json b/composer.json index c8f77b1..23e8450 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,6 @@ "php": "^7.4.0|^8.0.0", "ext-curl": "*", "ext-json": "*", - "symfony/console": "^5.3.0", - "devorto/dependency-injection": "^2.0.0" + "symfony/console": "^5.3.0" } } diff --git a/composer.lock b/composer.lock index 27be8dc..686992f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,103 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f393e6701ee22dc28597a3b90af7c441", + "content-hash": "ab0d561c3e80259ec2231aecbf09b249", "packages": [ - { - "name": "devorto/dependency-injection", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/devorto/dependency-injection.git", - "reference": "f5670351d97428ed765a87cfc429d450582fae94" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/devorto/dependency-injection/zipball/f5670351d97428ed765a87cfc429d450582fae94", - "reference": "f5670351d97428ed765a87cfc429d450582fae94", - "shasum": "" - }, - "require": { - "devorto/key-value-storage": "^1.0.0", - "php": "^7.1.0||^8.0.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Devorto\\DependencyInjection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Devorto", - "email": "info@devorto.com", - "homepage": "https://www.devorto.com/", - "role": "Owner" - }, - { - "name": "Geoffrey Dijkstra", - "email": "geoffrey@devorto.com", - "role": "Developer" - } - ], - "description": "DependencyInjection for classes.", - "support": { - "issues": "https://github.com/devorto/dependency-injection/issues", - "source": "https://github.com/devorto/dependency-injection/tree/2.0.3" - }, - "time": "2021-08-11T07:59:47+00:00" - }, - { - "name": "devorto/key-value-storage", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/devorto/key-value-storage.git", - "reference": "32f3bb953e4d03470fc18e43c3c750824ee064bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/devorto/key-value-storage/zipball/32f3bb953e4d03470fc18e43c3c750824ee064bd", - "reference": "32f3bb953e4d03470fc18e43c3c750824ee064bd", - "shasum": "" - }, - "require": { - "php": "^7.1.0|^8.0.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Devorto\\KeyValueStorage\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Devorto", - "email": "info@devorto.com", - "homepage": "https://www.devorto.com/", - "role": "Owner" - }, - { - "name": "Geoffrey Dijkstra", - "email": "geoffrey@devorto.com", - "role": "Developer" - } - ], - "description": "Simple array-like key => value storage object.", - "support": { - "issues": "https://github.com/devorto/key-value-storage/issues", - "source": "https://github.com/devorto/key-value-storage/tree/1.0.1" - }, - "time": "2021-08-11T08:13:45+00:00" - }, { "name": "psr/container", "version": "1.1.1", diff --git a/src/Services/Application.php b/src/Services/Application.php deleted file mode 100644 index 36b4850..0000000 --- a/src/Services/Application.php +++ /dev/null @@ -1,70 +0,0 @@ -addDirectory($path, $namespacePrefix . '\\' . $file); - continue; - } - - if (substr($file, -4) !== '.php') { - continue; - } - - $file = substr($file, 0, -4); - $file = $namespacePrefix . '\\' . $file; - - try { - $class = new ReflectionClass($file); - if ($class->isInterface() || $class->isAbstract()) { - continue; - } - } catch (ReflectionException $exception) { - throw new RuntimeException("Cannot load class '$file' based on file name.", 0, $exception); - } - - /** @var Command $command */ - $command = DependencyInjection::instantiate($file); - $this->add($command); - } - - return $this; - } -}