phpstan fixes

This commit is contained in:
Dennis Eichhorn 2019-09-29 01:12:58 +02:00
parent 8221d4b723
commit ac0503c6e9
4 changed files with 13 additions and 9 deletions

View File

@ -68,13 +68,14 @@ final class EventManager implements \Countable
{ {
$this->dispatcher = $dispatcher ?? new class() implements DispatcherInterface { $this->dispatcher = $dispatcher ?? new class() implements DispatcherInterface {
/** /**
* Dispatches a function * {@inheritdoc}
*
* @param \Closure $func Function
* @param mixed ...$data Date passed to function
*/ */
public function dispatch(\Closure $func, ...$data) : array public function dispatch($func, ...$data) : array
{ {
if (!($func instanceof \Closure)) {
return [];
}
$func(...$data); $func(...$data);
return []; return [];

View File

@ -170,6 +170,10 @@ class Localization
$files = \glob(__DIR__ . '/../Localization/Defaults/Definitions/' . $langCode . '_' . $countryCode); $files = \glob(__DIR__ . '/../Localization/Defaults/Definitions/' . $langCode . '_' . $countryCode);
if ($files === false) {
$files = [];
}
foreach ($files as $file) { foreach ($files as $file) {
$fileContent = \file_get_contents($file); $fileContent = \file_get_contents($file);

View File

@ -236,13 +236,12 @@ final class MeasureOfDispersion
--$count; --$count;
} }
/** @var int $count */
$count /= 2; $count /= 2;
\sort($x); \sort($x);
/** @var int $count */
$Q1 = Average::median(\array_slice($x, 0, $count)); $Q1 = Average::median(\array_slice($x, 0, $count));
/** @var int $count */
$Q3 = Average::median(\array_slice($x, -$count, $count)); $Q3 = Average::median(\array_slice($x, -$count, $count));
return $Q3 - $Q1; return $Q3 - $Q1;

View File

@ -37,10 +37,10 @@ abstract class HeaderAbstract
/** /**
* Localization. * Localization.
* *
* @var null|Localization * @var Localization
* @since 1.0.0 * @since 1.0.0
*/ */
protected ?Localization $l11n = null; protected Localization $l11n;
/** /**
* Account. * Account.