DX: fix phpstan errors

This commit is contained in:
2023-02-04 00:50:58 +01:00
parent a01cc23c14
commit 856eea37ee
16 changed files with 94 additions and 120 deletions

View File

@@ -197,7 +197,7 @@ class Participation implements ArrayAccess, HasCenterInterface, HasScopeInterfac
*
* @return bool
*/
public function offsetExists($offset)
public function offsetExists($offset): bool
{
return in_array($offset, [
'person', 'role', 'status', 'event',
@@ -207,30 +207,21 @@ class Participation implements ArrayAccess, HasCenterInterface, HasScopeInterfac
/**
* @param mixed $offset
*
* @return Event|mixed|Person|Role|Status
* @return Event|Person|Role|Status
*/
public function offsetGet($offset)
public function offsetGet($offset): mixed
{
switch ($offset) {
case 'person':
return $this->getPerson();
break;
case 'role':
return $this->getRole();
break;
case 'status':
return $this->getStatus();
break;
case 'event':
return $this->getEvent();
break;
default:
throw new \LogicException("this offset does not exists : " . $offset);
}
}
@@ -238,28 +229,28 @@ class Participation implements ArrayAccess, HasCenterInterface, HasScopeInterfac
* @param mixed $offset
* @param mixed $value
*
* @return Participation|void
* @return void
*/
public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
switch ($offset) {
case 'person':
return $this->setPerson($value);
$this->setPerson($value);
break;
case 'role':
return $this->setRole($value);
$this->setRole($value);
break;
case 'status':
return $this->setStatus($value);
$this->setStatus($value);
break;
case 'event':
return $this->setEvent($value);
$this->setEvent($value);
break;
}
@@ -268,7 +259,7 @@ class Participation implements ArrayAccess, HasCenterInterface, HasScopeInterfac
/**
* @param mixed $offset
*/
public function offsetUnset($offset)
public function offsetUnset($offset): void
{
$this->offsetSet($offset, null);
}