Skip to content

Commit

Permalink
revert some function signature changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cconard96 authored and cedric-anne committed May 6, 2024
1 parent 269d6e2 commit 6fc43c3
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class Entity extends CommonTreeDropdown
'config' => ['enable_custom_css', 'custom_css_code']
];

public function getForbiddenStandardMassiveAction(): array
public function getForbiddenStandardMassiveAction()
{
$forbidden = parent::getForbiddenStandardMassiveAction();
$forbidden[] = 'delete';
Expand All @@ -172,7 +172,7 @@ public function getCloneRelations(): array
return [];
}

public function pre_updateInDB(): void
public function pre_updateInDB()
{
/** @var \DBmysql $DB */
global $DB;
Expand Down Expand Up @@ -201,7 +201,7 @@ public function pre_updateInDB(): void
}
}

public function pre_deleteItem(): bool
public function pre_deleteItem()
{
/** @var \Psr\SimpleCache\CacheInterface $GLPI_CACHE */
global $GLPI_CACHE;
Expand Down Expand Up @@ -229,36 +229,36 @@ public function pre_deleteItem(): bool
return true;
}

public static function getTypeName($nb = 0): string
public static function getTypeName($nb = 0)
{
return _n('Entity', 'Entities', $nb);
}

public static function canCreate(): bool
public static function canCreate()
{
// Do not show the create button if no recusive access on current entity
return parent::canCreate() && Session::haveRecursiveAccessToEntity(Session::getActiveEntity());
}

public function canCreateItem(): bool
public function canCreateItem()
{
// Check the parent
return Session::haveRecursiveAccessToEntity($this->getField('entities_id'));
}

public static function canUpdate(): bool
public static function canUpdate()
{
return (Session::haveRightsOr(self::$rightname, [UPDATE, self::UPDATEHELPDESK])
|| Session::haveRight('notification', UPDATE));
}

public function canUpdateItem(): bool
public function canUpdateItem()
{
// Check the current entity
return Session::haveAccessToEntity($this->getField('id'));
}

public function canViewItem(): bool
public function canViewItem()
{
// Check the current entity
return Session::haveAccessToEntity($this->getField('id'));
Expand All @@ -269,7 +269,7 @@ public static function isNewID($ID): bool
return (($ID < 0) || $ID === '');
}

public function maybeLocated(): true
public function maybeLocated()
{
return true;
}
Expand Down Expand Up @@ -323,7 +323,7 @@ private function checkRightDatas($input): array
/**
* @since 0.84 (before in entitydata.class)
**/
public function prepareInputForAdd($input): false|array
public function prepareInputForAdd($input)
{
/** @var \DBmysql $DB */
global $DB;
Expand Down Expand Up @@ -374,7 +374,7 @@ public function prepareInputForAdd($input): false|array
/**
* @since 0.84 (before in entitydata.class)
**/
public function prepareInputForUpdate($input): false|array
public function prepareInputForUpdate($input)
{
// Force entities_id = NULL for root entity
if ((int) $input['id'] === 0) {
Expand Down Expand Up @@ -3266,7 +3266,7 @@ public static function getSpecificValueToSelect($field, $name = '', $values = ''
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}

public function getRights($interface = 'central'): array
public function getRights($interface = 'central')
{
$values = parent::getRights();
$values[self::READHELPDESK] = ['short' => __('Read parameters'),
Expand Down

0 comments on commit 6fc43c3

Please sign in to comment.