Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
22 | protected function execute(InputInterface $input, OutputInterface $output): int |
||
23 | { |
||
24 | /** @var int|null $tweet_id */ |
||
25 | $tweet_id = $input->getArgument('tweet_id'); |
||
26 | |||
27 | $connection = new TwitterOAuth( |
||
28 | (string) $this->container->getParameter('twitter_consumer_key'), |
||
29 | (string) $this->container->getParameter('twitter_consumer_secret'), |
||
30 | (string) $this->container->getParameter('twitter_token'), |
||
31 | (string) $this->container->getParameter('twitter_token_secret') |
||
32 | ); |
||
33 | |||
34 | /** @var string $json */ |
||
35 | $json = json_encode($connection->get(sprintf( |
||
36 | 'statuses/show/%d', |
||
37 | $tweet_id |
||
38 | ))); |
||
39 | |||
40 | $output->writeln($json); |
||
41 | |||
42 | return 0; |
||
43 | } |
||
44 | } |
||
45 |