Improve typing

This commit is contained in:
Pierre Rudloff 2022-02-03 20:21:25 +01:00
parent d46563f994
commit b8c88aecf5
6 changed files with 11 additions and 11 deletions

View file

@ -154,7 +154,7 @@ class Config
/**
* Config constructor.
*
* @param mixed[] $options Options
* @param scalar[]|scalar[][]|null[] $options Options
* @throws ConfigException
*/
public function __construct(array $options = [])
@ -222,7 +222,7 @@ class Config
/**
* Apply the provided options.
*
* @param mixed[] $options Options
* @param scalar[]|scalar[][]|null[] $options Options
*
* @return void
*/
@ -278,7 +278,7 @@ class Config
/**
* Manually set some options.
*
* @param mixed[] $options Options (see `config/config.example.yml` for available options)
* @param scalar[]|scalar[][]|null[] $options Options (see `config/config.example.yml` for available options)
* @return void
* @throws ConfigException
*/

View file

@ -145,7 +145,7 @@ class FrontController extends BaseController
* @return Response HTTP response
* @throws AlltubeLibraryException
*/
private function getInfoResponse(Request $request, Response $response)
private function getInfoResponse(Request $request, Response $response): Response
{
try {
$this->video->getJson();

View file

@ -135,14 +135,14 @@ class LocaleManager
/**
* Smarty "t" block.
*
* @param mixed[] $params Block parameters
* @param string[]|string[][] $params Block parameters
* @param string|null $text Block content
*
* @return string Translated string
*/
public function smartyTranslate(array $params, string $text = null): string
{
if (isset($params['params'])) {
if (isset($params['params']) && is_array($params['params'])) {
return $this->t($text, $params['params']);
} else {
return $this->t($text);
@ -154,7 +154,7 @@ class LocaleManager
*
* @param string|null $string $string String to translate
*
* @param mixed[] $params
* @param string[] $params
* @return string Translated string
*/
public function t(string $string = null, array $params = []): string

View file

@ -38,7 +38,7 @@ class LocaleMiddleware
/**
* Test if a locale can be used for the current user.
*
* @param mixed[] $proposedLocale Locale array created by AcceptLanguage::parse()
* @param string[] $proposedLocale Locale array created by AcceptLanguage::parse()
*
* @return Locale|null Locale if chosen, nothing otherwise
*/

View file

@ -156,9 +156,9 @@ class YoutubeChunkStream implements StreamInterface
*
* @param mixed $string The string that is to be written
*
* @return mixed
* @return int
*/
public function write($string)
public function write($string): int
{
return $this->response->getBody()->write($string);
}

View file

@ -22,7 +22,7 @@ class UglyRouter extends Router
*
* @param ServerRequestInterface $request The current HTTP request object
*
* @return mixed[]
* @return int[]|string[]|array[]
*
* @link https://github.com/nikic/FastRoute/blob/master/src/Dispatcher.php
*/