Skip to content

Commit c9c86ed

Browse files
committed
Removed debug code
1 parent 42930cd commit c9c86ed

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

.github/workflows/docs-invalid-use.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ name: Verify docs
33
on:
44
schedule:
55
- cron: '58 6 * * *'
6-
# This is just for test
7-
pull_request: ~
8-
push:
9-
branches:
10-
- master
116

127
jobs:
138
use:

.github/workflows/docs-invalid-use/run.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@
6767
error_log("We found nothing\n");
6868
}
6969

70-
echo "foo".PHP_EOL;
71-
echo "bar".PHP_EOL;
72-
7370
exit(0);
7471

7572
function getBlocklist(): array

src/Command/OpenIssueCommand.php

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace App\Command;
66

7+
use App\Api\Issue\IssueApi;
8+
use App\Service\RepositoryProvider;
79
use Symfony\Component\Console\Command\Command;
810
use Symfony\Component\Console\Input\InputArgument;
911
use Symfony\Component\Console\Input\InputInterface;
@@ -17,10 +19,14 @@
1719
class OpenIssueCommand extends Command
1820
{
1921
protected static $defaultName = 'app:issue:open';
22+
private $issueApi;
23+
private $repositoryProvider;
2024

21-
public function __construct()
25+
public function __construct(RepositoryProvider $repositoryProvider, IssueApi $issueApi)
2226
{
2327
parent::__construct();
28+
$this->issueApi = $issueApi;
29+
$this->repositoryProvider = $repositoryProvider;
2430
}
2531

2632
protected function configure()
@@ -34,23 +40,23 @@ protected function execute(InputInterface $input, OutputInterface $output)
3440
{
3541
/** @var string $repositoryName */
3642
$repositoryName = $input->getArgument('repository');
43+
$repository = $this->repositoryProvider->getRepository($repositoryName);
44+
if (null === $repository) {
45+
$output->writeln('Repository not configured');
46+
return 1;
47+
}
48+
3749
/** @var string $title */
3850
$title = $input->getArgument('title');
3951
/** @var string $filePath */
4052
$filePath = $input->getArgument('file');
53+
4154
$body = file_get_contents($filePath);
4255
if (false === $body) {
4356
return 1;
4457
}
4558

46-
// These outputs are just debug code
47-
$output->writeln('Will create an issue on '.$repositoryName.' with the following:');
48-
$output->writeln('------');
49-
$output->writeln($title);
50-
$output->writeln($body);
51-
$output->writeln('------');
52-
53-
// TODO actually open or update an issue
59+
$this->issueApi->open($repository, $title, $body, ['help wanted']);
5460

5561
return 0;
5662
}

0 commit comments

Comments
 (0)