mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 02:23:51 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user