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

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Phoen authored and StyleCIBot committed Oct 28, 2017
1 parent 7662d3a commit ef3117a
Show file tree
Hide file tree
Showing 153 changed files with 271 additions and 266 deletions.
2 changes: 1 addition & 1 deletion app/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Composer\Autoload\ClassLoader;

/**
* @var ClassLoader $loader
* @var ClassLoader
*/
$loader = require __DIR__.'/../vendor/autoload.php';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ public function getPullRequest(): PullRequest
{
return $this->pullRequest;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public function getReport(): Entity\Inspection\Report
{
return $this->report;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public function getPullRequest(): PullRequest
{
return $this->pullRequest;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ public function getPullRequest(): Model\Github\PullRequest
{
return $this->pullRequest;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Command/Github/Repository/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ public function getSharedSecret()
{
return $this->sharedSecret;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public function getNewSharedSecret(): string
{
return $this->newSharedSecret;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Command/Github/Webhook/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public function getCallbackUrl(): string
{
return $this->callbackUrl;
}
}
}
6 changes: 3 additions & 3 deletions src/Regis/Application/Command/SecureCommand.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Regis\Application\Command;

use Regis\Domain\Entity;

interface SecureCommand
{
function executionAuthorizedFor(Entity\User $user): bool;
}
public function executionAuthorizedFor(Entity\User $user): bool;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Regis\Application\Command;

Expand All @@ -10,7 +10,7 @@

interface SecureCommandBySpecification
{
static function executionAuthorizedFor(Entity\User $user): Specification;
public static function executionAuthorizedFor(Entity\User $user): Specification;

function getTargetToSecure();
}
public function getTargetToSecure();
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Command/Team/AddMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public function getTargetToSecure()
{
return $this->team;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Command/Team/AddRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public function getTargetToSecure()
{
return $this->team;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Command/Team/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public function getName(): string
{
return $this->name;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Command/Team/Leave.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public function getTargetToSecure()
{
return $this->team;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Command/Team/RemoveMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public function getTargetToSecure()
{
return $this->team;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Command/Team/RemoveRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public function getTargetToSecure()
{
return $this->team;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Command/User/CreateAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ public function getEmail(): string
{
return $this->email;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Command/User/CreateOrUpdateUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ public function getAccessToken(): string
{
return $this->accessToken;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ private function dispatch(string $eventName, Event $event)
{
$this->dispatcher->dispatch($eventName, new Event\DomainEventWrapper($event));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ public function handle(Command\Github\Inspection\SavePullRequestReport $command)

$this->inspectionsRepository->save($inspection);
}
}
}
4 changes: 2 additions & 2 deletions src/Regis/Application/CommandHandler/Middleware/Security.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Regis\Application\CommandHandler\Middleware;

Expand Down Expand Up @@ -53,4 +53,4 @@ private function executionAuthorized($command): bool

return $authorized;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/CommandHandler/Team/AddMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ public function handle(Command\Team\AddMember $command)
// The given user was already in the team, nothing to do!
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ public function handle(Command\Team\AddRepository $command)
// The given repo was already in the team, nothing to do!
}
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/CommandHandler/Team/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ public function handle(Command\Team\Create $command)

$this->teamsRepo->save($team);
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/CommandHandler/Team/Leave.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ public function handle(Command\Team\Leave $command)

$this->teamsRepo->save($team);
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/CommandHandler/Team/RemoveMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ public function handle(Command\Team\RemoveMember $command)

$this->teamsRepo->save($team);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ public function handle(Command\Team\RemoveRepository $command)

$this->teamsRepo->save($team);
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/CommandHandler/User/CreateAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ public function handle(Command\User\CreateAdmin $command)

$this->usersRepo->save($user);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ public function handle(Command\User\CreateOrUpdateUser $command)

return $user;
}
}
}
4 changes: 2 additions & 2 deletions src/Regis/Application/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ interface Event
const INSPECTION_FINISHED = 'inspection_finished';
const INSPECTION_FAILED = 'inspection_failed';

function getEventName(): string;
}
public function getEventName(): string;
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Event/DomainEventWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ public function getDomainEvent(): DomainEvent
{
return $this->domainEvent;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Event/InspectionFailed.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public function getEventName(): string
{
return Event::INSPECTION_FAILED;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Event/InspectionFinished.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public function getEventName(): string
{
return Event::INSPECTION_FINISHED;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Event/InspectionStarted.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ public function getEventName(): string
{
return Event::INSPECTION_STARTED;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Event/PullRequestClosed.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public function getEventName(): string
{
return Event::PULL_REQUEST_CLOSED;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Event/PullRequestOpened.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public function getEventName(): string
{
return Event::PULL_REQUEST_OPENED;
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Event/PullRequestSynced.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ public function getEventName(): string
{
return Event::PULL_REQUEST_SYNCED;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public function onInspectionFinished(Event\DomainEventWrapper $event)
$domainEvent->getReport()
));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ public function onPullRequestClosed(Event\DomainEventWrapper $event)
// TODO should be in a command
$this->violationsCache->clear($domainEvent->getPullRequest());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public function onInspectionFinished(Event\DomainEventWrapper $event)
$domainEvent->getPullRequest()
));
}
}
}
16 changes: 10 additions & 6 deletions src/Regis/Application/Github/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ interface Client
const READONLY_KEY = 'readonly_key';
const WRITE_KEY = 'write_key';

function setIntegrationStatus(Model\PullRequest $pullRequest, IntegrationStatus $status);
function addDeployKey(string $owner, string $repository, string $title, string $key, string $type);
function createWebhook(string $owner, string $repository, string $url, $secret = null);
function sendComment(Model\PullRequest $pullRequest, Model\ReviewComment $comment);
function listRepositories(): \Traversable;
}
public function setIntegrationStatus(Model\PullRequest $pullRequest, IntegrationStatus $status);

public function addDeployKey(string $owner, string $repository, string $title, string $key, string $type);

public function createWebhook(string $owner, string $repository, string $url, $secret = null);

public function sendComment(Model\PullRequest $pullRequest, Model\ReviewComment $comment);

public function listRepositories(): \Traversable;
}
5 changes: 3 additions & 2 deletions src/Regis/Application/Github/ClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

interface ClientFactory
{
function createForRepository(Entity\Github\Repository $repository): Client;
function createForUser(Entity\User $user): Client;
public function createForRepository(Entity\Github\Repository $repository): Client;

public function createForUser(Entity\User $user): Client;
}
6 changes: 3 additions & 3 deletions src/Regis/Application/Github/EventTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public function transform(Request $request)

if ($payload['action'] === self::ACTION_OPEN_PULL_REQUEST) {
return $this->transformPullRequestOpened($payload);
} else if ($payload['action'] === self::ACTION_SYNC_PULL_REQUEST) {
} elseif ($payload['action'] === self::ACTION_SYNC_PULL_REQUEST) {
return $this->transformPullRequestSynced($payload);
} else if ($payload['action'] === self::ACTION_CLOSE_PULL_REQUEST) {
} elseif ($payload['action'] === self::ACTION_CLOSE_PULL_REQUEST) {
return $this->transformPullRequestClosed($payload);
}
}
Expand Down Expand Up @@ -72,4 +72,4 @@ private function transformPullRequest(array $payload): Model\Github\PullRequest
new Model\Git\Revisions($payload['pull_request']['base']['sha'], $payload['pull_request']['head']['sha'])
);
}
}
}
2 changes: 1 addition & 1 deletion src/Regis/Application/Github/Exception/EventNotHandled.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

class EventNotHandled extends \RuntimeException
{
}
}
4 changes: 2 additions & 2 deletions src/Regis/Application/Github/IntegrationStatus.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Regis\Application\Github;

Expand Down Expand Up @@ -36,4 +36,4 @@ public function getTargetUrl()
{
return $this->targetUrl;
}
}
}
6 changes: 3 additions & 3 deletions src/Regis/Application/Inspection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

interface Inspection
{
function getType(): string;
public function getType(): string;

function inspectDiff(Model\Git\Diff $diff): \Traversable;
}
public function inspectDiff(Model\Git\Diff $diff): \Traversable;
}
Loading

0 comments on commit ef3117a

Please sign in to comment.