Skip to content

Commit 040a81c

Browse files
PHP 8.4: Change implicit nullable type declaration to explicit
Since PHP 8.4 implicitly nullable parameter types are deprecated.
1 parent 563b322 commit 040a81c

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

library/Graphite/Graphing/MetricsQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __construct(MetricsDataSource $dataSource)
6262
$this->dataSource = $dataSource;
6363
}
6464

65-
public function from($target, array $fields = null)
65+
public function from($target, ?array $fields = null)
6666
{
6767
if ($fields !== null) {
6868
throw new InvalidArgumentException('Fields are not applicable to this kind of query');

library/Graphite/Util/TimeRangePickerTools.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static function getAllRangeParameters()
4141
*
4242
* @return UrlParams The copy
4343
*/
44-
public static function copyAllRangeParameters(UrlParams $copy = null, UrlParams $origin = null)
44+
public static function copyAllRangeParameters(?UrlParams $copy = null, ?UrlParams $origin = null)
4545
{
4646
if ($origin === null) {
4747
$origin = Url::fromRequest()->getParams();

library/Graphite/Web/Controller/TimeRangePickerTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ trait TimeRangePickerTrait
2323
/**
2424
* Process the given request using the forms
2525
*
26-
* @param Request $request The request to be processed
26+
* @param ?Request $request The request to be processed
2727
*
2828
* @return Request The request supposed to be processed
2929
*/
30-
protected function handleTimeRangePickerRequest(Request $request = null)
30+
protected function handleTimeRangePickerRequest(?Request $request = null)
3131
{
3232
$this->getTimeRangePickerCommonForm()->handleRequest($request);
3333
return $this->getTimeRangePickerCustomForm()->handleRequest($request);

library/Graphite/Web/Widget/Graphs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ public function __construct($object)
204204
/**
205205
* Process the given request using this widget
206206
*
207-
* @param Request $request The request to be processed
207+
* @param ?Request $request The request to be processed
208208
*
209209
* @return $this
210210
*/
211-
public function handleRequest(Request $request = null)
211+
public function handleRequest(?Request $request = null)
212212
{
213213
if ($request === null) {
214214
$request = Icinga::app()->getRequest();

0 commit comments

Comments
 (0)