This commit is contained in:
Pierre Rudloff 2020-09-27 15:53:53 +02:00
parent d38b1cd9aa
commit 8d15fbdda2
9 changed files with 25 additions and 21 deletions

View file

@ -185,7 +185,7 @@ class Config
*
* @return string
*/
public static function addHttpToFormat($format)
public static function addHttpToFormat(string $format)
{
$newFormat = [];
foreach (explode('/', $format) as $subformat) {
@ -279,7 +279,7 @@ class Config
* @return void
* @throws ConfigException
*/
public static function setFile($file)
public static function setFile(string $file)
{
if (is_file($file)) {
$options = Yaml::parse(strval(file_get_contents($file)));

View file

@ -144,7 +144,7 @@ abstract class BaseController
*
* @return Response HTTP response
*/
protected function displayError(Request $request, Response $response, $message)
protected function displayError(Request $request, Response $response, string $message)
{
$controller = new FrontController($this->container);

View file

@ -242,7 +242,7 @@ class FrontController extends BaseController
*
* @return Response HTTP response
*/
protected function displayError(Request $request, Response $response, $message)
protected function displayError(Request $request, Response $response, string $message)
{
$this->view->render(
$response,

View file

@ -34,7 +34,7 @@ class Locale
*
* @param string $locale ISO 15897 code
*/
public function __construct($locale)
public function __construct(string $locale)
{
$parse = AcceptLanguage::parse($locale);
$this->language = $parse[1]['language'];

View file

@ -142,11 +142,11 @@ class LocaleManager
* Smarty "t" block.
*
* @param mixed[] $params Block parameters
* @param string $text Block content
* @param string|null $text Block content
*
* @return string Translated string
*/
public function smartyTranslate(array $params, $text)
public function smartyTranslate(array $params, string $text = null)
{
if (isset($params['params'])) {
return $this->t($text, $params['params']);
@ -158,16 +158,20 @@ class LocaleManager
/**
* Translate a string.
*
* @param string $string String to translate
* @param string|null $string $string String to translate
*
* @param mixed[] $params
* @return string Translated string
*/
public function t($string, array $params = [])
public function t(string $string = null, array $params = [])
{
if (isset($string)) {
return $this->translator->trans($string, $params);
}
return '';
}
/**
* Get LocaleManager singleton instance.
*

View file

@ -79,7 +79,7 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface
/**
* Add data to the archive.
*
* @param string $data Data
* @param mixed $data Data
*
* @return void
*/
@ -99,7 +99,7 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface
/**
* Write data to the stream.
*
* @param string $string The string that is to be written
* @param mixed $string The string that is to be written
*
* @return int|false
*/
@ -171,7 +171,7 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface
/**
* Get stream metadata as an associative array or retrieve a specific key.
*
* @param string $key string $key Specific metadata to retrieve.
* @param string|null $key string $key Specific metadata to retrieve.
*
* @return array|mixed|null
*/
@ -228,7 +228,7 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface
/**
* Seek to a position in the stream.
*
* @param int $offset Offset
* @param mixed $offset Offset
* @param int $whence Specifies how the cursor position will be calculated
*
* @return void
@ -272,7 +272,7 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface
/**
* Read data from the stream.
*
* @param int $count Number of bytes to read
* @param mixed $count Number of bytes to read
*
* @return string|false
* @throws AlltubeLibraryException

View file

@ -35,7 +35,7 @@ class YoutubeChunkStream implements StreamInterface
/**
* Read data from the stream.
*
* @param int $length Read up to $length bytes from the object and return
* @param mixed $length Read up to $length bytes from the object and return
*
* @return string
*/
@ -121,7 +121,7 @@ class YoutubeChunkStream implements StreamInterface
/**
* Seek to a position in the stream.
*
* @param int $offset Stream offset
* @param mixed $offset Stream offset
* @param int $whence Specifies how the cursor position will be calculated
*
* @return void
@ -154,7 +154,7 @@ class YoutubeChunkStream implements StreamInterface
/**
* Write data to the stream.
*
* @param string $string The string that is to be written
* @param mixed $string The string that is to be written
*
* @return mixed
*/
@ -186,7 +186,7 @@ class YoutubeChunkStream implements StreamInterface
/**
* Get stream metadata as an associative array or retrieve a specific key.
*
* @param string $key Specific metadata to retrieve.
* @param string|null $key Specific metadata to retrieve.
*
* @return array|mixed|null
*/

View file

@ -42,7 +42,7 @@ class UglyRouter extends Router
/**
* Build the path for a named route including the base path.
*
* @param string $name Route name
* @param mixed $name Route name
* @param string[] $data Named argument replacement data
* @param string[] $queryParams Optional query string parameters
*

View file

@ -21,7 +21,7 @@ class ViewFactory
* Create Smarty view object.
*
* @param ContainerInterface $container Slim dependency container
* @param Request $request PSR-7 request
* @param Request|null $request PSR-7 request
*
* @return Smarty
* @throws SmartyException