From 7772b71e78bbfe5da80cb4aae999c5c09e394f78 Mon Sep 17 00:00:00 2001
From: Thibault Debatty <thibault.debatty@gmail.com>
Date: Mon, 17 Jun 2019 09:26:50 +0200
Subject: [PATCH] Fix unused imports using slevomat coding standards

---
 app/Http/Controllers/ServerController.php |  1 -
 app/Mail/OrganizationUserInvitation.php   |  1 -
 app/Mail/StatusChanged.php                |  1 -
 app/Providers/AuthServiceProvider.php     |  1 -
 app/Providers/EventServiceProvider.php    |  1 -
 composer.json                             |  1 +
 composer.lock                             | 89 ++++++++++++++++++++++-
 phpcs.xml                                 |  6 ++
 8 files changed, 95 insertions(+), 6 deletions(-)

diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php
index 0e8219b..a914032 100644
--- a/app/Http/Controllers/ServerController.php
+++ b/app/Http/Controllers/ServerController.php
@@ -2,7 +2,6 @@
 namespace App\Http\Controllers;
 
 use App\Server;
-use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\Validator;
 use Illuminate\Http\Request;
 
diff --git a/app/Mail/OrganizationUserInvitation.php b/app/Mail/OrganizationUserInvitation.php
index 859d730..a81007e 100644
--- a/app/Mail/OrganizationUserInvitation.php
+++ b/app/Mail/OrganizationUserInvitation.php
@@ -8,7 +8,6 @@ use App\User;
 use Illuminate\Bus\Queueable;
 use Illuminate\Mail\Mailable;
 use Illuminate\Queue\SerializesModels;
-use Illuminate\Contracts\Queue\ShouldQueue;
 
 class OrganizationUserInvitation extends Mailable
 {
diff --git a/app/Mail/StatusChanged.php b/app/Mail/StatusChanged.php
index e401a01..31d90cb 100644
--- a/app/Mail/StatusChanged.php
+++ b/app/Mail/StatusChanged.php
@@ -5,7 +5,6 @@ namespace App\Mail;
 use Illuminate\Bus\Queueable;
 use Illuminate\Mail\Mailable;
 use Illuminate\Queue\SerializesModels;
-use Illuminate\Contracts\Queue\ShouldQueue;
 
 class StatusChanged extends Mailable
 {
diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php
index 9784b1a..9e68caa 100644
--- a/app/Providers/AuthServiceProvider.php
+++ b/app/Providers/AuthServiceProvider.php
@@ -2,7 +2,6 @@
 
 namespace App\Providers;
 
-use Illuminate\Support\Facades\Gate;
 use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
 
 class AuthServiceProvider extends ServiceProvider
diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php
index fca6152..ea13b73 100644
--- a/app/Providers/EventServiceProvider.php
+++ b/app/Providers/EventServiceProvider.php
@@ -2,7 +2,6 @@
 
 namespace App\Providers;
 
-use Illuminate\Support\Facades\Event;
 use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
 
 class EventServiceProvider extends ServiceProvider
diff --git a/composer.json b/composer.json
index 72ac5ba..d4e8633 100644
--- a/composer.json
+++ b/composer.json
@@ -20,6 +20,7 @@
         "fzaninotto/faker": "~1.4",
         "mockery/mockery": "~1.0",
         "phpunit/phpunit": "~7.0",
+        "slevomat/coding-standard": "^5.0",
         "squizlabs/php_codesniffer": "^3.4"
     },
     "autoload": {
diff --git a/composer.lock b/composer.lock
index a0d804c..f64fa9c 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "6d8a49523a8f09e6bdecf88d5c9d15c0",
+    "content-hash": "f5687f9e5df5768cf2c79413ca6a472f",
     "packages": [
         {
             "name": "composer/ca-bundle",
@@ -4193,6 +4193,53 @@
             ],
             "time": "2018-04-18T13:57:24+00:00"
         },
+        {
+            "name": "phpstan/phpdoc-parser",
+            "version": "0.3.5",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/phpstan/phpdoc-parser.git",
+                "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/8c4ef2aefd9788238897b678a985e1d5c8df6db4",
+                "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4",
+                "shasum": ""
+            },
+            "require": {
+                "php": "~7.1"
+            },
+            "require-dev": {
+                "consistence/coding-standard": "^3.5",
+                "jakub-onderka/php-parallel-lint": "^0.9.2",
+                "phing/phing": "^2.16.0",
+                "phpstan/phpstan": "^0.10",
+                "phpunit/phpunit": "^6.3",
+                "slevomat/coding-standard": "^4.7.2",
+                "squizlabs/php_codesniffer": "^3.3.2",
+                "symfony/process": "^3.4 || ^4.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "0.3-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "PHPStan\\PhpDocParser\\": [
+                        "src/"
+                    ]
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "description": "PHPDoc parser with support for nullable, intersection and generic types",
+            "time": "2019-06-07T19:13:52+00:00"
+        },
         {
             "name": "phpunit/php-code-coverage",
             "version": "6.0.7",
@@ -5089,6 +5136,46 @@
             "homepage": "https://github.com/sebastianbergmann/version",
             "time": "2016-10-03T07:35:21+00:00"
         },
+        {
+            "name": "slevomat/coding-standard",
+            "version": "5.0.4",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/slevomat/coding-standard.git",
+                "reference": "287ac3347c47918c0bf5e10335e36197ea10894c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/287ac3347c47918c0bf5e10335e36197ea10894c",
+                "reference": "287ac3347c47918c0bf5e10335e36197ea10894c",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.1",
+                "phpstan/phpdoc-parser": "^0.3.1",
+                "squizlabs/php_codesniffer": "^3.4.1"
+            },
+            "require-dev": {
+                "jakub-onderka/php-parallel-lint": "1.0.0",
+                "phing/phing": "2.16.1",
+                "phpstan/phpstan": "0.11.4",
+                "phpstan/phpstan-phpunit": "0.11",
+                "phpstan/phpstan-strict-rules": "0.11",
+                "phpunit/phpunit": "8.0.5"
+            },
+            "type": "phpcodesniffer-standard",
+            "autoload": {
+                "psr-4": {
+                    "SlevomatCodingStandard\\": "SlevomatCodingStandard"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.",
+            "time": "2019-03-22T19:10:53+00:00"
+        },
         {
             "name": "squizlabs/php_codesniffer",
             "version": "3.4.2",
diff --git a/phpcs.xml b/phpcs.xml
index 998c373..af56bb8 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -20,5 +20,11 @@
 
     <!-- Show progression -->
     <arg value="p"/>
+    
+    <!-- Add some additional rules from slevomat 
+    see list of available rules at https://github.com/slevomat/coding-standard/ -->
+    <config name="installed_paths" value="../../slevomat/coding-standard"/>
+    <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/>
+    
 </ruleset>
 
-- 
GitLab