Skip to content

Commit

Permalink
Reformat the whole thing
Browse files Browse the repository at this point in the history
  • Loading branch information
Neloop committed Jan 7, 2020
1 parent ed4fed9 commit 74336f1
Show file tree
Hide file tree
Showing 625 changed files with 74,104 additions and 64,519 deletions.
878 changes: 464 additions & 414 deletions app/V1Module/presenters/AssignmentSolutionsPresenter.php

Large diffs are not rendered by default.

1,155 changes: 603 additions & 552 deletions app/V1Module/presenters/AssignmentsPresenter.php

Large diffs are not rendered by default.

113 changes: 60 additions & 53 deletions app/V1Module/presenters/BrokerPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,69 +11,76 @@
/**
* Endpoints for getting status of broker and its management.
*/
class BrokerPresenter extends BasePresenter {
class BrokerPresenter extends BasePresenter
{

/**
* @var IBrokerPermissions
* @inject
*/
public $brokerAcl;
/**
* @var IBrokerPermissions
* @inject
*/
public $brokerAcl;

/**
* @var BrokerProxy
* @inject
*/
public $brokerProxy;
/**
* @var BrokerProxy
* @inject
*/
public $brokerProxy;


public function checkStats() {
if (!$this->brokerAcl->canViewStats()) {
throw new ForbiddenRequestException("You cannot see broker stats");
public function checkStats()
{
if (!$this->brokerAcl->canViewStats()) {
throw new ForbiddenRequestException("You cannot see broker stats");
}
}
}

/**
* Get current statistics from broker.
* @GET
* @throws InvalidStateException
* @throws ZMQSocketException
*/
public function actionStats() {
$stats = $this->brokerProxy->getStats();
$this->sendSuccessResponse($stats);
}
/**
* Get current statistics from broker.
* @GET
* @throws InvalidStateException
* @throws ZMQSocketException
*/
public function actionStats()
{
$stats = $this->brokerProxy->getStats();
$this->sendSuccessResponse($stats);
}

public function checkFreeze() {
if (!$this->brokerAcl->canFreeze()) {
throw new ForbiddenRequestException();
public function checkFreeze()
{
if (!$this->brokerAcl->canFreeze()) {
throw new ForbiddenRequestException();
}
}
}

/**
* Freeze broker and its execution.
* @POST
* @throws InvalidStateException
* @throws ZMQSocketException
*/
public function actionFreeze() {
$this->brokerProxy->freeze();
$this->sendSuccessResponse("OK");
}
/**
* Freeze broker and its execution.
* @POST
* @throws InvalidStateException
* @throws ZMQSocketException
*/
public function actionFreeze()
{
$this->brokerProxy->freeze();
$this->sendSuccessResponse("OK");
}

public function checkUnfreeze() {
if (!$this->brokerAcl->canUnfreeze()) {
throw new ForbiddenRequestException();
public function checkUnfreeze()
{
if (!$this->brokerAcl->canUnfreeze()) {
throw new ForbiddenRequestException();
}
}
}

/**
* Unfreeze broker and its execution.
* @POST
* @throws InvalidStateException
* @throws ZMQSocketException
*/
public function actionUnfreeze() {
$this->brokerProxy->unfreeze();
$this->sendSuccessResponse("OK");
}
/**
* Unfreeze broker and its execution.
* @POST
* @throws InvalidStateException
* @throws ZMQSocketException
*/
public function actionUnfreeze()
{
$this->brokerProxy->unfreeze();
$this->sendSuccessResponse("OK");
}
}
Loading

0 comments on commit 74336f1

Please sign in to comment.