for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the NNTP library.
*
* (c) Robin van der Vleuten <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Rvdv\Nntp\Command;
use Rvdv\Nntp\Exception\RuntimeException;
use Rvdv\Nntp\Response\MultiLineResponse;
use Rvdv\Nntp\Response\Response;
/**
* BodyCommand.
* @author thebandit
class BodyCommand extends Command implements CommandInterface
{
* @var string
private $article;
* Constructor.
* @param string $article the number or msg-id of the article
public function __construct($article)
$this->article = $article;
parent::__construct(true);
}
* {@inheritdoc}
public function __invoke()
return sprintf('BODY %s', $this->article);
* @return string
public function onBodyFollows(MultiLineResponse $response)
return implode("\r\n", $response->getLines()->toArray());
toArray
$response->getLines()
array
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.
public function onNoNewsGroupCurrentSelected(Response $response)
throw new RuntimeException('A group must be selected first before getting an article body.', $response->getStatusCode());
public function onNoSuchArticleNumber(Response $response)
throw new RuntimeException('No article with that number.', $response->getStatusCode());
public function onNoSuchArticleId(Response $response)
throw new RuntimeException('No article with that message-id.', $response->getStatusCode());
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.