diff --git a/Log/FileLogger.php b/Log/FileLogger.php index 904d8b9b2..2efa3b162 100644 --- a/Log/FileLogger.php +++ b/Log/FileLogger.php @@ -70,7 +70,7 @@ class FileLogger implements LoggerInterface * * Potential values are null or a valid file pointer * - * @var resource + * @var resource|false * @since 1.0.0 */ private $fp = false; diff --git a/Math/Shape/D2/Polygon.php b/Math/Shape/D2/Polygon.php index f9848c150..e9f887ca5 100644 --- a/Math/Shape/D2/Polygon.php +++ b/Math/Shape/D2/Polygon.php @@ -28,7 +28,7 @@ namespace phpOMS\Math\Shape\D2; * @link http://orange-management.com * @since 1.0.0 */ -class Polygon implements Shape2DInterface +class Polygon implements ShapeInterface { /** @@ -39,7 +39,7 @@ class Polygon implements Shape2DInterface * @var array[] * @since 1.0.0 */ - private $coord = null; + private $coord = []; /** * Polygon perimeter. @@ -47,7 +47,7 @@ class Polygon implements Shape2DInterface * @var float * @since 1.0.0 */ - private $perimeter = null; + private $perimeter = 0.0; /** * Polygon surface. @@ -55,15 +55,15 @@ class Polygon implements Shape2DInterface * @var float * @since 1.0.0 */ - private $surface = null; + private $surface = 0.0; /** * Interior angle sum of the polygon. * - * @var float + * @var int * @since 1.0.0 */ - private $interiorAngleSum = null; + private $interiorAngleSum = 0; /** * Exterior angle sum of the polygon. @@ -71,7 +71,7 @@ class Polygon implements Shape2DInterface * @var float * @since 1.0.0 */ - private $exteriorAngleSum = null; + private $exteriorAngleSum = 0.0; /** * Polygon barycenter. @@ -79,7 +79,7 @@ class Polygon implements Shape2DInterface * @var float[] * @since 1.0.0 */ - private $barycenter = null; + private $barycenter = ['x' => 0.0, 'y' => 0.0]; /** * Polygon edge length. @@ -87,7 +87,7 @@ class Polygon implements Shape2DInterface * @var float * @since 1.0.0 */ - private $edgeLength = []; + private $edgeLength = 0.0; /** * Polygon inner length. @@ -95,15 +95,15 @@ class Polygon implements Shape2DInterface * @var float * @since 1.0.0 */ - private $innerLength = null; + private $innerLength = 0.0; /** * Polygon inner edge angular. * - * @var float + * @var int * @since 1.0.0 */ - private $innerEdgeAngular = null; + private $innerEdgeAngular = 0; /** * Constructor. @@ -150,7 +150,7 @@ class Polygon implements Shape2DInterface /** * {@inheritdoc} */ - public function getInteriorAngleSum() + public function getInteriorAngleSum() : int { $this->interiorAngleSum = (count($this->coord) - 2) * 180; @@ -184,9 +184,9 @@ class Polygon implements Shape2DInterface /** * {@inheritdoc} */ - public function getSurface() + public function getSurface() : float { - $this->surface = 0; + $this->surface = 0.0; $count = count($this->coord); for ($i = 0; $i < $count - 2; $i++) { @@ -214,14 +214,14 @@ class Polygon implements Shape2DInterface */ public function reset() { - $this->coord = null; - $this->barycenter = null; - $this->perimeter = null; - $this->surface = null; - $this->interiorAngleSum = null; - $this->edgeLength = null; - $this->innerLength = null; - $this->innerEdgeAngular = null; + $this->coord = []; + $this->barycenter = ['x' => 0.0, 'y' => 0.0]; + $this->perimeter = 0.0; + $this->surface = 0.0; + $this->interiorAngleSum = 0; + $this->edgeLength = 0.0; + $this->innerLength = 0.0; + $this->innerEdgeAngular = 0; } /** diff --git a/Message/Http/Response.php b/Message/Http/Response.php index 9dc4b5a59..4809a13a8 100644 --- a/Message/Http/Response.php +++ b/Message/Http/Response.php @@ -158,14 +158,14 @@ class Response extends ResponseAbstract implements RenderableInterface /** * Set response. * - * @param string $response Response to set + * @param array $response Response to set * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setResponse(string $response) + public function setResponse(array $response) { $this->response = $response; } diff --git a/Message/ResponseAbstract.php b/Message/ResponseAbstract.php index fe4b834d0..c54d694b6 100644 --- a/Message/ResponseAbstract.php +++ b/Message/ResponseAbstract.php @@ -53,7 +53,7 @@ abstract class ResponseAbstract implements MessageInterface, ArrayableInterface, /** * Response status. * - * @var int + * @var string * @since 1.0.0 */ protected $status = 200; diff --git a/Stdlib/PriorityQueue.php b/Stdlib/PriorityQueue.php index fa829c33d..8034ae597 100644 --- a/Stdlib/PriorityQueue.php +++ b/Stdlib/PriorityQueue.php @@ -197,7 +197,7 @@ class PriorityQueue implements \Countable, \Serializable /** * {@inheritdoc} */ - public function unserialize($data) : array + public function unserialize(array $data) : array { $this->queue = json_decode($data); $this->count = count($this->queue); diff --git a/System/File/FileAbstract.php b/System/File/FileAbstract.php index 51267a314..0206e10e5 100644 --- a/System/File/FileAbstract.php +++ b/System/File/FileAbstract.php @@ -36,7 +36,7 @@ abstract class FileAbstract private $size = 0; private $createdAt = null; private $changedAt = null; - private $owner = ''; + private $owner = 0; private $permission = '0000'; public function __construct(string $path) @@ -83,7 +83,7 @@ abstract class FileAbstract return $this->changedAt; } - public function getOwner() : string + public function getOwner() : int { return $this->owner; } diff --git a/Utils/Converter/Currency.php b/Utils/Converter/Currency.php index 5b3e65064..68824de1d 100644 --- a/Utils/Converter/Currency.php +++ b/Utils/Converter/Currency.php @@ -32,7 +32,7 @@ class Currency /** * ECB currency rates. * - * @var array + * @var array|null * @since 1.0.0 */ private static $ecbCurrencies = null; diff --git a/Views/View.php b/Views/View.php index 74f8c5a3b..1c6b62cad 100644 --- a/Views/View.php +++ b/Views/View.php @@ -43,7 +43,7 @@ class View implements RenderableInterface * @var string * @since 1.0.0 */ - protected $template = null; + protected $template = ''; /** * Views. @@ -64,7 +64,7 @@ class View implements RenderableInterface /** * View Localization. * - * @var array + * @var Localization * @since 1.0.0 */ protected $l11n = null; @@ -231,7 +231,7 @@ class View implements RenderableInterface * * @param string $id View ID * @param View $view - * @param null|int $order Order of view + * @param int $order Order of view * @param bool $overwrite Overwrite existing view * * @return void @@ -239,13 +239,13 @@ class View implements RenderableInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function addView(string $id, View $view, $order = null, bool $overwrite = true) + public function addView(string $id, View $view, int $order = 0, bool $overwrite = true) { if ($overwrite || !isset($this->views[$id])) { $this->views[$id] = $view; - if ($order !== null) { - $this->views = uasort($this->views, ['\phpOMS\Views\View', 'viewSort']); + if ($order !== 0) { + uasort($this->views, ['\phpOMS\Views\View', 'viewSort']); } } }