mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-25 19:28:51 +02:00
Fixed some more phpstan issues
This commit is contained in:
parent
2f46fbfc7a
commit
e8771ea118
77 changed files with 192 additions and 109 deletions
|
@ -172,19 +172,13 @@ class PermissionPresetsHelper
|
|||
return $perm_holder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @phpstan-api
|
||||
*/
|
||||
private function AllForbid(HasPermissionsInterface $perm_holder): HasPermissionsInterface
|
||||
private function allForbid(HasPermissionsInterface $perm_holder): HasPermissionsInterface
|
||||
{
|
||||
$this->permissionResolver->setAllPermissions($perm_holder, PermissionData::DISALLOW);
|
||||
return $perm_holder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @phpstan-api
|
||||
*/
|
||||
private function AllAllow(HasPermissionsInterface $perm_holder): HasPermissionsInterface
|
||||
private function allAllow(HasPermissionsInterface $perm_holder): HasPermissionsInterface
|
||||
{
|
||||
$this->permissionResolver->setAllPermissions($perm_holder, PermissionData::ALLOW);
|
||||
return $perm_holder;
|
||||
|
|
|
@ -65,8 +65,6 @@ class PermissionSchemaUpdater
|
|||
$reflectionClass = new \ReflectionClass(self::class);
|
||||
try {
|
||||
$method = $reflectionClass->getMethod('upgradeSchemaToVersion'.($n + 1));
|
||||
//Set the method accessible, so we can call it (needed for PHP < 8.1)
|
||||
$method->setAccessible(true);
|
||||
$method->invoke($this, $holder);
|
||||
} catch (\ReflectionException $e) {
|
||||
throw new \RuntimeException('Could not find update method for schema version '.($n + 1), $e->getCode(), $e);
|
||||
|
@ -114,7 +112,7 @@ class PermissionSchemaUpdater
|
|||
return $updated;
|
||||
}
|
||||
|
||||
private function upgradeSchemaToVersion1(HasPermissionsInterface $holder): void
|
||||
private function upgradeSchemaToVersion1(HasPermissionsInterface $holder): void //@phpstan-ignore-line This is called via reflection
|
||||
{
|
||||
//Use the part edit permission to set the preset value for the new part stock permission
|
||||
if (
|
||||
|
@ -131,7 +129,7 @@ class PermissionSchemaUpdater
|
|||
}
|
||||
}
|
||||
|
||||
private function upgradeSchemaToVersion2(HasPermissionsInterface $holder): void
|
||||
private function upgradeSchemaToVersion2(HasPermissionsInterface $holder): void //@phpstan-ignore-line This is called via reflection
|
||||
{
|
||||
//If the projects permissions are not defined yet, rename devices permission to projects (just copy its data over)
|
||||
if (!$holder->getPermissions()->isAnyOperationOfPermissionSet('projects')) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue