Skip to content

Commit d220985

Browse files
committed
Refactor for PHP 8.4
1 parent 90cec91 commit d220985

File tree

11 files changed

+13
-13
lines changed

11 files changed

+13
-13
lines changed

contracts/Element/FilterElement.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ interface FilterElement
1313
/**
1414
* defineScope adds a scope to the filter element
1515
*/
16-
public function defineScope(string $scopeName = null, string $label = null): ScopeDefinition;
16+
public function defineScope(string $scopeName, ?string $label = null): ScopeDefinition;
1717
}

contracts/Element/FormElement.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface FormElement
1414
/**
1515
* addFormField adds a field to the fieldset
1616
*/
17-
public function addFormField(string $fieldName = null, string $label = null): FieldDefinition;
17+
public function addFormField(string $fieldName, ?string $label = null): FieldDefinition;
1818

1919
/**
2020
* getFormFieldset returns the current fieldset definition

contracts/Element/ListElement.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ interface ListElement
1313
/**
1414
* defineColumn adds a column to the list element
1515
*/
16-
public function defineColumn(string $columnName = null, string $label = null): ColumnDefinition;
16+
public function defineColumn(string $columnName, ?string $label = null): ColumnDefinition;
1717
}

src/Assetic/Asset/AssetCache.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function getValues()
190190
*
191191
* @return string A key for identifying the current asset
192192
*/
193-
protected static function getCacheKey(AssetInterface $asset, FilterInterface $additionalFilter = null, $salt = '')
193+
protected static function getCacheKey(AssetInterface $asset, ?FilterInterface $additionalFilter = null, $salt = '')
194194
{
195195
if ($additionalFilter) {
196196
$asset = clone $asset;

src/Assetic/Combiner.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function resetFilters($extension = null)
190190
/**
191191
* getFilters returns all defined filters for a given extension
192192
*/
193-
public function getFilters(string $extension = null, $isProduction = false): array
193+
public function getFilters(?string $extension = null, bool $isProduction = false): array
194194
{
195195
if ($isProduction) {
196196
if ($extension === null) {

src/Database/Model.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ public function getSaveOption($key, $default = null)
420420
* @param null $sessionKey
421421
* @return bool
422422
*/
423-
public function save(array $options = null, $sessionKey = null)
423+
public function save(array $options = [], $sessionKey = null)
424424
{
425425
return $this->saveInternal((array) $options + ['sessionKey' => $sessionKey]);
426426
}

src/Database/Relations/DefinedConstraints.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function addDefinedConstraints(): void
2626
/**
2727
* addDefinedConstraintsToRelation
2828
*/
29-
public function addDefinedConstraintsToRelation($relation, array $args = null)
29+
public function addDefinedConstraintsToRelation($relation, ?array $args = null)
3030
{
3131
if ($args === null) {
3232
$args = $this->getRelationDefinitionForDefinedConstraints();
@@ -72,7 +72,7 @@ public function addDefinedConstraintsToRelation($relation, array $args = null)
7272
/**
7373
* addDefinedConstraintsToQuery
7474
*/
75-
public function addDefinedConstraintsToQuery($query, array $args = null)
75+
public function addDefinedConstraintsToQuery($query, ?array $args = null)
7676
{
7777
if ($args === null) {
7878
$args = $this->getRelationDefinitionForDefinedConstraints();

src/Halcyon/Datasource/Resolver.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ public function __construct(array $datasources = [])
3131
/**
3232
* datasource instance
3333
*/
34-
public function datasource(string $name = null): DatasourceInterface
34+
public function datasource(?string $name = null): DatasourceInterface
3535
{
36-
if (is_null($name)) {
36+
if ($name === null) {
3737
$name = $this->getDefaultDatasource();
3838
}
3939

src/Halcyon/Datasource/ResolverInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface ResolverInterface
1111
/**
1212
* datasource instance
1313
*/
14-
public function datasource(string $name = null): DatasourceInterface;
14+
public function datasource(?string $name = null): DatasourceInterface;
1515

1616
/**
1717
* getDefaultDatasource name

src/Html/HtmlBuilder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class HtmlBuilder
2525
* @param \Illuminate\Routing\UrlGenerator $url
2626
* @return void
2727
*/
28-
public function __construct(UrlGenerator $url = null)
28+
public function __construct(?UrlGenerator $url = null)
2929
{
3030
$this->url = $url;
3131
}

src/Support/helpers.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ function e($value, $doubleEncode = false)
258258
return $value->toHtml();
259259
}
260260

261-
return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', $doubleEncode);
261+
return htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8', $doubleEncode);
262262
}
263263
}
264264

0 commit comments

Comments
 (0)