More code style fixes
This commit is contained in:
parent
38e3e6e686
commit
e1a13f1ad2
@ -32,9 +32,9 @@ trait ContainerAware {
|
||||
* Set the container for the current object
|
||||
*
|
||||
* @param ContainerInterface $container
|
||||
* @return $this
|
||||
* @return self
|
||||
*/
|
||||
public function setContainer(ContainerInterface $container)
|
||||
public function setContainer(ContainerInterface $container): self
|
||||
{
|
||||
$this->container = $container;
|
||||
return $this;
|
||||
|
@ -32,8 +32,8 @@ interface ContainerInterface {
|
||||
* Finds an entry of the container by its identifier and returns it.
|
||||
*
|
||||
* @param string $id Identifier of the entry to look for.
|
||||
* @throws NotFoundException No entry was found for this identifier.
|
||||
* @throws ContainerException Error while retrieving the entry.
|
||||
* @throws Exception\NotFoundException No entry was found for this identifier.
|
||||
* @throws Exception\ContainerException Error while retrieving the entry.
|
||||
* @return mixed Entry.
|
||||
*/
|
||||
public function get($id);
|
||||
@ -95,5 +95,5 @@ interface ContainerInterface {
|
||||
* @param string $id The logger to retrieve
|
||||
* @return LoggerInterface|null
|
||||
*/
|
||||
public function getLogger(string $id = 'default');
|
||||
public function getLogger(string $id = 'default'): ?LoggerInterface;
|
||||
}
|
@ -29,7 +29,7 @@ class DoubleRenderException extends LogicException {
|
||||
*
|
||||
* @param string $message
|
||||
* @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)
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ use Stringy\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.
|
||||
*
|
||||
* @param string $strToMatch
|
||||
|
@ -62,6 +62,7 @@ class HttpView extends BaseView {
|
||||
* Set the status code of the request
|
||||
*
|
||||
* @param int $code
|
||||
* @throws \InvalidArgumentException
|
||||
* @return HttpView
|
||||
*/
|
||||
public function setStatusCode(int $code): HttpView
|
||||
@ -88,6 +89,7 @@ class HttpView extends BaseView {
|
||||
* Send the appropriate response
|
||||
*
|
||||
* @throws DoubleRenderException
|
||||
* @throws \InvalidArgumentException
|
||||
* @return void
|
||||
*/
|
||||
protected function output(): void
|
||||
|
@ -35,11 +35,14 @@ class JsonView extends HttpView {
|
||||
* Set the output string
|
||||
*
|
||||
* @param mixed $string
|
||||
* @throws \InvalidArgumentException
|
||||
* @throws \RuntimeException
|
||||
* @throws \Aviat\Ion\JsonException
|
||||
* @return ViewInterface
|
||||
*/
|
||||
public function setOutput($string): ViewInterface
|
||||
{
|
||||
if ( ! is_string($string))
|
||||
if ( ! \is_string($string))
|
||||
{
|
||||
$string = Json::encode($string);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user