Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Center.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,11 @@
*/
final class Grid implements View
{
/** @var Sequence<Card> */
private Sequence $cards;

/**
* @param Sequence<Card> $cards
*/
private function __construct(Sequence $cards)
private function __construct(private Sequence $cards)
{
$this->cards = $cards;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Listing.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,11 @@
*/
final class Listing implements View
{
/** @var Sequence<View> */
private Sequence $elements;

/**
* @param Sequence<View> $elements
*/
private function __construct(Sequence $elements)
private function __construct(private Sequence $elements)
{
$this->elements = $elements;
}

/**
Expand Down
14 changes: 5 additions & 9 deletions src/NavigationLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

/**
Expand Down
14 changes: 3 additions & 11 deletions src/Picker.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,14 @@
*/
final class Picker implements View
{
private \UnitEnum $selected;
/** @var Sequence<Picker\Value> */
private Sequence $values;
private bool $disable;

/**
* @param Sequence<Picker\Value> $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;
}

/**
Expand Down
12 changes: 4 additions & 8 deletions src/Picker/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/ScrollView.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
11 changes: 4 additions & 7 deletions src/Shape/Kind.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

/**
Expand Down
12 changes: 4 additions & 8 deletions src/Stack.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@
*/
final class Stack implements View
{
private bool $horizontal;
/** @var Sequence<View> */
private Sequence $views;

/**
* @param Sequence<View> $views
*/
private function __construct(bool $horizontal, Sequence $views)
{
$this->horizontal = $horizontal;
$this->views = $views;
private function __construct(
private bool $horizontal,
private Sequence $views,
) {
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
13 changes: 3 additions & 10 deletions src/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/View/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
13 changes: 3 additions & 10 deletions src/Window.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
12 changes: 4 additions & 8 deletions src/Zoom.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

/**
Expand Down