Display tweets in a table
This commit is contained in:
parent
a02713b644
commit
91af0ef7f8
2 changed files with 12 additions and 2 deletions
src/Command
|
@ -37,6 +37,16 @@ class FetchTweetsCommand extends Command
|
|||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
dump($this->tweetFetcher->getTweets());
|
||||
$io->table(
|
||||
['Tweet', 'Author', 'Created', 'ID'],
|
||||
$this->tweetFetcher->getTweets()->map(function (array $tweet) {
|
||||
return [
|
||||
$tweet['text'],
|
||||
$tweet['author'],
|
||||
$tweet['created'],
|
||||
$tweet['id'],
|
||||
];
|
||||
})->all()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue