Skip to content

Commit

Permalink
去掉默认样式的最后一个换行
Browse files Browse the repository at this point in the history
  • Loading branch information
qbhy committed Jul 23, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent f102c53 commit 4ab38cf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/FindMovies.php
Original file line number Diff line number Diff line change
@@ -64,14 +64,17 @@ public function handler(Collection $message)

public static function render($movies)
{
$str = '为您找到以下 ' . count($movies) . ' 部电影' . PHP_EOL;
$count = count($movies);
$str = '为您找到以下 ' . $count . ' 部电影' . PHP_EOL;
foreach ($movies as $key => $movie) {
$str .= ($key + 1) . ' ' . $movie['title'] . PHP_EOL;
$str .= ' 下载列表: ' . PHP_EOL;
foreach ($movie['downloads'] as $download) {
$str .= '' . $download['title'] . '' . $download['url'] . PHP_EOL;
}
$str .= PHP_EOL;
if ($key < $count) {
$str .= PHP_EOL;
}
}
return $str;
}

0 comments on commit 4ab38cf

Please sign in to comment.