1
0
mirror of https://github.com/Rudloff/alltube.git synced 2024-06-29 07:50:53 +02:00

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. * Config constructor.
* *
* @param mixed[] $options Options * @param scalar[]|scalar[][]|null[] $options Options
* @throws ConfigException * @throws ConfigException
*/ */
public function __construct(array $options = []) public function __construct(array $options = [])
@ -222,7 +222,7 @@ class Config
/** /**
* Apply the provided options. * Apply the provided options.
* *
* @param mixed[] $options Options * @param scalar[]|scalar[][]|null[] $options Options
* *
* @return void * @return void
*/ */
@ -278,7 +278,7 @@ class Config
/** /**
* Manually set some options. * 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 * @return void
* @throws ConfigException * @throws ConfigException
*/ */

View File

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

View File

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

View File

@ -22,7 +22,7 @@ class UglyRouter extends Router
* *
* @param ServerRequestInterface $request The current HTTP request object * @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 * @link https://github.com/nikic/FastRoute/blob/master/src/Dispatcher.php
*/ */