fix php < 8.0

master
Jean-Christian Paul Denis 2021-09-12 10:46:26 +02:00
parent 214e5cb9b3
commit 43a3e37c61
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
3 changed files with 10 additions and 7 deletions

View File

@ -6,6 +6,9 @@
- [ ] add module to check directory structure - [ ] add module to check directory structure
- [ ] add DA badge to module _gitshields_ - [ ] add DA badge to module _gitshields_
0.1.1
- fix php < 8.0
0.1 - 2021.09.11 0.1 - 2021.09.11
- First release - First release

View File

@ -72,17 +72,17 @@ abstract class ImproveAction
return self::$notice[get_called_class()][$error ? 'error' : 'warning']; return self::$notice[get_called_class()][$error ? 'error' : 'warning'];
} }
final public function __get(string $property): mixed final public function __get(string $property)
{ {
return $this->getProperty($property); return $this->getProperty($property);
} }
final public function getProperty(string $property): mixed final public function getProperty(string $property)
{ {
return $this->properties[$property] ?? null; return $this->properties[$property] ?? null;
} }
final protected function setProperties(mixed $property, mixed $value = null): bool final protected function setProperties($property, $value = null): bool
{ {
$properties = is_array($property) ? $property : [$property => $value]; $properties = is_array($property) ? $property : [$property => $value];
foreach($properties as $k => $v) { foreach($properties as $k => $v) {
@ -96,12 +96,12 @@ abstract class ImproveAction
return true; return true;
} }
final protected function getPreference(string $preference): mixed final protected function getPreference(string $preference)
{ {
return $this->preferences[$preference] ?? null; return $this->preferences[$preference] ?? null;
} }
final protected function setPreferences(mixed $preference, mixed $value = null) final protected function setPreferences $preference, $value = null)
{ {
$preferences = is_array($preference) ? $preference : [$preference => $value]; $preferences = is_array($preference) ? $preference : [$preference => $value];
foreach($preferences as $k => $v) { foreach($preferences as $k => $v) {
@ -131,7 +131,7 @@ abstract class ImproveAction
public static function create(arrayObject $o, dcCore $core) public static function create(arrayObject $o, dcCore $core)
{ {
$o->append(new (get_called_class())($core)); $o->append(new ${get_called_class()}($core));
} }
public function configure(string $redirect_url): ?string public function configure(string $redirect_url): ?string

View File

@ -167,7 +167,7 @@ class Improve
return $this->core->adminurl->get('admin.plugin.improve', $params); return $this->core->adminurl->get('admin.plugin.improve', $params);
} }
public static function cleanExtensions(mixed $in): array public static function cleanExtensions($in): array
{ {
$out = []; $out = [];
if (!is_array($in)) { if (!is_array($in)) {