Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F9882334
D2674.id6767.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
45 KB
Referenced Files
None
Subscribers
None
D2674.id6767.diff
View Options
diff --git a/.arclint b/.arclint
--- a/.arclint
+++ b/.arclint
@@ -28,8 +28,12 @@
"phpcs": {
"type": "phpcs",
"bin": "vendor/bin/phpcs",
- "phpcs.standard": "PSR1",
- "include": "(^app/.*\\.php$)"
+ "phpcs.standard": "phpcs.xml",
+ "include": [
+ "(app/.*\\.php$)",
+ "(config/.*\\.php$)",
+ "(tests/.*\\.php$)"
+ ]
},
"spelling": {
"type": "spelling"
diff --git a/app/Analyzers/BasePayloadAnalyzer.php b/app/Analyzers/BasePayloadAnalyzer.php
--- a/app/Analyzers/BasePayloadAnalyzer.php
+++ b/app/Analyzers/BasePayloadAnalyzer.php
@@ -2,11 +2,10 @@
namespace Nasqueron\Notifications\Analyzers;
+use BadMethodCallException;
use Config;
use Storage;
-use BadMethodCallException;
-
abstract class BasePayloadAnalyzer {
///
@@ -36,7 +35,7 @@
/**
* The configuration for the payload analyzer
- * @var PayloadAnalyzerConfiguration;
+ * @var PayloadAnalyzerConfiguration
*/
protected $configuration;
diff --git a/app/Analyzers/GitHub/Events/Event.php b/app/Analyzers/GitHub/Events/Event.php
--- a/app/Analyzers/GitHub/Events/Event.php
+++ b/app/Analyzers/GitHub/Events/Event.php
@@ -2,6 +2,8 @@
namespace Nasqueron\Notifications\Analyzers\GitHub\Events;
+use Illuminate\Support\Str;
+
class Event {
///
@@ -31,25 +33,32 @@
* Gets class name from the GitHub webhooks event name
*
* @param string $eventName The event name (e.g. commit_comment)
+ *
* @return string The event class name (e.g. CommitCommentEvent)
*/
- public static function getClass ($eventName) {
- return __NAMESPACE__ . '\\' . studly_case($eventName) . 'Event';
+ public static function getClass (string $eventName) {
+ return __NAMESPACE__ . '\\' . self::toCamelCase($eventName) . 'Event';
+ }
+
+ private static function toCamelCase (string $string) : string {
+ return str_replace(" ", "", ucwords(str_replace("_", " ", $string)));
}
/**
* Gets an instance of the event class, from the
*
* @param string $eventName The event name (e.g. commit_comment)
+ *
* @return Event
*/
- public static function forPayload ($eventName, $payload) {
+ public static function forPayload (string $eventName, $payload) {
$class = self::getClass($eventName);
if (!class_exists($class)) {
throw new \InvalidArgumentException(
"Class doesn't exist: $class (for $eventName)"
);
}
+
return new $class($payload);
}
@@ -60,11 +69,15 @@
/**
* Cuts a text
*
- * @param string $text The text to cut
- * @param int $strLen The amount of characters to allow [optional]
+ * @param string $text The text to cut
+ * @param int $strLen The amount of characters to allow [optional]
* @param string $symbol The symbol to append to a cut text [optional]
*/
- public static function cut ($text, $strLen = 114, $symbol = '…') {
+ public static function cut (
+ string $text,
+ int $strLen = 114,
+ string $symbol = '…'
+ ) {
$len = strlen($text);
if ($len <= $strLen) {
return $text;
diff --git a/app/Analyzers/GitHub/Events/IssueCommentEvent.php b/app/Analyzers/GitHub/Events/IssueCommentEvent.php
--- a/app/Analyzers/GitHub/Events/IssueCommentEvent.php
+++ b/app/Analyzers/GitHub/Events/IssueCommentEvent.php
@@ -15,9 +15,9 @@
* @param string $action The action to check
* @return bool true if the action is valid; otherwise, false
*/
- protected static function isValidAction ($action) {
- $actions = ['created', 'edited', 'deleted'];
- return in_array($action, $actions);
+ protected static function isValidAction( string $action ) {
+ $actions = [ 'created', 'edited', 'deleted' ];
+ return in_array( $action, $actions );
}
/**
diff --git a/app/Analyzers/GitHub/Events/PullRequestEvent.php b/app/Analyzers/GitHub/Events/PullRequestEvent.php
--- a/app/Analyzers/GitHub/Events/PullRequestEvent.php
+++ b/app/Analyzers/GitHub/Events/PullRequestEvent.php
@@ -15,7 +15,7 @@
* @param string $action The action to check
* @return bool true if the action is valid; otherwise, false
*/
- protected static function isValidAction ($action) {
+ protected static function isValidAction( string $action ) {
$actions = [
'assigned', 'unassigned',
'labeled', 'unlabeled',
diff --git a/app/Analyzers/GitHub/Events/PushEvent.php b/app/Analyzers/GitHub/Events/PushEvent.php
--- a/app/Analyzers/GitHub/Events/PushEvent.php
+++ b/app/Analyzers/GitHub/Events/PushEvent.php
@@ -18,7 +18,7 @@
* @param int $count The count of commits
* @return string The l10n message key for description
*/
- private static function getDescriptionMessageKey ($count) {
+ private static function getDescriptionMessageKey( int $count ) {
$key = 'GitHub.EventsDescriptions.PushEvent';
if ($count === 0) {
diff --git a/app/Analyzers/GitHub/GitHubPayloadAnalyzer.php b/app/Analyzers/GitHub/GitHubPayloadAnalyzer.php
--- a/app/Analyzers/GitHub/GitHubPayloadAnalyzer.php
+++ b/app/Analyzers/GitHub/GitHubPayloadAnalyzer.php
@@ -26,7 +26,7 @@
/**
* The payload analyzer event
*
- * @var \Nasqueron\Notifications\Analyzers\GitHub\Events\Event;
+ * @var \Nasqueron\Notifications\Analyzers\GitHub\Events\Event
*/
private $analyzerEvent;
diff --git a/app/Analyzers/Jenkins/JenkinsPayloadAnalyzer.php b/app/Analyzers/Jenkins/JenkinsPayloadAnalyzer.php
--- a/app/Analyzers/Jenkins/JenkinsPayloadAnalyzer.php
+++ b/app/Analyzers/Jenkins/JenkinsPayloadAnalyzer.php
@@ -31,7 +31,7 @@
/**
* Tries to get build status.
*
- * @param out string $status
+ * @param out string &$status
* @return bool indicates if the build status is defined in the payload
*/
private function tryGetBuildStatus (string &$status) : bool {
diff --git a/app/Config/Reporting/BaseReportEntry.php b/app/Config/Reporting/BaseReportEntry.php
--- a/app/Config/Reporting/BaseReportEntry.php
+++ b/app/Config/Reporting/BaseReportEntry.php
@@ -8,8 +8,9 @@
/// Format
///
- public abstract function toArray () : array;
- public abstract function toFancyArray () : array;
+ abstract public function toArray(): array;
+
+ abstract public function toFancyArray(): array;
///
/// Format helper methods
diff --git a/app/Config/Reporting/ConfigReport.php b/app/Config/Reporting/ConfigReport.php
--- a/app/Config/Reporting/ConfigReport.php
+++ b/app/Config/Reporting/ConfigReport.php
@@ -2,9 +2,8 @@
namespace Nasqueron\Notifications\Config\Reporting;
-use Nasqueron\Notifications\Config\Features;
-
use Config;
+use Nasqueron\Notifications\Config\Features;
use Services;
class ConfigReport {
diff --git a/app/Console/Commands/ConfigValidate.php b/app/Console/Commands/ConfigValidate.php
--- a/app/Console/Commands/ConfigValidate.php
+++ b/app/Console/Commands/ConfigValidate.php
@@ -2,11 +2,10 @@
namespace Nasqueron\Notifications\Console\Commands;
+use App;
use Illuminate\Console\Command;
use Illuminate\Filesystem\FilesystemAdapter;
-use App;
-
class ConfigValidate extends Command {
/**
diff --git a/app/Console/Commands/NotificationsPayload.php b/app/Console/Commands/NotificationsPayload.php
--- a/app/Console/Commands/NotificationsPayload.php
+++ b/app/Console/Commands/NotificationsPayload.php
@@ -2,12 +2,10 @@
namespace Nasqueron\Notifications\Console\Commands;
-use Nasqueron\Notifications\Notifications\Notification;
-use Nasqueron\Notifications\Phabricator\PhabricatorStory;
-
use Illuminate\Console\Command;
-
use InvalidArgumentException;
+use Nasqueron\Notifications\Notifications\Notification;
+use Nasqueron\Notifications\Phabricator\PhabricatorStory;
use ReflectionClass;
class NotificationsPayload extends Command {
diff --git a/app/Contracts/APIClient.php b/app/Contracts/APIClient.php
--- a/app/Contracts/APIClient.php
+++ b/app/Contracts/APIClient.php
@@ -10,7 +10,7 @@
* @param string $url The API end point URL
* @return void
*/
- public function setEndPoint ($url);
+ public function setEndPoint( string $url );
/**
* Calls an API method
@@ -19,6 +19,6 @@
* @param array $arguments The arguments to use
* @return mixed The API result
*/
- public function call ($method, $arguments = []);
+ public function call( string $method, array $arguments = [] );
}
diff --git a/app/Contracts/APIFactory.php b/app/Contracts/APIFactory.php
--- a/app/Contracts/APIFactory.php
+++ b/app/Contracts/APIFactory.php
@@ -10,6 +10,6 @@
* @param string $endPoint The API end point
* @return APIClient
*/
- public function get ($endPoint);
+ public function get( string $endPoint );
}
diff --git a/app/Events/DockerHubPayloadEvent.php b/app/Events/DockerHubPayloadEvent.php
--- a/app/Events/DockerHubPayloadEvent.php
+++ b/app/Events/DockerHubPayloadEvent.php
@@ -2,7 +2,6 @@
namespace Nasqueron\Notifications\Events;
-use Nasqueron\Notifications\Events\Event;
use Illuminate\Queue\SerializesModels;
class DockerHubPayloadEvent extends Event {
diff --git a/app/Events/GitHubPayloadEvent.php b/app/Events/GitHubPayloadEvent.php
--- a/app/Events/GitHubPayloadEvent.php
+++ b/app/Events/GitHubPayloadEvent.php
@@ -2,7 +2,6 @@
namespace Nasqueron\Notifications\Events;
-use Nasqueron\Notifications\Events\Event;
use Illuminate\Queue\SerializesModels;
class GitHubPayloadEvent extends Event {
diff --git a/app/Events/JenkinsPayloadEvent.php b/app/Events/JenkinsPayloadEvent.php
--- a/app/Events/JenkinsPayloadEvent.php
+++ b/app/Events/JenkinsPayloadEvent.php
@@ -2,7 +2,6 @@
namespace Nasqueron\Notifications\Events;
-use Nasqueron\Notifications\Events\Event;
use Illuminate\Queue\SerializesModels;
class JenkinsPayloadEvent extends Event {
diff --git a/app/Events/NotificationEvent.php b/app/Events/NotificationEvent.php
--- a/app/Events/NotificationEvent.php
+++ b/app/Events/NotificationEvent.php
@@ -2,10 +2,8 @@
namespace Nasqueron\Notifications\Events;
-use Nasqueron\Notifications\Events\Event;
-use Nasqueron\Notifications\Notifications\Notification;
-
use Illuminate\Queue\SerializesModels;
+use Nasqueron\Notifications\Notifications\Notification;
class NotificationEvent extends Event {
use SerializesModels;
diff --git a/app/Events/PhabricatorPayloadEvent.php b/app/Events/PhabricatorPayloadEvent.php
--- a/app/Events/PhabricatorPayloadEvent.php
+++ b/app/Events/PhabricatorPayloadEvent.php
@@ -2,9 +2,8 @@
namespace Nasqueron\Notifications\Events;
-use Nasqueron\Notifications\Events\Event;
-use Nasqueron\Notifications\Phabricator\PhabricatorStory;
use Illuminate\Queue\SerializesModels;
+use Nasqueron\Notifications\Phabricator\PhabricatorStory;
class PhabricatorPayloadEvent extends Event {
use SerializesModels;
diff --git a/app/Events/ReportEvent.php b/app/Events/ReportEvent.php
--- a/app/Events/ReportEvent.php
+++ b/app/Events/ReportEvent.php
@@ -2,9 +2,8 @@
namespace Nasqueron\Notifications\Events;
-use Nasqueron\Notifications\Actions\Action;
-use Nasqueron\Notifications\Events\Event;
use Illuminate\Queue\SerializesModels;
+use Nasqueron\Notifications\Actions\Action;
class ReportEvent extends Event {
use SerializesModels;
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php
--- a/app/Exceptions/Handler.php
+++ b/app/Exceptions/Handler.php
@@ -2,21 +2,18 @@
namespace Nasqueron\Notifications\Exceptions;
-use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
-
+use Config;
+use Exception;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
+use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Foundation\Validation\ValidationException;
use Illuminate\Session\TokenMismatchException;
use Psr\Log\LoggerInterface;
+use Raven;
use Symfony\Component\Console\Exception\CommandNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
-use Config;
-use Raven;
-
-use Exception;
-
class Handler extends ExceptionHandler {
/**
diff --git a/app/Facades/Raven.php b/app/Facades/Raven.php
--- a/app/Facades/Raven.php
+++ b/app/Facades/Raven.php
@@ -2,9 +2,8 @@
namespace Nasqueron\Notifications\Facades;
-use Illuminate\Support\Facades\Facade;
-
use Config;
+use Illuminate\Support\Facades\Facade;
/**
* @see \Raven_Client
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -2,10 +2,10 @@
namespace Nasqueron\Notifications\Http\Controllers;
+use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
-use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
-use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
+use Illuminate\Routing\Controller as BaseController;
abstract class Controller extends BaseController {
diff --git a/app/Http/Controllers/Gate/DockerHubGateController.php b/app/Http/Controllers/Gate/DockerHubGateController.php
--- a/app/Http/Controllers/Gate/DockerHubGateController.php
+++ b/app/Http/Controllers/Gate/DockerHubGateController.php
@@ -2,12 +2,10 @@
namespace Nasqueron\Notifications\Http\Controllers\Gate;
-use Nasqueron\Notifications\Events\DockerHubPayloadEvent;
-
-use Symfony\Component\HttpFoundation\Response;
-
use Event;
+use Nasqueron\Notifications\Events\DockerHubPayloadEvent;
use Request;
+use Symfony\Component\HttpFoundation\Response;
class DockerHubGateController extends GateController {
diff --git a/app/Http/Controllers/Gate/GateController.php b/app/Http/Controllers/Gate/GateController.php
--- a/app/Http/Controllers/Gate/GateController.php
+++ b/app/Http/Controllers/Gate/GateController.php
@@ -2,18 +2,16 @@
namespace Nasqueron\Notifications\Http\Controllers\Gate;
+use App;
+use Illuminate\View\View;
+use Log;
use Nasqueron\Notifications\Config\Features;
use Nasqueron\Notifications\Config\Services\Service;
use Nasqueron\Notifications\Http\Controllers\Controller;
-
-use Symfony\Component\HttpFoundation\Response as BaseResponse;
-use Illuminate\View\View;
-
-use App;
-use Log;
use Report;
use Response;
use Services;
+use Symfony\Component\HttpFoundation\Response as BaseResponse;
/**
* Represents a controller handling an entry-point for API payloads
diff --git a/app/Http/Controllers/Gate/GitHubGateController.php b/app/Http/Controllers/Gate/GitHubGateController.php
--- a/app/Http/Controllers/Gate/GitHubGateController.php
+++ b/app/Http/Controllers/Gate/GitHubGateController.php
@@ -2,13 +2,11 @@
namespace Nasqueron\Notifications\Http\Controllers\Gate;
-use Nasqueron\Notifications\Events\GitHubPayloadEvent;
-
-use Keruald\GitHub\XHubSignature;
-use Symfony\Component\HttpFoundation\Response;
-
use Event;
+use Keruald\GitHub\XHubSignature;
+use Nasqueron\Notifications\Events\GitHubPayloadEvent;
use Request;
+use Symfony\Component\HttpFoundation\Response;
class GitHubGateController extends GateController {
diff --git a/app/Http/Controllers/Gate/JenkinsGateController.php b/app/Http/Controllers/Gate/JenkinsGateController.php
--- a/app/Http/Controllers/Gate/JenkinsGateController.php
+++ b/app/Http/Controllers/Gate/JenkinsGateController.php
@@ -2,12 +2,10 @@
namespace Nasqueron\Notifications\Http\Controllers\Gate;
-use Nasqueron\Notifications\Events\JenkinsPayloadEvent;
-
-use Symfony\Component\HttpFoundation\Response;
-
use Event;
+use Nasqueron\Notifications\Events\JenkinsPayloadEvent;
use Request;
+use Symfony\Component\HttpFoundation\Response;
class JenkinsGateController extends GateController {
diff --git a/app/Http/Controllers/Gate/NotificationGateController.php b/app/Http/Controllers/Gate/NotificationGateController.php
--- a/app/Http/Controllers/Gate/NotificationGateController.php
+++ b/app/Http/Controllers/Gate/NotificationGateController.php
@@ -2,15 +2,12 @@
namespace Nasqueron\Notifications\Http\Controllers\Gate;
+use Event;
+use InvalidArgumentException;
use Nasqueron\Notifications\Events\NotificationEvent;
use Nasqueron\Notifications\Notifications\Notification;
-
-use Symfony\Component\HttpFoundation\Response;
-
-use Event;
use Request;
-
-use InvalidArgumentException;
+use Symfony\Component\HttpFoundation\Response;
class NotificationGateController extends GateController {
diff --git a/app/Http/Controllers/Gate/PhabricatorGateController.php b/app/Http/Controllers/Gate/PhabricatorGateController.php
--- a/app/Http/Controllers/Gate/PhabricatorGateController.php
+++ b/app/Http/Controllers/Gate/PhabricatorGateController.php
@@ -2,12 +2,10 @@
namespace Nasqueron\Notifications\Http\Controllers\Gate;
-use Nasqueron\Notifications\Events\PhabricatorPayloadEvent;
-
-use Symfony\Component\HttpFoundation\Response;
-
use Event;
+use Nasqueron\Notifications\Events\PhabricatorPayloadEvent;
use Request;
+use Symfony\Component\HttpFoundation\Response;
class PhabricatorGateController extends GateController {
diff --git a/app/Jobs/FireDockerHubNotification.php b/app/Jobs/FireDockerHubNotification.php
--- a/app/Jobs/FireDockerHubNotification.php
+++ b/app/Jobs/FireDockerHubNotification.php
@@ -2,17 +2,15 @@
namespace Nasqueron\Notifications\Jobs;
-use Nasqueron\Notifications\Notifications\DockerHubNotification;
+use Event;
use Nasqueron\Notifications\Events\DockerHubPayloadEvent;
use Nasqueron\Notifications\Events\NotificationEvent;
-use Nasqueron\Notifications\Jobs\Job;
-
-use Event;
+use Nasqueron\Notifications\Notifications\DockerHubNotification;
class FireDockerHubNotification extends Job {
/**
- * @var DockerHubPayloadEvent;
+ * @var DockerHubPayloadEvent
*/
private $event;
diff --git a/app/Jobs/FireGitHubNotification.php b/app/Jobs/FireGitHubNotification.php
--- a/app/Jobs/FireGitHubNotification.php
+++ b/app/Jobs/FireGitHubNotification.php
@@ -2,17 +2,15 @@
namespace Nasqueron\Notifications\Jobs;
-use Nasqueron\Notifications\Notifications\GitHubNotification;
+use Event;
use Nasqueron\Notifications\Events\GitHubPayloadEvent;
use Nasqueron\Notifications\Events\NotificationEvent;
-use Nasqueron\Notifications\Jobs\Job;
-
-use Event;
+use Nasqueron\Notifications\Notifications\GitHubNotification;
class FireGitHubNotification extends Job {
/**
- * @var GitHubPayloadEvent;
+ * @var GitHubPayloadEvent
*/
private $event;
diff --git a/app/Jobs/FireJenkinsNotification.php b/app/Jobs/FireJenkinsNotification.php
--- a/app/Jobs/FireJenkinsNotification.php
+++ b/app/Jobs/FireJenkinsNotification.php
@@ -2,17 +2,15 @@
namespace Nasqueron\Notifications\Jobs;
-use Nasqueron\Notifications\Notifications\JenkinsNotification;
+use Event;
use Nasqueron\Notifications\Events\JenkinsPayloadEvent;
use Nasqueron\Notifications\Events\NotificationEvent;
-use Nasqueron\Notifications\Jobs\Job;
-
-use Event;
+use Nasqueron\Notifications\Notifications\JenkinsNotification;
class FireJenkinsNotification extends Job {
/**
- * @var JenkinsPayloadEvent;
+ * @var JenkinsPayloadEvent
*/
private $event;
diff --git a/app/Jobs/FirePhabricatorNotification.php b/app/Jobs/FirePhabricatorNotification.php
--- a/app/Jobs/FirePhabricatorNotification.php
+++ b/app/Jobs/FirePhabricatorNotification.php
@@ -2,17 +2,15 @@
namespace Nasqueron\Notifications\Jobs;
-use Nasqueron\Notifications\Notifications\PhabricatorNotification;
-use Nasqueron\Notifications\Events\PhabricatorPayloadEvent;
-use Nasqueron\Notifications\Events\NotificationEvent;
-use Nasqueron\Notifications\Jobs\Job;
-
use Event;
+use Nasqueron\Notifications\Events\NotificationEvent;
+use Nasqueron\Notifications\Events\PhabricatorPayloadEvent;
+use Nasqueron\Notifications\Notifications\PhabricatorNotification;
class FirePhabricatorNotification extends Job {
/**
- * @var PhabricatorPayloadEvent;
+ * @var PhabricatorPayloadEvent
*/
private $event;
diff --git a/app/Jobs/NotifyNewCommitsToDiffusion.php b/app/Jobs/NotifyNewCommitsToDiffusion.php
--- a/app/Jobs/NotifyNewCommitsToDiffusion.php
+++ b/app/Jobs/NotifyNewCommitsToDiffusion.php
@@ -2,16 +2,14 @@
namespace Nasqueron\Notifications\Jobs;
+use Event;
+use Log;
use Nasqueron\Notifications\Actions\ActionError;
use Nasqueron\Notifications\Actions\NotifyNewCommitsAction;
use Nasqueron\Notifications\Events\ReportEvent;
use Nasqueron\Notifications\Phabricator\PhabricatorAPI as API;
use Nasqueron\Notifications\Phabricator\PhabricatorAPIException;
-
-use Event;
-use Log;
use PhabricatorAPI;
-
use RuntimeException;
/**
diff --git a/app/Jobs/SendMessageToBroker.php b/app/Jobs/SendMessageToBroker.php
--- a/app/Jobs/SendMessageToBroker.php
+++ b/app/Jobs/SendMessageToBroker.php
@@ -2,14 +2,12 @@
namespace Nasqueron\Notifications\Jobs;
-use Nasqueron\Notifications\Actions\ActionError;
-use Nasqueron\Notifications\Actions\AMQPAction;
-use Nasqueron\Notifications\Events\ReportEvent;
-use Nasqueron\Notifications\Jobs\Job;
-
use Broker;
use Event;
use Log;
+use Nasqueron\Notifications\Actions\ActionError;
+use Nasqueron\Notifications\Actions\AMQPAction;
+use Nasqueron\Notifications\Events\ReportEvent;
class SendMessageToBroker extends Job {
diff --git a/app/Jobs/TriggerDockerHubBuild.php b/app/Jobs/TriggerDockerHubBuild.php
--- a/app/Jobs/TriggerDockerHubBuild.php
+++ b/app/Jobs/TriggerDockerHubBuild.php
@@ -2,14 +2,12 @@
namespace Nasqueron\Notifications\Jobs;
-use Nasqueron\Notifications\Actions\ActionError;
-use Nasqueron\Notifications\Actions\TriggerDockerHubBuildAction;
-use Nasqueron\Notifications\Events\ReportEvent;
-
use DockerHub;
use Event;
-
use Exception;
+use Nasqueron\Notifications\Actions\ActionError;
+use Nasqueron\Notifications\Actions\TriggerDockerHubBuildAction;
+use Nasqueron\Notifications\Events\ReportEvent;
/**
* This class allows to trigger a new Docker Hub build.
diff --git a/app/Listeners/AMQPEventListener.php b/app/Listeners/AMQPEventListener.php
--- a/app/Listeners/AMQPEventListener.php
+++ b/app/Listeners/AMQPEventListener.php
@@ -2,14 +2,12 @@
namespace Nasqueron\Notifications\Listeners;
+use Config;
+use Illuminate\Events\Dispatcher;
use Nasqueron\Notifications\Events\NotificationEvent;
use Nasqueron\Notifications\Jobs\SendMessageToBroker;
use Nasqueron\Notifications\Notifications\Notification;
-use Illuminate\Events\Dispatcher;
-
-use Config;
-
class AMQPEventListener {
///
diff --git a/app/Listeners/DockerHubListener.php b/app/Listeners/DockerHubListener.php
--- a/app/Listeners/DockerHubListener.php
+++ b/app/Listeners/DockerHubListener.php
@@ -2,13 +2,11 @@
namespace Nasqueron\Notifications\Listeners;
+use DockerHub;
+use Illuminate\Events\Dispatcher;
use Nasqueron\Notifications\Events\GitHubPayloadEvent;
use Nasqueron\Notifications\Jobs\TriggerDockerHubBuild;
-use Illuminate\Events\Dispatcher;
-
-use DockerHub;
-
/**
* Listens to events Docker Hub is interested by.
*/
diff --git a/app/Listeners/PhabricatorListener.php b/app/Listeners/PhabricatorListener.php
--- a/app/Listeners/PhabricatorListener.php
+++ b/app/Listeners/PhabricatorListener.php
@@ -2,11 +2,10 @@
namespace Nasqueron\Notifications\Listeners;
+use Illuminate\Events\Dispatcher;
use Nasqueron\Notifications\Events\GitHubPayloadEvent;
use Nasqueron\Notifications\Jobs\NotifyNewCommitsToDiffusion;
-use Illuminate\Events\Dispatcher;
-
/**
* Listens to events Phabricator is interested by.
*/
diff --git a/app/Notifications/DockerHubNotification.php b/app/Notifications/DockerHubNotification.php
--- a/app/Notifications/DockerHubNotification.php
+++ b/app/Notifications/DockerHubNotification.php
@@ -2,9 +2,8 @@
namespace Nasqueron\Notifications\Notifications;
-use Nasqueron\Notifications\Analyzers\DockerHub\BaseEvent;
-
use InvalidArgumentException;
+use Nasqueron\Notifications\Analyzers\DockerHub\BaseEvent;
/**
* A Docker Hub notification.
diff --git a/app/Phabricator/ProjectsMap.php b/app/Phabricator/ProjectsMap.php
--- a/app/Phabricator/ProjectsMap.php
+++ b/app/Phabricator/ProjectsMap.php
@@ -2,10 +2,9 @@
namespace Nasqueron\Notifications\Phabricator;
-use Nasqueron\Notifications\Contracts\APIClient as APIClient;
-
use App;
use Cache;
+use Nasqueron\Notifications\Contracts\APIClient as APIClient;
class ProjectsMap implements \IteratorAggregate, \ArrayAccess {
diff --git a/app/Providers/DockerHubServiceProvider.php b/app/Providers/DockerHubServiceProvider.php
--- a/app/Providers/DockerHubServiceProvider.php
+++ b/app/Providers/DockerHubServiceProvider.php
@@ -2,10 +2,9 @@
namespace Nasqueron\Notifications\Providers;
+use GuzzleHttp\Client;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Support\ServiceProvider;
-
-use GuzzleHttp\Client;
use Keruald\DockerHub\Build\TriggerBuildFactory;
class DockerHubServiceProvider extends ServiceProvider {
diff --git a/app/Providers/MailgunServiceProvider.php b/app/Providers/MailgunServiceProvider.php
--- a/app/Providers/MailgunServiceProvider.php
+++ b/app/Providers/MailgunServiceProvider.php
@@ -2,10 +2,9 @@
namespace Nasqueron\Notifications\Providers;
+use GuzzleHttp\Client;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Support\ServiceProvider;
-
-use GuzzleHttp\Client;
use Keruald\Mailgun\MailgunMessageFactory;
class MailgunServiceProvider extends ServiceProvider {
diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php
--- a/app/Providers/RouteServiceProvider.php
+++ b/app/Providers/RouteServiceProvider.php
@@ -2,10 +2,8 @@
namespace Nasqueron\Notifications\Providers;
-use Illuminate\{
- Routing\Router,
- Foundation\Support\Providers\RouteServiceProvider as ServiceProvider
-};
+use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
+use Illuminate\Routing\Router;
class RouteServiceProvider extends ServiceProvider {
diff --git a/composer.json b/composer.json
--- a/composer.json
+++ b/composer.json
@@ -10,8 +10,8 @@
"license": "BSD-2-Clause",
"type": "project",
"require": {
- "php": ">=7.1.0",
- "laravel/framework": "5.3.*",
+ "php": ">=8.1.0",
+ "laravel/framework": "8.*",
"guzzlehttp/guzzle": "^6.2",
"keruald/dockerhub": "^0.0.3",
"keruald/github": "^0.2.1",
@@ -21,18 +21,18 @@
"sentry/sentry": "^0.13.0"
},
"require-dev": {
- "phan/phan": "^3.2.2",
+ "phan/phan": "^5.3",
"fzaninotto/faker": "~1.4",
- "mockery/mockery": "0.9.*",
- "pdepend/pdepend": "^2.4.1",
- "phploc/phploc": "^3.0.1",
- "phpmd/phpmd" : "@stable",
- "phpunit/phpunit": "~5.4",
- "phpspec/phpspec": "~2.1",
- "sebastian/phpcpd": "^2.0.4",
- "squizlabs/php_codesniffer": "2.*",
+ "mockery/mockery": "^1.5.0",
+ "phpunit/phpunit": "~8.0",
+ "squizlabs/php_codesniffer": "^3.6",
"symfony/css-selector": "~3.0",
- "symfony/dom-crawler": "~3.0"
+ "symfony/dom-crawler": "~3.0",
+ "rector/rector": "^0.12.21",
+ "pdepend/pdepend": "^2.10",
+ "phpmd/phpmd": "^2.12",
+ "phpspec/phpspec": "^7.2",
+ "nasqueron/codestyle": "^0.1.0"
},
"autoload": {
"psr-4": {
@@ -48,13 +48,16 @@
"php artisan key:generate"
],
"phpmd": [
- "vendor/bin/phpmd app/ xml ruleset.xml"
+ "vendor/bin/phpmd app/ xml phpcs.xml"
],
"test": [
"phpunit --no-coverage"
]
},
"config": {
- "preferred-install": "dist"
+ "preferred-install": "dist",
+ "allow-plugins": {
+ "kylekatarnls/update-helper": true
+ }
}
}
diff --git a/ruleset.xml b/ruleset.xml
deleted file mode 100644
--- a/ruleset.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0"?>
-<ruleset name="Nasqueron PHPMD rule set"
- xmlns="http://pmd.sf.net/ruleset/1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
- http://pmd.sf.net/ruleset_xml_schema.xsd"
- xsi:noNamespaceSchemaLocation="
- http://pmd.sf.net/ruleset_xml_schema.xsd">
- <description>
- The PHPMD rule set for Nasqueron projects.
- </description>
-
- <rule ref="rulesets/unusedcode.xml" />
- <rule ref="rulesets/naming.xml/BooleanGetMethodName" />
- <rule ref="rulesets/naming.xml/ConstantNamingConventions" />
- <rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" />
- <rule ref="rulesets/cleancode.xml/BooleanArgumentFlag" />
-</ruleset>
diff --git a/tests/Actions/AMQPActionTest.php b/tests/Actions/AMQPActionTest.php
--- a/tests/Actions/AMQPActionTest.php
+++ b/tests/Actions/AMQPActionTest.php
@@ -2,8 +2,6 @@
namespace Nasqueron\Notifications\Tests\Actions;
-use Illuminate\Foundation\Testing\WithoutMiddleware;
-
use Nasqueron\Notifications\Actions\AMQPAction;
use Nasqueron\Notifications\Tests\TestCase;
diff --git a/tests/Actions/ActionErrorTest.php b/tests/Actions/ActionErrorTest.php
--- a/tests/Actions/ActionErrorTest.php
+++ b/tests/Actions/ActionErrorTest.php
@@ -2,8 +2,6 @@
namespace Nasqueron\Notifications\Tests\Actions;
-use Illuminate\Foundation\Testing\WithoutMiddleware;
-
use Nasqueron\Notifications\Actions\ActionError;
use Nasqueron\Notifications\Tests\TestCase;
diff --git a/tests/Actions/ActionsReportTest.php b/tests/Actions/ActionsReportTest.php
--- a/tests/Actions/ActionsReportTest.php
+++ b/tests/Actions/ActionsReportTest.php
@@ -2,8 +2,6 @@
namespace Nasqueron\Notifications\Tests\Actions;
-use Illuminate\Foundation\Testing\WithoutMiddleware;
-
use Nasqueron\Notifications\Actions\ActionError;
use Nasqueron\Notifications\Actions\ActionsReport;
use Nasqueron\Notifications\Actions\AMQPAction;
diff --git a/tests/Actions/NotifyNewCommitsActionTest.php b/tests/Actions/NotifyNewCommitsActionTest.php
--- a/tests/Actions/NotifyNewCommitsActionTest.php
+++ b/tests/Actions/NotifyNewCommitsActionTest.php
@@ -2,8 +2,6 @@
namespace Nasqueron\Notifications\Tests\Actions;
-use Illuminate\Foundation\Testing\WithoutMiddleware;
-
use Nasqueron\Notifications\Actions\NotifyNewCommitsAction;
use Nasqueron\Notifications\Tests\TestCase;
diff --git a/tests/Actions/TriggerDockerHubBuildActionTest.php b/tests/Actions/TriggerDockerHubBuildActionTest.php
--- a/tests/Actions/TriggerDockerHubBuildActionTest.php
+++ b/tests/Actions/TriggerDockerHubBuildActionTest.php
@@ -2,8 +2,6 @@
namespace Nasqueron\Notifications\Tests\Actions;
-use Illuminate\Foundation\Testing\WithoutMiddleware;
-
use Nasqueron\Notifications\Actions\TriggerDockerHubBuildAction;
use Nasqueron\Notifications\Tests\TestCase;
diff --git a/tests/Analyzers/GitHub/Events/DeleteEventTest.php b/tests/Analyzers/GitHub/Events/DeleteEventTest.php
--- a/tests/Analyzers/GitHub/Events/DeleteEventTest.php
+++ b/tests/Analyzers/GitHub/Events/DeleteEventTest.php
@@ -11,7 +11,7 @@
*/
private $event;
- public function setUp () {
+ public function setUp(): void {
$payload = new \stdClass;
$payload->repository = new \stdClass;
$payload->repository->full_name = 'baxterthehacker/public-repo';
diff --git a/tests/Analyzers/GitHub/Events/IssueCommentEventTest.php b/tests/Analyzers/GitHub/Events/IssueCommentEventTest.php
--- a/tests/Analyzers/GitHub/Events/IssueCommentEventTest.php
+++ b/tests/Analyzers/GitHub/Events/IssueCommentEventTest.php
@@ -12,7 +12,7 @@
*/
private $payload;
- public function setUp () {
+ public function setUp(): void {
$filename = __DIR__ . "/../../../data/payloads/GitHubEvents/issue_comment.json";
$this->payload = json_decode(file_get_contents($filename));
diff --git a/tests/Analyzers/GitHub/Events/PullRequestEventTest.php b/tests/Analyzers/GitHub/Events/PullRequestEventTest.php
--- a/tests/Analyzers/GitHub/Events/PullRequestEventTest.php
+++ b/tests/Analyzers/GitHub/Events/PullRequestEventTest.php
@@ -12,7 +12,7 @@
*/
private $payload;
- public function setUp () {
+ public function setUp(): void {
$filename = __DIR__ . "/../../../data/payloads/GitHubEvents/pull_request.json";
$this->payload = json_decode(file_get_contents($filename));
diff --git a/tests/Analyzers/GitHub/Events/PushEventTest.php b/tests/Analyzers/GitHub/Events/PushEventTest.php
--- a/tests/Analyzers/GitHub/Events/PushEventTest.php
+++ b/tests/Analyzers/GitHub/Events/PushEventTest.php
@@ -12,7 +12,7 @@
*/
private $payloads;
- public function setUp () {
+ public function setUp(): void {
$payloadsToPrepare = [
'0' => 'GitHubPushForceZeroPayload.json',
'1' => 'GitHubEvents/push.json',
diff --git a/tests/Analyzers/GitHub/Events/StatusEventTest.php b/tests/Analyzers/GitHub/Events/StatusEventTest.php
--- a/tests/Analyzers/GitHub/Events/StatusEventTest.php
+++ b/tests/Analyzers/GitHub/Events/StatusEventTest.php
@@ -12,7 +12,7 @@
*/
private $payload;
- public function setUp () {
+ public function setUp(): void {
$filename = __DIR__ . "/../../../data/payloads/GitHubEvents/status.json";
$this->payload = json_decode(file_get_contents($filename));
diff --git a/tests/Analyzers/GitHub/Events/UnknownEventTest.php b/tests/Analyzers/GitHub/Events/UnknownEventTest.php
--- a/tests/Analyzers/GitHub/Events/UnknownEventTest.php
+++ b/tests/Analyzers/GitHub/Events/UnknownEventTest.php
@@ -12,7 +12,7 @@
*/
private $event;
- public function setUp () {
+ public function setUp(): void {
$filename = __DIR__ . "/../../../data/payloads/GitHubEvents/push.json";
$payload = json_decode(file_get_contents($filename));
$this->event = new UnknownEvent("quux", $payload);
diff --git a/tests/Analyzers/GitHub/GitHubPayloadAnalyzerTest.php b/tests/Analyzers/GitHub/GitHubPayloadAnalyzerTest.php
--- a/tests/Analyzers/GitHub/GitHubPayloadAnalyzerTest.php
+++ b/tests/Analyzers/GitHub/GitHubPayloadAnalyzerTest.php
@@ -30,7 +30,7 @@
/**
* Prepares the tests
*/
- public function setUp () {
+ public function setUp(): void {
parent::setUp();
$this->unknownEventAnalyzer = new GitHubPayloadAnalyzer(
@@ -64,14 +64,8 @@
);
}
- ///
- /// Test constructor
- ///
-
- /**
- * @expectedException TypeError
- */
- public function testConstructorThrowsAnExceptionWhenPayloadIsInvalid () {
+ public function testConstructorThrowsAnExceptionWhenPayloadIsInvalid() {
+ $this->expectException( \TypeError::class );
new GitHubPayloadAnalyzer(
"Acme",
"push",
diff --git a/tests/Analyzers/Jenkins/JenkinsPayloadAnalyzerConfigurationTest.php b/tests/Analyzers/Jenkins/JenkinsPayloadAnalyzerConfigurationTest.php
--- a/tests/Analyzers/Jenkins/JenkinsPayloadAnalyzerConfigurationTest.php
+++ b/tests/Analyzers/Jenkins/JenkinsPayloadAnalyzerConfigurationTest.php
@@ -2,10 +2,8 @@
namespace Nasqueron\Notifications\Tests\Analyzers;
-use Illuminate\Foundation\Testing\WithoutMiddleware;
-
-use Nasqueron\Notifications\Analyzers\Jenkins\JenkinsPayloadAnalyzerConfiguration;
use Nasqueron\Notifications\Analyzers\ItemGroupMapping;
+use Nasqueron\Notifications\Analyzers\Jenkins\JenkinsPayloadAnalyzerConfiguration;
use Nasqueron\Notifications\Tests\TestCase;
class JenkinsPayloadAnalyzerConfigurationTest extends TestCase {
@@ -20,7 +18,7 @@
/**
* Prepares the test
*/
- public function setUp () {
+ public function setUp(): void {
$filename = __DIR__ . '/../../data/JenkinsPayloadAnalyzer/Nasqueron.json';
$mapper = new \JsonMapper();
$this->configuration = $mapper->map(
diff --git a/tests/Analyzers/Jenkins/JenkinsPayloadAnalyzerTest.php b/tests/Analyzers/Jenkins/JenkinsPayloadAnalyzerTest.php
--- a/tests/Analyzers/Jenkins/JenkinsPayloadAnalyzerTest.php
+++ b/tests/Analyzers/Jenkins/JenkinsPayloadAnalyzerTest.php
@@ -3,7 +3,6 @@
namespace Nasqueron\Notifications\Tests\Analyzers;
use Nasqueron\Notifications\Analyzers\Jenkins\JenkinsPayloadAnalyzer;
-use Nasqueron\Notifications\Analyzers\Jenkins\JenkinsPayloadAnalyzerConfiguration;
use Nasqueron\Notifications\Tests\TestCase;
class JenkinsPayloadAnalyzerTest extends TestCase {
diff --git a/tests/Analyzers/PayloadAnalyzerConfigurationTest.php b/tests/Analyzers/PayloadAnalyzerConfigurationTest.php
--- a/tests/Analyzers/PayloadAnalyzerConfigurationTest.php
+++ b/tests/Analyzers/PayloadAnalyzerConfigurationTest.php
@@ -2,10 +2,8 @@
namespace Nasqueron\Notifications\Tests\Analyzers;
-use Illuminate\Foundation\Testing\WithoutMiddleware;
-
-use Nasqueron\Notifications\Analyzers\PayloadAnalyzerConfiguration;
use Nasqueron\Notifications\Analyzers\ItemGroupMapping;
+use Nasqueron\Notifications\Analyzers\PayloadAnalyzerConfiguration;
use Nasqueron\Notifications\Tests\TestCase;
class PayloadAnalyzerConfigurationTest extends TestCase {
diff --git a/tests/Analyzers/Phabricator/PhabricatorGroupMappingTest.php b/tests/Analyzers/Phabricator/PhabricatorGroupMappingTest.php
--- a/tests/Analyzers/Phabricator/PhabricatorGroupMappingTest.php
+++ b/tests/Analyzers/Phabricator/PhabricatorGroupMappingTest.php
@@ -19,7 +19,7 @@
*/
private $story;
- public function setUp () {
+ public function setUp(): void {
parent::setUp();
$config = $this->getPhabricatorPayloadAnalyzerConfiguration();
diff --git a/tests/Analyzers/Phabricator/PhabricatorPayloadAnalyzerTest.php b/tests/Analyzers/Phabricator/PhabricatorPayloadAnalyzerTest.php
--- a/tests/Analyzers/Phabricator/PhabricatorPayloadAnalyzerTest.php
+++ b/tests/Analyzers/Phabricator/PhabricatorPayloadAnalyzerTest.php
@@ -19,7 +19,7 @@
*/
private $story;
- public function setUp () {
+ public function setUp(): void {
parent::setUp();
$this->story = $this->getStory();
diff --git a/tests/Config/Reporting/ServiceReportEntryTest.php b/tests/Config/Reporting/ServiceReportEntryTest.php
--- a/tests/Config/Reporting/ServiceReportEntryTest.php
+++ b/tests/Config/Reporting/ServiceReportEntryTest.php
@@ -3,7 +3,6 @@
namespace Nasqueron\Notifications\Tests\Config\Reporting;
use Nasqueron\Notifications\Config\Reporting\ServiceReportEntry;
-use Nasqueron\Notifications\Config\Services\Service;
use Nasqueron\Notifications\Tests\TestCase;
class ServiceReportEntryTest extends TestCase {
diff --git a/tests/Config/Services/ServiceTest.php b/tests/Config/Services/ServiceTest.php
--- a/tests/Config/Services/ServiceTest.php
+++ b/tests/Config/Services/ServiceTest.php
@@ -17,7 +17,7 @@
*/
private $serviceWithoutInstance;
- public function setUp () {
+ public function setUp(): void {
$this->serviceWithoutInstance = new Service();
$this->serviceWithInstance = clone $this->serviceWithoutInstance;
diff --git a/tests/Console/Commands/ConfigShowTest.php b/tests/Console/Commands/ConfigShowTest.php
--- a/tests/Console/Commands/ConfigShowTest.php
+++ b/tests/Console/Commands/ConfigShowTest.php
@@ -2,10 +2,8 @@
namespace Nasqueron\Notifications\Tests\Console\Commands;
-use Nasqueron\Notifications\Config\Features;
-use Nasqueron\Notifications\Config\Services\Service;
-
use Mockery;
+use Nasqueron\Notifications\Config\Features;
class ConfigShowTest extends TestCase {
diff --git a/tests/Console/Commands/PhabricatorProjectsMapTest.php b/tests/Console/Commands/PhabricatorProjectsMapTest.php
--- a/tests/Console/Commands/PhabricatorProjectsMapTest.php
+++ b/tests/Console/Commands/PhabricatorProjectsMapTest.php
@@ -2,7 +2,6 @@
namespace Nasqueron\Notifications\Tests\Console\Commands;
-use Nasqueron\Notifications\Config\Services\Service;
use Nasqueron\Notifications\Console\Commands\PhabricatorProjectsMap;
class PhabricatorProjectsMapTest extends TestCase {
@@ -12,7 +11,7 @@
*/
protected $class = PhabricatorProjectsMap::class;
- public function setUp () {
+ public function setUp(): void {
parent::setUp();
$service = $this->mockService('Phabricator');
diff --git a/tests/Console/Commands/TestCase.php b/tests/Console/Commands/TestCase.php
--- a/tests/Console/Commands/TestCase.php
+++ b/tests/Console/Commands/TestCase.php
@@ -2,14 +2,10 @@
namespace Nasqueron\Notifications\Tests\Console\Commands;
-use Nasqueron\Notifications\Config\Services\Service;
-use Nasqueron\Notifications\Tests\TestCase as BaseTestCase;
-
use Illuminate\Contracts\Console\Kernel;
+use Nasqueron\Notifications\Tests\TestCase as BaseTestCase;
use Symfony\Component\Console\Tester\CommandTester;
-use Mockery;
-
class TestCase extends BaseTestCase {
///
diff --git a/tests/Console/KernelTest.php b/tests/Console/KernelTest.php
--- a/tests/Console/KernelTest.php
+++ b/tests/Console/KernelTest.php
@@ -2,13 +2,9 @@
namespace Nasqueron\Notifications\Tests\Console;
-use Nasqueron\Notifications\Tests\TestCase;
-
-use Nasqueron\Notifications\Console\Kernel;
-use Illuminate\Contracts\Console\Kernel as BaseKernel;
-
-use Artisan;
use File;
+use Illuminate\Contracts\Console\Kernel as BaseKernel;
+use Nasqueron\Notifications\Tests\TestCase;
class KernelTest extends TestCase {
/**
@@ -30,7 +26,7 @@
*/
private $namespace;
- public function setUp () {
+ public function setUp(): void {
parent::setUp();
$this->kernel = $this->app->make(BaseKernel::class);
diff --git a/tests/Exceptions/HandlerTest.php b/tests/Exceptions/HandlerTest.php
--- a/tests/Exceptions/HandlerTest.php
+++ b/tests/Exceptions/HandlerTest.php
@@ -2,13 +2,12 @@
namespace Nasqueron\Notifications\Tests\Exceptions;
-use Illuminate\Auth\Access\AuthorizationException;
-use Nasqueron\Notifications\Exceptions\Handler;
-use Nasqueron\Notifications\Tests\TestCase;
-
use App;
use Config;
+use Illuminate\Auth\Access\AuthorizationException;
use Mockery;
+use Nasqueron\Notifications\Exceptions\Handler;
+use Nasqueron\Notifications\Tests\TestCase;
class HandlerTest extends TestCase {
diff --git a/tests/Facades/DockerHubTest.php b/tests/Facades/DockerHubTest.php
--- a/tests/Facades/DockerHubTest.php
+++ b/tests/Facades/DockerHubTest.php
@@ -2,12 +2,9 @@
namespace Nasqueron\Notifications\Tests\Facades;
-use Nasqueron\Notifications\Tests\TestCase;
-
-use Config;
use DockerHub;
-
use Keruald\DockerHub\Build\TriggerBuildFactory;
+use Nasqueron\Notifications\Tests\TestCase;
class DockerHubTest extends TestCase {
diff --git a/tests/Http/Controllers/GitHubGateControllerTest.php b/tests/Http/Controllers/GitHubGateControllerTest.php
--- a/tests/Http/Controllers/GitHubGateControllerTest.php
+++ b/tests/Http/Controllers/GitHubGateControllerTest.php
@@ -5,7 +5,7 @@
use Nasqueron\Notifications\Tests\TestCase;
class GitHubGateControllerTest extends TestCase {
- public function setUp () {
+ public function setUp(): void {
parent::setUp();
$this->disableEvents();
diff --git a/tests/Http/PayloadFullTest.php b/tests/Http/PayloadFullTest.php
--- a/tests/Http/PayloadFullTest.php
+++ b/tests/Http/PayloadFullTest.php
@@ -7,7 +7,7 @@
class PayloadFullTest extends TestCase {
- public function setUp () {
+ public function setUp(): void {
parent::setUp();
$this->disableBroker();
diff --git a/tests/Notifications/DockerHubNotificationTest.php b/tests/Notifications/DockerHubNotificationTest.php
--- a/tests/Notifications/DockerHubNotificationTest.php
+++ b/tests/Notifications/DockerHubNotificationTest.php
@@ -2,12 +2,10 @@
namespace Nasqueron\Notifications\Tests\Notifications;
-use Nasqueron\Notifications\Notifications\DockerHubNotification;
-use Nasqueron\Notifications\Tests\TestCase;
-
use Keruald\Mailgun\Tests\WithMockHttpClient;
-
use Mockery;
+use Nasqueron\Notifications\Notifications\DockerHubNotification;
+use Nasqueron\Notifications\Tests\TestCase;
class DockerHubNotificationTest extends TestCase {
diff --git a/tests/Phabricator/PhabricatorAPIExceptionTest.php b/tests/Phabricator/PhabricatorAPIExceptionTest.php
--- a/tests/Phabricator/PhabricatorAPIExceptionTest.php
+++ b/tests/Phabricator/PhabricatorAPIExceptionTest.php
@@ -12,7 +12,7 @@
*/
private $exception;
- public function setUp () {
+ public function setUp(): void {
$this->exception = new PhabricatorAPIException(
100,
"Lorem ipsum dolor"
diff --git a/tests/Phabricator/ProjectsMapTest.php b/tests/Phabricator/ProjectsMapTest.php
--- a/tests/Phabricator/ProjectsMapTest.php
+++ b/tests/Phabricator/ProjectsMapTest.php
@@ -6,8 +6,6 @@
use Nasqueron\Notifications\Phabricator\ProjectsMap;
use Nasqueron\Notifications\Tests\TestCase;
-use Mockery;
-
class ProjectsMapTest extends TestCase {
/**
@@ -15,7 +13,7 @@
*/
private $map;
- public function setUp () {
+ public function setUp(): void {
parent::setUp();
//
diff --git a/tests/Providers/ConfigTest.php b/tests/Providers/ConfigTest.php
--- a/tests/Providers/ConfigTest.php
+++ b/tests/Providers/ConfigTest.php
@@ -20,7 +20,7 @@
*/
private $namespace;
- public function setUp () {
+ public function setUp(): void {
parent::setUp();
$this->providers = Config::get('app.providers');
diff --git a/tests/Providers/RouteServiceProviderTest..php b/tests/Providers/RouteServiceProviderTest.php
rename from tests/Providers/RouteServiceProviderTest..php
rename to tests/Providers/RouteServiceProviderTest.php
--- a/tests/Providers/RouteServiceProviderTest..php
+++ b/tests/Providers/RouteServiceProviderTest.php
@@ -2,7 +2,7 @@
namespace Nasqueron\Notifications\Tests\Providers;
-class BrokerServiceProviderTest extends TestCase {
+class RouteServiceProviderTest extends TestCase {
public function testType () {
$this->assertServiceInstanceOf(
diff --git a/tests/TestCase.php b/tests/TestCase.php
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -2,13 +2,10 @@
namespace Nasqueron\Notifications\Tests;
-use Nasqueron\Notifications\Config\Services\Service;
-
use Illuminate\Contracts\Console\Kernel;
use Keruald\Broker\BlackholeBroker;
-use Keruald\Broker\Broker;
-
use Mockery;
+use Nasqueron\Notifications\Config\Services\Service;
class TestCase extends \Illuminate\Foundation\Testing\TestCase
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jun 16, 16:58 (14 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2737355
Default Alt Text
D2674.id6767.diff (45 KB)
Attached To
Mode
D2674: Update Laravel 8
Attached
Detach File
Event Timeline
Log In to Comment