Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
apply style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Vassilev committed Mar 30, 2020
1 parent f316e0c commit 1758e06
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 24 deletions.
26 changes: 10 additions & 16 deletions src/Centreon/Application/Controller/AcknowledgementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ public function findAcknowledgementsByService(
RequestParametersInterface $requestParameters,
int $hostId,
int $serviceId
): View
{
): View {
$contact = $this->getUser();
if (!$contact->isAdmin() && !$contact->hasRole(Contact::ROLE_SERVICE_ACKNOWLEDGEMENT)) {
return $this->view(null, Response::HTTP_UNAUTHORIZED);
Expand Down Expand Up @@ -199,8 +198,7 @@ public function addHostAcknowledgements(
Request $request,
EntityValidator $entityValidator,
SerializerInterface $serializer
): View
{
): View {
$this->denyAccessUnlessGrantedForApiRealtime();

/**
Expand Down Expand Up @@ -256,8 +254,7 @@ public function addServiceAcknowledgements(
Request $request,
EntityValidator $entityValidator,
SerializerInterface $serializer
): View
{
): View {
$this->denyAccessUnlessGrantedForApiRealtime();

/**
Expand Down Expand Up @@ -315,8 +312,7 @@ public function addHostAcknowledgement(
EntityValidator $entityValidator,
SerializerInterface $serializer,
int $hostId
): View
{
): View {
$this->denyAccessUnlessGrantedForApiRealtime();

/**
Expand Down Expand Up @@ -369,8 +365,7 @@ public function addServiceAcknowledgement(
SerializerInterface $serializer,
int $hostId,
int $serviceId
): View
{
): View {
$this->denyAccessUnlessGrantedForApiRealtime();

$contact = $this->getUser();
Expand Down Expand Up @@ -536,8 +531,7 @@ public function massDisacknowledgeResources(
Request $request,
EntityValidator $entityValidator,
SerializerInterface $serializer
): View
{
): View {
$this->denyAccessUnlessGrantedForApiRealtime();

/**
Expand Down Expand Up @@ -615,8 +609,7 @@ public function massAcknowledgeResources(
Request $request,
EntityValidator $entityValidator,
SerializerInterface $serializer
): View
{
): View {
$this->denyAccessUnlessGrantedForApiRealtime();

/**
Expand Down Expand Up @@ -681,7 +674,8 @@ public function massAcknowledgeResources(
try {
if ($this->hasAckRightsForResource($contact, $resource)) {
$this->acknowledgementService->acknowledgeResource(
$resource, $acknowledgement
$resource,
$acknowledgement
);
}
} catch (\Exception $e) {
Expand All @@ -701,7 +695,7 @@ private function hasAckRightsForResource(Contact $contact, ResourceEntity $resou
{
$hasRights = false;

if ($resouce->getType() === ResourceEntity::TYPE_HOST){
if ($resouce->getType() === ResourceEntity::TYPE_HOST) {
$hasRights = $contact->isAdmin() || $contact->hasRole(Contact::ROLE_HOST_ACKNOWLEDGEMENT);
} elseif ($resouce->getType() === ResourceEntity::TYPE_SERVICE) {
$hasRights = $contact->isAdmin() || $contact->hasRole(Contact::ROLE_SERVICE_ACKNOWLEDGEMENT);
Expand Down
8 changes: 4 additions & 4 deletions src/Centreon/Application/Controller/DowntimeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,7 @@ public function massDowntimeResources(
Request $request,
EntityValidator $entityValidator,
SerializerInterface $serializer
): View
{
): View {
$this->denyAccessUnlessGrantedForApiRealtime();

/**
Expand Down Expand Up @@ -665,7 +664,8 @@ public function massDowntimeResources(
try {
if ($this->hasDtRightsForResource($contact, $resource)) {
$this->downtimeService->addResourceDowntime(
$resource, $downtime
$resource,
$downtime
);
}
} catch (\Exception $e) {
Expand All @@ -685,7 +685,7 @@ private function hasDtRightsForResource(Contact $contact, ResourceEntity $resouc
{
$hasRights = false;

if ($resouce->getType() === ResourceEntity::TYPE_HOST){
if ($resouce->getType() === ResourceEntity::TYPE_HOST) {
$hasRights = $contact->isAdmin() || $contact->hasRole(Contact::ROLE_ADD_HOST_DOWNTIME);
} elseif ($resouce->getType() === ResourceEntity::TYPE_SERVICE) {
$hasRights = $contact->isAdmin() || $contact->hasRole(Contact::ROLE_ADD_SERVICE_DOWNTIME);
Expand Down
3 changes: 2 additions & 1 deletion src/Centreon/Application/Request/AckRequest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright 2005 - 2020 Centreon (https://www.centreon.com/)
*
Expand Down Expand Up @@ -70,4 +71,4 @@ public function setResources(array $resources): AckRequest
$this->resources = $resources;
return $this;
}
}
}
3 changes: 2 additions & 1 deletion src/Centreon/Application/Request/DowntimeRequest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright 2005 - 2020 Centreon (https://www.centreon.com/)
*
Expand Down Expand Up @@ -70,4 +71,4 @@ public function setResources(array $resources): DowntimeRequest
$this->resources = $resources;
return $this;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright 2005 - 2019 Centreon (https://www.centreon.com/)
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright 2005 - 2019 Centreon (https://www.centreon.com/)
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright 2005 - 2019 Centreon (https://www.centreon.com/)
*
Expand Down
1 change: 1 addition & 0 deletions src/Centreon/Domain/Downtime/DowntimeException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright 2005 - 2019 Centreon (https://www.centreon.com/)
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright 2005 - 2019 Centreon (https://www.centreon.com/)
*
Expand Down
1 change: 1 addition & 0 deletions src/Centreon/Domain/Engine/EngineException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright 2005 - 2019 Centreon (https://www.centreon.com/)
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright 2005 - 2019 Centreon (https://www.centreon.com/)
*
Expand Down
3 changes: 1 addition & 2 deletions src/Centreon/Domain/Monitoring/ResourceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ public static function validateResource(
EntityValidator $validator,
ResourceEntity $resource,
array $contextGroups
): ConstraintViolationListInterface
{
): ConstraintViolationListInterface {
return $validator->validate(
$resource,
null,
Expand Down

0 comments on commit 1758e06

Please sign in to comment.