diff --git a/src/Iterators/CachingIterator.php b/src/Iterators/CachingIterator.php index e2e5e4c1a..a389e0d8a 100644 --- a/src/Iterators/CachingIterator.php +++ b/src/Iterators/CachingIterator.php @@ -28,8 +28,7 @@ class CachingIterator extends \CachingIterator implements \Countable { use Nette\SmartObject; - /** @var int */ - private $counter = 0; + private int $counter = 0; public function __construct($iterator) diff --git a/src/Utils/ArrayList.php b/src/Utils/ArrayList.php index dd009036e..107b39cf0 100644 --- a/src/Utils/ArrayList.php +++ b/src/Utils/ArrayList.php @@ -19,8 +19,7 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate { use Nette\SmartObject; - /** @var mixed[] */ - private $list = []; + private array $list = []; /** diff --git a/src/Utils/Html.php b/src/Utils/Html.php index 77a637ab3..e4f0493cc 100644 --- a/src/Utils/Html.php +++ b/src/Utils/Html.php @@ -238,10 +238,9 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** @var array element's attributes */ public $attrs = []; - /** @var bool use XHTML syntax? */ - public static $xhtml = false; + public static bool $xhtml = false; - /** @var array void elements */ + /** void elements */ public static $emptyElements = [ 'img' => 1, 'hr' => 1, 'br' => 1, 'input' => 1, 'meta' => 1, 'area' => 1, 'embed' => 1, 'keygen' => 1, 'source' => 1, 'base' => 1, 'col' => 1, 'link' => 1, 'param' => 1, 'basefont' => 1, 'frame' => 1, @@ -251,11 +250,10 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** @var array nodes */ protected $children = []; - /** @var string element's name */ - private $name; + /** element's name */ + private string $name = ''; - /** @var bool is element empty? */ - private $isEmpty; + private bool $isEmpty = false; /** diff --git a/src/Utils/Image.php b/src/Utils/Image.php index 75650bc03..441f6729a 100644 --- a/src/Utils/Image.php +++ b/src/Utils/Image.php @@ -125,8 +125,7 @@ class Image private const FORMATS = [self::JPEG => 'jpeg', self::PNG => 'png', self::GIF => 'gif', self::WEBP => 'webp', self::BMP => 'bmp']; - /** @var resource|\GdImage */ - private $image; + private \GdImage $image; /** diff --git a/src/Utils/Paginator.php b/src/Utils/Paginator.php index 5b37ee3db..5a48a58b3 100644 --- a/src/Utils/Paginator.php +++ b/src/Utils/Paginator.php @@ -32,17 +32,13 @@ class Paginator { use Nette\SmartObject; - /** @var int */ - private $base = 1; + private int $base = 1; - /** @var int */ - private $itemsPerPage = 1; + private int $itemsPerPage = 1; - /** @var int */ - private $page = 1; + private int $page = 1; - /** @var int|null */ - private $itemCount; + private ?int $itemCount = null; /** diff --git a/tests/Utils/SmartObject.arrayProperty.phpt b/tests/Utils/SmartObject.arrayProperty.phpt index bc6f0ba1c..f935ff943 100644 --- a/tests/Utils/SmartObject.arrayProperty.phpt +++ b/tests/Utils/SmartObject.arrayProperty.phpt @@ -18,7 +18,7 @@ class TestClass { use Nette\SmartObject; - private $items = []; + private array $items = []; public function &getItems()