mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-10 10:24:31 +02:00
Fixed code style.
This commit is contained in:
parent
2853e471c4
commit
d0b1024d80
212 changed files with 495 additions and 1005 deletions
|
@ -115,7 +115,7 @@ class ElementPermissionListener
|
|||
);
|
||||
|
||||
//Check if user is allowed to read info, otherwise apply placeholder
|
||||
if ((null !== $annotation) && ! $this->isGranted('read', $annotation, $element)) {
|
||||
if ((null !== $annotation) && !$this->isGranted('read', $annotation, $element)) {
|
||||
$property->setAccessible(true);
|
||||
$value = $annotation->getPlaceholder();
|
||||
|
||||
|
@ -162,8 +162,8 @@ class ElementPermissionListener
|
|||
$property->setAccessible(true);
|
||||
|
||||
//If the user is not allowed to edit or read this property, reset all values.
|
||||
if ((! $this->isGranted('read', $annotation, $element)
|
||||
|| ! $this->isGranted('edit', $annotation, $element))) {
|
||||
if ((!$this->isGranted('read', $annotation, $element)
|
||||
|| !$this->isGranted('edit', $annotation, $element))) {
|
||||
//Set value to old value, so that there a no change to this property
|
||||
if (isset($old_data[$property->getName()])) {
|
||||
$property->setValue($element, $old_data[$property->getName()]);
|
||||
|
@ -186,7 +186,7 @@ class ElementPermissionListener
|
|||
*/
|
||||
protected function isRunningFromCLI()
|
||||
{
|
||||
if (empty($_SERVER['REMOTE_ADDR']) && ! isset($_SERVER['HTTP_USER_AGENT']) && count($_SERVER['argv']) > 0) {
|
||||
if (empty($_SERVER['REMOTE_ADDR']) && !isset($_SERVER['HTTP_USER_AGENT']) && count($_SERVER['argv']) > 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ class ElementPermissionListener
|
|||
}
|
||||
|
||||
//Check if we have already have saved the permission, otherwise save it to cache
|
||||
if (! isset($this->perm_cache[$mode][get_class($element)][$operation])) {
|
||||
if (!isset($this->perm_cache[$mode][get_class($element)][$operation])) {
|
||||
$this->perm_cache[$mode][get_class($element)][$operation] = $this->security->isGranted($operation, $element);
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ final class UserChecker implements UserCheckerInterface
|
|||
*/
|
||||
public function checkPostAuth(UserInterface $user): void
|
||||
{
|
||||
if (! $user instanceof User) {
|
||||
if (!$user instanceof User) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,8 +53,6 @@ class AttachmentVoter extends ExtendedVoter
|
|||
* The current user (or the anonymous user) is passed by $user.
|
||||
*
|
||||
* @param string $attribute
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function voteOnUser($attribute, $subject, User $user): bool
|
||||
{
|
||||
|
|
|
@ -76,7 +76,7 @@ abstract class ExtendedVoter extends Voter
|
|||
}
|
||||
|
||||
// if the user is anonymous, we use the anonymous user.
|
||||
if (! $user instanceof User) {
|
||||
if (!$user instanceof User) {
|
||||
/** @var UserRepository $repo */
|
||||
$repo = $this->entityManager->getRepository(User::class);
|
||||
$user = $repo->getAnonymousUser();
|
||||
|
@ -93,8 +93,6 @@ abstract class ExtendedVoter extends Voter
|
|||
* The current user (or the anonymous user) is passed by $user.
|
||||
*
|
||||
* @param string $attribute
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract protected function voteOnUser($attribute, $subject, User $user): bool;
|
||||
}
|
||||
|
|
|
@ -52,8 +52,6 @@ class GroupVoter extends ExtendedVoter
|
|||
* The current user (or the anonymous user) is passed by $user.
|
||||
*
|
||||
* @param string $attribute
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function voteOnUser($attribute, $subject, User $user): bool
|
||||
{
|
||||
|
|
|
@ -45,7 +45,7 @@ class LabelProfileVoter extends ExtendedVoter
|
|||
protected function supports($attribute, $subject)
|
||||
{
|
||||
if ($subject instanceof LabelProfile) {
|
||||
if (! isset(self::MAPPING[$attribute])) {
|
||||
if (!isset(self::MAPPING[$attribute])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ class StructureVoter extends ExtendedVoter
|
|||
*/
|
||||
protected function instanceToPermissionName($subject): ?string
|
||||
{
|
||||
if (! is_string($subject)) {
|
||||
if (!is_string($subject)) {
|
||||
$class_name = get_class($subject);
|
||||
} else {
|
||||
$class_name = $subject;
|
||||
|
@ -122,8 +122,6 @@ class StructureVoter extends ExtendedVoter
|
|||
* The current user (or the anonymous user) is passed by $user.
|
||||
*
|
||||
* @param string $attribute
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function voteOnUser($attribute, $subject, User $user): bool
|
||||
{
|
||||
|
|
|
@ -73,8 +73,6 @@ class UserVoter extends ExtendedVoter
|
|||
* The current user (or the anonymous user) is passed by $user.
|
||||
*
|
||||
* @param string $attribute
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function voteOnUser($attribute, $subject, User $user): bool
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue