More code style fixes

This commit is contained in:
Timothy Warren 2018-01-17 16:33:57 -05:00
parent 38e3e6e686
commit e1a13f1ad2
6 changed files with 13 additions and 8 deletions

View File

@ -32,9 +32,9 @@ trait ContainerAware {
* Set the container for the current object * Set the container for the current object
* *
* @param ContainerInterface $container * @param ContainerInterface $container
* @return $this * @return self
*/ */
public function setContainer(ContainerInterface $container) public function setContainer(ContainerInterface $container): self
{ {
$this->container = $container; $this->container = $container;
return $this; return $this;

View File

@ -32,8 +32,8 @@ interface ContainerInterface {
* Finds an entry of the container by its identifier and returns it. * Finds an entry of the container by its identifier and returns it.
* *
* @param string $id Identifier of the entry to look for. * @param string $id Identifier of the entry to look for.
* @throws NotFoundException No entry was found for this identifier. * @throws Exception\NotFoundException No entry was found for this identifier.
* @throws ContainerException Error while retrieving the entry. * @throws Exception\ContainerException Error while retrieving the entry.
* @return mixed Entry. * @return mixed Entry.
*/ */
public function get($id); public function get($id);
@ -95,5 +95,5 @@ interface ContainerInterface {
* @param string $id The logger to retrieve * @param string $id The logger to retrieve
* @return LoggerInterface|null * @return LoggerInterface|null
*/ */
public function getLogger(string $id = 'default'); public function getLogger(string $id = 'default'): ?LoggerInterface;
} }

View File

@ -29,7 +29,7 @@ class DoubleRenderException extends LogicException {
* *
* @param string $message * @param string $message
* @param int $code * @param int $code
* @param null $previous * @param Exception|null $previous
*/ */
public function __construct(string $message = 'A view can only be rendered once, because headers can only be sent once.', int $code = 0, Exception $previous = NULL) public function __construct(string $message = 'A view can only be rendered once, because headers can only be sent once.', int $code = 0, Exception $previous = NULL)
{ {

View File

@ -24,7 +24,7 @@ use Stringy\Stringy;
class StringType extends Stringy { class StringType extends Stringy {
/** /**
* See if two strings match, despite being delemeted differently, * See if two strings match, despite being delimited differently,
* such as camelCase, PascalCase, kebab-case, or snake_case. * such as camelCase, PascalCase, kebab-case, or snake_case.
* *
* @param string $strToMatch * @param string $strToMatch

View File

@ -62,6 +62,7 @@ class HttpView extends BaseView {
* Set the status code of the request * Set the status code of the request
* *
* @param int $code * @param int $code
* @throws \InvalidArgumentException
* @return HttpView * @return HttpView
*/ */
public function setStatusCode(int $code): HttpView public function setStatusCode(int $code): HttpView
@ -88,6 +89,7 @@ class HttpView extends BaseView {
* Send the appropriate response * Send the appropriate response
* *
* @throws DoubleRenderException * @throws DoubleRenderException
* @throws \InvalidArgumentException
* @return void * @return void
*/ */
protected function output(): void protected function output(): void

View File

@ -35,11 +35,14 @@ class JsonView extends HttpView {
* Set the output string * Set the output string
* *
* @param mixed $string * @param mixed $string
* @throws \InvalidArgumentException
* @throws \RuntimeException
* @throws \Aviat\Ion\JsonException
* @return ViewInterface * @return ViewInterface
*/ */
public function setOutput($string): ViewInterface public function setOutput($string): ViewInterface
{ {
if ( ! is_string($string)) if ( ! \is_string($string))
{ {
$string = Json::encode($string); $string = Json::encode($string);
} }