Skip to content

Commit

Permalink
PHP 7.* compatibility
Browse files Browse the repository at this point in the history
Union types not supported before PHP 8.0
  • Loading branch information
ngunyimacharia authored Jun 2, 2022
1 parent 0bf96f7 commit 2b16a7b
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@ class Button extends Field

public $showOnCreation = false;

public string|null $text = null;
public ?string $text = null;

public string|null $key = null;
public ?string $key = null;

public array $config = [];

public string|null $style = null;
public ?string $style = null;

public string|null $loadingText = null;
public ?string $loadingText = null;

public string|null $loadingStyle = null;
public ?string $loadingStyle = null;

public string|null $successText = null;
public ?string $successText = null;

public string|null $successStyle = null;
public ?string $successStyle = null;

public string|null $errorText = null;
public ?string $errorText = null;

public string|null $errorStyle = null;
public ?string $errorStyle = null;

public array|null $confirm = null;
public ?array $confirm = null;

public bool $reload = false;

Expand All @@ -46,27 +46,27 @@ class Button extends Field

public bool $disabled = false;

public string|null $title = null;
public ?string $title = null;

public string|null $label = null;
public ?string $label = null;

public string|null $indexName = null;
public ?string $indexName = null;

public array $classes = [];

public string|null $type = null;
public ?string $type = null;

public array|null $route = null;
public ?array $route = null;

public array|null $link = null;
public ?array $link = null;

public string $indexAlign = 'left';

public string|null $loadingClasses = null;
public ?string $loadingClasses = null;

public string|null $successClasses = null;
public ?string $successClasses = null;

public string|null $errorClasses = null;
public ?string $errorClasses = null;

/**
* Create a new field.
Expand Down Expand Up @@ -132,7 +132,7 @@ protected function addLinkFallbacks(): void
* Resolve the field's value.
*
* @param mixed $resource
* @param string|null $attribute
* @param ?string $attribute
* @return void
*/
public function resolve($resource, $attribute = null): void
Expand Down Expand Up @@ -173,9 +173,9 @@ public function resolve($resource, $attribute = null): void
/**
* Enable the confirmation button type.
*
* @param string|null $message1
* @param string|null $message2
* @param string|null $cancelButtonText
* @param ?string $message1
* @param ?string $message2
* @param ?string $cancelButtonText
* @return $this
*/
public function confirm(?string $message1 = null, ?string $message2 = null, ?string $cancelButtonText = null): self
Expand Down Expand Up @@ -318,7 +318,7 @@ public function label(string $label): self
/**
* Set the index name.
*
* @param string|null $indexName
* @param ?string $indexName
* @return $this
*/
public function indexName(?string $indexName = null): self
Expand Down

0 comments on commit 2b16a7b

Please sign in to comment.