DX: apply rector rules up to php8.0

This commit is contained in:
2023-04-15 01:05:37 +02:00
parent d8870e906f
commit dde3002100
714 changed files with 2348 additions and 9263 deletions

View File

@@ -192,12 +192,7 @@ class Participation implements ArrayAccess, HasCenterInterface, HasScopeInterfac
}
}
/**
* @param mixed $offset
*
* @return bool
*/
public function offsetExists($offset): bool
public function offsetExists(mixed $offset): bool
{
return in_array($offset, [
'person', 'role', 'status', 'event',
@@ -205,33 +200,20 @@ class Participation implements ArrayAccess, HasCenterInterface, HasScopeInterfac
}
/**
* @param mixed $offset
*
* @return Event|Person|Role|Status
*/
public function offsetGet($offset): mixed
public function offsetGet(mixed $offset): mixed
{
switch ($offset) {
case 'person':
return $this->getPerson();
case 'role':
return $this->getRole();
case 'status':
return $this->getStatus();
case 'event':
return $this->getEvent();
default:
throw new \LogicException("this offset does not exists : " . $offset);
}
return match ($offset) {
'person' => $this->getPerson(),
'role' => $this->getRole(),
'status' => $this->getStatus(),
'event' => $this->getEvent(),
default => throw new \LogicException("this offset does not exists : " . $offset),
};
}
/**
* @param mixed $offset
* @param mixed $value
*
* @return void
*/
public function offsetSet($offset, $value): void
public function offsetSet(mixed $offset, mixed $value): void
{
switch ($offset) {
case 'person':
@@ -256,10 +238,7 @@ class Participation implements ArrayAccess, HasCenterInterface, HasScopeInterfac
}
}
/**
* @param mixed $offset
*/
public function offsetUnset($offset): void
public function offsetUnset(mixed $offset): void
{
$this->offsetSet($offset, null);
}