Skip to content

Commit f198163

Browse files
Luke TowersLuke Towers
authored andcommitted
Improve PHP 8.4 support
1 parent 91849ff commit f198163

6 files changed

Lines changed: 8 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ _ide_helper.php
3030
# Other ignores
3131
.DS_Store
3232
package-lock.json
33+
.phpunit.cache
3334
/node_modules
3435

3536
# Ignore generated public directory from `winter:mirror public`

modules/cms/classes/CmsObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public static function inTheme($theme)
202202
* @param array $options
203203
* @return bool
204204
*/
205-
public function save(array $options = null)
205+
public function save(?array $options = null)
206206
{
207207
try {
208208
parent::save($options);

modules/system/classes/PluginManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ public function getReplacementMap(): array
710710
/**
711711
* Returns the actively replaced plugins defined in $this->activeReplacementMap
712712
*/
713-
public function getActiveReplacementMap(PluginBase|string $plugin = null): array|string|null
713+
public function getActiveReplacementMap(PluginBase|string|null $plugin = null): array|string|null
714714
{
715715
if ($plugin) {
716716
return $this->normalizedMap[

modules/system/classes/UpdateManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ public function updatePlugin($name)
603603
* @param string $stopOnVersion If this parameter is specified, the process stops once the provided version number is reached
604604
* @return self
605605
*/
606-
public function rollbackPlugin(string $name, string $stopOnVersion = null)
606+
public function rollbackPlugin(string $name, ?string $stopOnVersion = null)
607607
{
608608
/*
609609
* Remove the plugin database and version

modules/system/traits/AssetMaker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function flushAssets(): void
5151
* Outputs `<link>` and `<script>` tags to load assets previously added
5252
* with addJs, addCss, & addRss method calls depending on the provided $type
5353
*/
54-
public function makeAssets(string $type = null): ?string
54+
public function makeAssets(?string $type = null): ?string
5555
{
5656
if ($type != null) {
5757
$type = strtolower($type);

modules/system/traits/ViewMaker.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function makeView(string $view): string
132132
/**
133133
* Renders supplied contents inside a layout.
134134
*/
135-
public function makeViewContent(string $contents, string $layout = null): string
135+
public function makeViewContent(string $contents, ?string $layout = null): string
136136
{
137137
if ($this->suppressLayout || $this->layout == '') {
138138
return $contents;
@@ -148,7 +148,7 @@ public function makeViewContent(string $contents, string $layout = null): string
148148
* Render a layout, defaulting to the layout propery specified on the class
149149
* @return string|bool The layout contents, or false.
150150
*/
151-
public function makeLayout(string $name = null, array $params = [], bool $throwException = true): string|bool
151+
public function makeLayout(?string $name = null, array $params = [], bool $throwException = true): string|bool
152152
{
153153
$layout = $name ?? $this->layout;
154154
if ($layout == '') {
@@ -188,7 +188,7 @@ public function makeLayoutPartial(string $partial, array $params = []): string
188188
*
189189
* If the fileName cannot be found it will be returned unmodified.
190190
*/
191-
public function getViewPath(string $fileName, string|array $viewPaths = null): string
191+
public function getViewPath(string $fileName, string|array|null $viewPaths = null): string
192192
{
193193
$input = $fileName;
194194
$allowedExtensions = ['php', 'htm'];

0 commit comments

Comments
 (0)