diff --git a/src/Button.php b/src/Button.php index 8a68774..fed7737 100644 --- a/src/Button.php +++ b/src/Button.php @@ -11,15 +11,11 @@ */ final class Button implements View { - private Url $url; - private View $label; - private bool $selected; - - private function __construct(Url $url, View $label, bool $selected) - { - $this->url = $url; - $this->label = $label; - $this->selected = $selected; + private function __construct( + private Url $url, + private View $label, + private bool $selected, + ) { } /** diff --git a/src/Card.php b/src/Card.php index 2a7af56..c9a3f86 100644 --- a/src/Card.php +++ b/src/Card.php @@ -10,11 +10,8 @@ */ final class Card implements View { - private View $inner; - - private function __construct(View $inner) + private function __construct(private View $inner) { - $this->inner = $inner; } /** diff --git a/src/Center.php b/src/Center.php index 5a703b1..ffc8917 100644 --- a/src/Center.php +++ b/src/Center.php @@ -10,11 +10,8 @@ */ final class Center implements View { - private View $inner; - - private function __construct(View $inner) + private function __construct(private View $inner) { - $this->inner = $inner; } /** diff --git a/src/Grid.php b/src/Grid.php index 56a3df2..6621095 100644 --- a/src/Grid.php +++ b/src/Grid.php @@ -11,15 +11,11 @@ */ final class Grid implements View { - /** @var Sequence */ - private Sequence $cards; - /** * @param Sequence $cards */ - private function __construct(Sequence $cards) + private function __construct(private Sequence $cards) { - $this->cards = $cards; } /** diff --git a/src/Image.php b/src/Image.php index 11c36be..ec18818 100644 --- a/src/Image.php +++ b/src/Image.php @@ -11,11 +11,8 @@ */ final class Image implements View { - private Url $src; - - private function __construct(Url $src) + private function __construct(private Url $src) { - $this->src = $src; } /** diff --git a/src/Listing.php b/src/Listing.php index 524b897..01a2086 100644 --- a/src/Listing.php +++ b/src/Listing.php @@ -11,15 +11,11 @@ */ final class Listing implements View { - /** @var Sequence */ - private Sequence $elements; - /** * @param Sequence $elements */ - private function __construct(Sequence $elements) + private function __construct(private Sequence $elements) { - $this->elements = $elements; } /** diff --git a/src/NavigationLink.php b/src/NavigationLink.php index 6609085..6deb547 100644 --- a/src/NavigationLink.php +++ b/src/NavigationLink.php @@ -11,15 +11,11 @@ */ final class NavigationLink implements View { - private Url $url; - private View $label; - private bool $selected; - - private function __construct(Url $url, View $label, bool $selected) - { - $this->url = $url; - $this->label = $label; - $this->selected = $selected; + private function __construct( + private Url $url, + private View $label, + private bool $selected, + ) { } /** diff --git a/src/Picker.php b/src/Picker.php index b78dfb3..7fcec84 100644 --- a/src/Picker.php +++ b/src/Picker.php @@ -11,22 +11,14 @@ */ final class Picker implements View { - private \UnitEnum $selected; - /** @var Sequence */ - private Sequence $values; - private bool $disable; - /** * @param Sequence $values */ private function __construct( - \UnitEnum $selected, - Sequence $values, - bool $disable, + private \UnitEnum $selected, + private Sequence $values, + private bool $disable, ) { - $this->selected = $selected; - $this->values = $values; - $this->disable = $disable; } /** diff --git a/src/Picker/Value.php b/src/Picker/Value.php index 717be65..30139a7 100644 --- a/src/Picker/Value.php +++ b/src/Picker/Value.php @@ -11,17 +11,13 @@ */ final class Value { - /** @var T */ - private \UnitEnum $tag; - private View $view; - /** * @param T $tag */ - private function __construct(\UnitEnum $tag, View $view) - { - $this->tag = $tag; - $this->view = $view; + private function __construct( + private \UnitEnum $tag, + private View $view, + ) { } /** diff --git a/src/ScrollView.php b/src/ScrollView.php index fa1a9a8..7f8f598 100644 --- a/src/ScrollView.php +++ b/src/ScrollView.php @@ -10,11 +10,8 @@ */ final class ScrollView implements View { - private View $inner; - - private function __construct(View $inner) + private function __construct(private View $inner) { - $this->inner = $inner; } /** diff --git a/src/Shape/Kind.php b/src/Shape/Kind.php index 30d9bea..2a06e6a 100644 --- a/src/Shape/Kind.php +++ b/src/Shape/Kind.php @@ -15,13 +15,10 @@ */ final class Kind implements View { - private View $inner; - private string $kind; - - private function __construct(View $inner, string $kind) - { - $this->inner = $inner; - $this->kind = $kind; + private function __construct( + private View $inner, + private string $kind, + ) { } /** diff --git a/src/Stack.php b/src/Stack.php index ff45c0c..bd59286 100644 --- a/src/Stack.php +++ b/src/Stack.php @@ -11,17 +11,13 @@ */ final class Stack implements View { - private bool $horizontal; - /** @var Sequence */ - private Sequence $views; - /** * @param Sequence $views */ - private function __construct(bool $horizontal, Sequence $views) - { - $this->horizontal = $horizontal; - $this->views = $views; + private function __construct( + private bool $horizontal, + private Sequence $views, + ) { } /** diff --git a/src/Svg.php b/src/Svg.php index d67df9b..fd085db 100644 --- a/src/Svg.php +++ b/src/Svg.php @@ -10,11 +10,8 @@ */ final class Svg implements View { - private Content $data; - - private function __construct(Content $data) + private function __construct(private Content $data) { - $this->data = $data; } /** diff --git a/src/Text.php b/src/Text.php index 8627b8f..9ff887d 100644 --- a/src/Text.php +++ b/src/Text.php @@ -10,11 +10,8 @@ */ final class Text implements View { - private string $text; - - private function __construct(string $text) + private function __construct(private string $text) { - $this->text = $text; } /** diff --git a/src/Toolbar.php b/src/Toolbar.php index 46a9f75..3943e81 100644 --- a/src/Toolbar.php +++ b/src/Toolbar.php @@ -10,18 +10,11 @@ */ final class Toolbar implements View { - private View $label; - private ?View $leading; - private ?View $trailing; - private function __construct( - View $label, - ?View $leading, - ?View $trailing, + private View $label, + private ?View $leading, + private ?View $trailing, ) { - $this->label = $label; - $this->leading = $leading; - $this->trailing = $trailing; } /** diff --git a/src/View/Container.php b/src/View/Container.php index 39d3459..639fb2b 100644 --- a/src/View/Container.php +++ b/src/View/Container.php @@ -15,11 +15,8 @@ */ final class Container implements View { - private View $view; - - private function __construct(View $view) + private function __construct(private View $view) { - $this->view = $view; } /** diff --git a/src/Window.php b/src/Window.php index b838c65..65ce9a0 100644 --- a/src/Window.php +++ b/src/Window.php @@ -11,18 +11,11 @@ */ final class Window implements View { - private string $title; - private ?View $body; - private ?Url $style; - private function __construct( - string $title, - ?View $body, - ?Url $style, + private string $title, + private ?View $body, + private ?Url $style, ) { - $this->title = $title; - $this->body = $body; - $this->style = $style; } /** diff --git a/src/Zoom.php b/src/Zoom.php index acbea60..f64afd8 100644 --- a/src/Zoom.php +++ b/src/Zoom.php @@ -10,17 +10,13 @@ */ final class Zoom implements View { - private View $inner; - /** @var int<1, 100> */ - private int $size; - /** * @param int<1, 100> $size */ - private function __construct(View $inner, int $size) - { - $this->inner = $inner; - $this->size = $size; + private function __construct( + private View $inner, + private int $size, + ) { } /**