Skip to content

Commit 2b3b5d6

Browse files
Modified arguments in functions for new null system in php 8.4 (#1826)
* feat: updated yarn.lock * fix: All nulls added and test passed successfully * Delete yarn.lock --------- Co-authored-by: luanfreitasdev <[email protected]>
1 parent 5c7261e commit 2b3b5d6

File tree

7 files changed

+7
-6685
lines changed

7 files changed

+7
-6685
lines changed

src/Column.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public function visibleInExport(?bool $visible): Column
239239
public function editOnClick(
240240
bool $hasPermission = true,
241241
string $dataField = '',
242-
string $fallback = null,
242+
?string $fallback = null,
243243
bool $saveOnMouseOut = false
244244
): Column {
245245
$this->editable = [

src/Components/Rules/RuleCheckbox.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class RuleCheckbox extends BaseRule
99
/**
1010
* Sets the button's given attribute to the given value.
1111
*/
12-
public function setAttribute(string $attribute = null, string $value = null): self
12+
public function setAttribute(?string $attribute = null, ?string $value = null): self
1313
{
1414
$this->setModifier('setAttribute', [
1515
'attribute' => $attribute,

src/Components/Rules/RuleRadio.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class RuleRadio extends BaseRule
88

99
/**Sets the radio's given attribute to the given value
1010
*/
11-
public function setAttribute(string $attribute = null, string $value = null): self
11+
public function setAttribute(?string $attribute = null, ?string $value = null): self
1212
{
1313
$this->setModifier('setAttribute', [
1414
'attribute' => $attribute,

src/DataSource/Support/Sql.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Sql
1414
*/
1515
private static array $sortStringNumberTypes = ['string', 'varchar', 'char'];
1616

17-
public static function like(EloquentBuilder|QueryBuilder $query = null): string
17+
public static function like(EloquentBuilder|QueryBuilder|null $query = null): string
1818
{
1919
if ($query) {
2020
/** @phpstan-ignore-next-line */

src/PowerGridFields.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ final class PowerGridFields
1616
* @param Closure|null $closure
1717
* @return $this
1818
*/
19-
public function add(string $fieldName, Closure $closure = null): PowerGridFields
19+
public function add(string $fieldName, ?Closure $closure = null): PowerGridFields
2020
{
2121
$this->fields[$fieldName] = $closure ?? fn ($model) => $this->valueIsString(data_get($model, $fieldName));
2222

src/Providers/Macros.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static function columns(): void
9999
return $this;
100100
});
101101

102-
Column::macro('naturalSort', function (bool $when = false, string $tableName = null) {
102+
Column::macro('naturalSort', function (bool $when = false, ?string $tableName = null) {
103103
$this->enableSort();
104104

105105
if ($when) {
@@ -208,7 +208,7 @@ public static function actions(): void
208208
return $this;
209209
});
210210

211-
Button::macro('id', function (string $id = null) {
211+
Button::macro('id', function (?string $id = null) {
212212
$this->attributes([
213213
'id' => $id,
214214
]);

yarn.lock

-6,678
This file was deleted.

0 commit comments

Comments
 (0)