From 509f58253900ce3115e217a8cbe0bf631f61e01e Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Tue, 30 Dec 2014 18:19:22 +0000 Subject: [PATCH] CS fixes --- .../Controllers/Api/ComponentController.php | 13 ++-- .../Controllers/Api/IncidentController.php | 9 ++- .../Controllers/Api/MetricController.php | 9 ++- .../Controllers/Api/MetricPointController.php | 7 +- .../Component/ComponentRepository.php | 1 - .../Component/EloquentComponentRepository.php | 1 - .../Repositories/EloquentRepository.php | 69 ++++++++++++------- .../Incident/EloquentIncidentRepository.php | 1 - .../Incident/IncidentRepository.php | 1 - .../Metric/EloquentMetricRepository.php | 1 - .../Repositories/Metric/MetricRepository.php | 1 - .../EloquentMetricPointRepository.php | 1 - .../MetricPoint/MetricPointRepository.php | 1 - .../RoutingServiceProvider.php | 4 +- .../Transformers/ComponentTransformer.php | 1 - .../Transformers/IncidentTransformer.php | 1 - .../Transformers/MetricPointTransformer.php | 1 - .../Cachet/Transformers/MetricTransformer.php | 1 - app/controllers/DashAPIController.php | 4 +- app/controllers/DashboardController.php | 1 + app/controllers/HomeController.php | 2 +- ...326_AlterTableComponentsAddMetaColumns.php | 57 ++++++++------- app/helpers.php | 3 +- app/models/Component.php | 7 +- app/models/IncidentTemplate.php | 1 + app/models/Metric.php | 3 + app/models/MetricPoint.php | 1 + app/models/Service.php | 5 +- app/models/Setting.php | 13 ++-- app/models/User.php | 10 ++- app/models/WebHook.php | 16 +++-- app/models/WebHookResponse.php | 1 + app/routes/dashboard.php | 2 +- .../Api/ComponentControllerTest.php | 1 - app/tests/TestCase.php | 1 - public/index.php | 3 +- 36 files changed, 143 insertions(+), 111 deletions(-) diff --git a/app/CachetHQ/Cachet/Controllers/Api/ComponentController.php b/app/CachetHQ/Cachet/Controllers/Api/ComponentController.php index 0dcaff47..9a94c77a 100644 --- a/app/CachetHQ/Cachet/Controllers/Api/ComponentController.php +++ b/app/CachetHQ/Cachet/Controllers/Api/ComponentController.php @@ -9,7 +9,6 @@ use Input; class ComponentController extends Controller { - use ControllerTrait; protected $component; @@ -20,7 +19,7 @@ class ComponentController extends Controller } /** - * Get all components + * Get all components. * * @return \Illuminate\Database\Eloquent\Collection */ @@ -30,7 +29,7 @@ class ComponentController extends Controller } /** - * Get a single component + * Get a single component. * * @param int $id * @@ -42,8 +41,10 @@ class ComponentController extends Controller } /** - * Return a component with incidents - * @param int $id Component ID + * Return a component with incidents. + * + * @param int $id Component ID + * * @return \Component */ public function getComponentIncidents($id) @@ -52,7 +53,7 @@ class ComponentController extends Controller } /** - * Create a new component + * Create a new component. * * @return \Component */ diff --git a/app/CachetHQ/Cachet/Controllers/Api/IncidentController.php b/app/CachetHQ/Cachet/Controllers/Api/IncidentController.php index ce7328bf..7b9653be 100644 --- a/app/CachetHQ/Cachet/Controllers/Api/IncidentController.php +++ b/app/CachetHQ/Cachet/Controllers/Api/IncidentController.php @@ -9,7 +9,6 @@ use Input; class IncidentController extends Controller { - use ControllerTrait; protected $incident; @@ -20,7 +19,7 @@ class IncidentController extends Controller } /** - * Get all incidents + * Get all incidents. * * @return \Illuminate\Database\Eloquent\Collection */ @@ -30,7 +29,7 @@ class IncidentController extends Controller } /** - * Get a single incident + * Get a single incident. * * @param int $id * @@ -42,7 +41,7 @@ class IncidentController extends Controller } /** - * Create a new incident + * Create a new incident. * * @return Incident */ @@ -52,7 +51,7 @@ class IncidentController extends Controller } /** - * Update an existing incident + * Update an existing incident. * * @param int $id * diff --git a/app/CachetHQ/Cachet/Controllers/Api/MetricController.php b/app/CachetHQ/Cachet/Controllers/Api/MetricController.php index b9b90645..5edd184c 100644 --- a/app/CachetHQ/Cachet/Controllers/Api/MetricController.php +++ b/app/CachetHQ/Cachet/Controllers/Api/MetricController.php @@ -9,7 +9,6 @@ use Input; class MetricController extends Controller { - use ControllerTrait; protected $metric; @@ -19,7 +18,7 @@ class MetricController extends Controller $this->metric = $metric; } /** - * Get all metrics + * Get all metrics. * * @return \Illuminate\Database\Eloquent\Collection */ @@ -29,7 +28,7 @@ class MetricController extends Controller } /** - * Get a single metric + * Get a single metric. * * @param int $id * @@ -41,7 +40,7 @@ class MetricController extends Controller } /** - * Create a new metric + * Create a new metric. * * @return Metric */ @@ -51,7 +50,7 @@ class MetricController extends Controller } /** - * Update an existing metric + * Update an existing metric. * * @param int $id * diff --git a/app/CachetHQ/Cachet/Controllers/Api/MetricPointController.php b/app/CachetHQ/Cachet/Controllers/Api/MetricPointController.php index adddefe6..0f5da8cc 100644 --- a/app/CachetHQ/Cachet/Controllers/Api/MetricPointController.php +++ b/app/CachetHQ/Cachet/Controllers/Api/MetricPointController.php @@ -9,7 +9,6 @@ use Input; class MetricPointController extends Controller { - use ControllerTrait; protected $metricpoint; @@ -19,7 +18,7 @@ class MetricPointController extends Controller $this->metricpoint = $metricpoint; } /** - * Get all metric points + * Get all metric points. * * @return \Illuminate\Database\Eloquent\Collection */ @@ -29,7 +28,7 @@ class MetricPointController extends Controller } /** - * Get a single metric point + * Get a single metric point. * * @param int $id * @@ -41,7 +40,7 @@ class MetricPointController extends Controller } /** - * Create a new metric point + * Create a new metric point. * * @return MetricPoint */ diff --git a/app/CachetHQ/Cachet/Repositories/Component/ComponentRepository.php b/app/CachetHQ/Cachet/Repositories/Component/ComponentRepository.php index 34d54f9a..f2fd58e1 100644 --- a/app/CachetHQ/Cachet/Repositories/Component/ComponentRepository.php +++ b/app/CachetHQ/Cachet/Repositories/Component/ComponentRepository.php @@ -4,7 +4,6 @@ namespace CachetHQ\Cachet\Repositories\Component; interface ComponentRepository { - public function all(); public function create($id, array $array); diff --git a/app/CachetHQ/Cachet/Repositories/Component/EloquentComponentRepository.php b/app/CachetHQ/Cachet/Repositories/Component/EloquentComponentRepository.php index 7a466074..3f85a391 100644 --- a/app/CachetHQ/Cachet/Repositories/Component/EloquentComponentRepository.php +++ b/app/CachetHQ/Cachet/Repositories/Component/EloquentComponentRepository.php @@ -7,7 +7,6 @@ use Component; class EloquentComponentRepository extends EloquentRepository implements ComponentRepository { - protected $model; public function __construct(Component $model) diff --git a/app/CachetHQ/Cachet/Repositories/EloquentRepository.php b/app/CachetHQ/Cachet/Repositories/EloquentRepository.php index 79b53ff3..190d37c7 100644 --- a/app/CachetHQ/Cachet/Repositories/EloquentRepository.php +++ b/app/CachetHQ/Cachet/Repositories/EloquentRepository.php @@ -7,9 +7,9 @@ use Illuminate\Database\Eloquent\ModelNotFoundException; abstract class EloquentRepository { - /** - * Returns all models + * Returns all models. + * * @return object */ public function all() @@ -18,9 +18,11 @@ abstract class EloquentRepository } /** - * Returns an object with related relationships - * @param id $id - * @param array $with Array of model relationships + * Returns an object with related relationships. + * + * @param id $id + * @param array $with Array of model relationships + * * @return object|ModelNotFoundException */ public function with($id, array $with = []) @@ -29,9 +31,11 @@ abstract class EloquentRepository } /** - * Sets the model to query against a user id - * @param integer $id - * @param string $column + * Sets the model to query against a user id. + * + * @param int $id + * @param string $column + * * @return $this */ public function withAuth($id, $column = 'user_id') @@ -42,8 +46,10 @@ abstract class EloquentRepository } /** - * Finds a model by ID - * @param int $id + * Finds a model by ID. + * + * @param int $id + * * @return object */ public function find(int $id) @@ -52,8 +58,10 @@ abstract class EloquentRepository } /** - * Finds a model by ID - * @param integer $id + * Finds a model by ID. + * + * @param int $id + * * @return object|ModelNotFoundException */ public function findOrFail($id) @@ -62,10 +70,12 @@ abstract class EloquentRepository } /** - * Finds a model by type - * @param string $key - * @param string $value - * @param array $columns + * Finds a model by type. + * + * @param string $key + * @param string $value + * @param array $columns + * * @return object|ModelNotFoundException */ public function findByOrFail($key, $value, $columns = ['*']) @@ -78,10 +88,12 @@ abstract class EloquentRepository } /** - * Counts the number of rows returned - * @param string $key - * @param string $value - * @return integer + * Counts the number of rows returned. + * + * @param string $key + * @param string $value + * + * @return int */ public function count($key = null, $value = null) { @@ -93,7 +105,8 @@ abstract class EloquentRepository } /** - * Deletes a model by ID + * Deletes a model by ID. + * * @param inetegr $id */ public function destroy($id) @@ -102,8 +115,10 @@ abstract class EloquentRepository } /** - * Validate a given model with Watson validation - * @param object $model + * Validate a given model with Watson validation. + * + * @param object $model + * * @return Exception */ public function validate($model) @@ -116,9 +131,11 @@ abstract class EloquentRepository } /** - * Validate whether a model has a correct relationship - * @param object $model - * @param string $relationship Name of the relationship to validate against + * Validate whether a model has a correct relationship. + * + * @param object $model + * @param string $relationship Name of the relationship to validate against + * * @return Exception */ public function hasRelationship($model, $relationship) diff --git a/app/CachetHQ/Cachet/Repositories/Incident/EloquentIncidentRepository.php b/app/CachetHQ/Cachet/Repositories/Incident/EloquentIncidentRepository.php index 2e8c750b..26bf1104 100644 --- a/app/CachetHQ/Cachet/Repositories/Incident/EloquentIncidentRepository.php +++ b/app/CachetHQ/Cachet/Repositories/Incident/EloquentIncidentRepository.php @@ -7,7 +7,6 @@ use Incident; class EloquentIncidentRepository extends EloquentRepository implements IncidentRepository { - protected $model; public function __construct(Incident $model) diff --git a/app/CachetHQ/Cachet/Repositories/Incident/IncidentRepository.php b/app/CachetHQ/Cachet/Repositories/Incident/IncidentRepository.php index 6e609869..40b4eae1 100644 --- a/app/CachetHQ/Cachet/Repositories/Incident/IncidentRepository.php +++ b/app/CachetHQ/Cachet/Repositories/Incident/IncidentRepository.php @@ -4,7 +4,6 @@ namespace CachetHQ\Cachet\Repositories\Incident; interface IncidentRepository { - public function all(); public function create($id, array $array); diff --git a/app/CachetHQ/Cachet/Repositories/Metric/EloquentMetricRepository.php b/app/CachetHQ/Cachet/Repositories/Metric/EloquentMetricRepository.php index e49ed8c2..d068bd4f 100644 --- a/app/CachetHQ/Cachet/Repositories/Metric/EloquentMetricRepository.php +++ b/app/CachetHQ/Cachet/Repositories/Metric/EloquentMetricRepository.php @@ -7,7 +7,6 @@ use Metric; class EloquentMetricRepository extends EloquentRepository implements MetricRepository { - protected $model; public function __construct(Metric $model) diff --git a/app/CachetHQ/Cachet/Repositories/Metric/MetricRepository.php b/app/CachetHQ/Cachet/Repositories/Metric/MetricRepository.php index dd981d50..870c74fd 100644 --- a/app/CachetHQ/Cachet/Repositories/Metric/MetricRepository.php +++ b/app/CachetHQ/Cachet/Repositories/Metric/MetricRepository.php @@ -4,7 +4,6 @@ namespace CachetHQ\Cachet\Repositories\Metric; interface MetricRepository { - public function all(); public function create(array $array); diff --git a/app/CachetHQ/Cachet/Repositories/MetricPoint/EloquentMetricPointRepository.php b/app/CachetHQ/Cachet/Repositories/MetricPoint/EloquentMetricPointRepository.php index cda39f5c..7276716f 100644 --- a/app/CachetHQ/Cachet/Repositories/MetricPoint/EloquentMetricPointRepository.php +++ b/app/CachetHQ/Cachet/Repositories/MetricPoint/EloquentMetricPointRepository.php @@ -7,7 +7,6 @@ use MetricPoint; class EloquentMetricPointRepository extends EloquentRepository implements MetricRepository { - protected $model; public function __construct(MetricPoint $model) diff --git a/app/CachetHQ/Cachet/Repositories/MetricPoint/MetricPointRepository.php b/app/CachetHQ/Cachet/Repositories/MetricPoint/MetricPointRepository.php index 7b6681f0..c64bb516 100644 --- a/app/CachetHQ/Cachet/Repositories/MetricPoint/MetricPointRepository.php +++ b/app/CachetHQ/Cachet/Repositories/MetricPoint/MetricPointRepository.php @@ -4,7 +4,6 @@ namespace CachetHQ\Cachet\Repositories\MetricPoint; interface MetricPointRepository { - public function all(); public function create(array $array); diff --git a/app/CachetHQ/Cachet/Support/ServiceProviders/RoutingServiceProvider.php b/app/CachetHQ/Cachet/Support/ServiceProviders/RoutingServiceProvider.php index b48b1759..20578640 100644 --- a/app/CachetHQ/Cachet/Support/ServiceProviders/RoutingServiceProvider.php +++ b/app/CachetHQ/Cachet/Support/ServiceProviders/RoutingServiceProvider.php @@ -7,7 +7,6 @@ use RecursiveDirectoryIterator; class RoutingServiceProvider extends ServiceProvider { - public function register() { } @@ -18,7 +17,8 @@ class RoutingServiceProvider extends ServiceProvider } /** - * Organise Routes + * Organise Routes. + * * @param string $app */ private function routesInDirectory($app = '') diff --git a/app/CachetHQ/Cachet/Transformers/ComponentTransformer.php b/app/CachetHQ/Cachet/Transformers/ComponentTransformer.php index 962b07c9..b67984a6 100644 --- a/app/CachetHQ/Cachet/Transformers/ComponentTransformer.php +++ b/app/CachetHQ/Cachet/Transformers/ComponentTransformer.php @@ -7,7 +7,6 @@ use League\Fractal\TransformerAbstract; class ComponentTransformer extends TransformerAbstract { - public function transform(Component $component) { return [ diff --git a/app/CachetHQ/Cachet/Transformers/IncidentTransformer.php b/app/CachetHQ/Cachet/Transformers/IncidentTransformer.php index 32bbd55e..0ecd291f 100644 --- a/app/CachetHQ/Cachet/Transformers/IncidentTransformer.php +++ b/app/CachetHQ/Cachet/Transformers/IncidentTransformer.php @@ -7,7 +7,6 @@ use League\Fractal\TransformerAbstract; class IncidentTransformer extends TransformerAbstract { - public function transform(Incident $incident) { $component = $incident->component; diff --git a/app/CachetHQ/Cachet/Transformers/MetricPointTransformer.php b/app/CachetHQ/Cachet/Transformers/MetricPointTransformer.php index fc20a112..def60b3b 100644 --- a/app/CachetHQ/Cachet/Transformers/MetricPointTransformer.php +++ b/app/CachetHQ/Cachet/Transformers/MetricPointTransformer.php @@ -7,7 +7,6 @@ use MetricPoint; class MetricPointTransformer extends TransformerAbstract { - public function transform(MetricPoint $metricPoint) { return [ diff --git a/app/CachetHQ/Cachet/Transformers/MetricTransformer.php b/app/CachetHQ/Cachet/Transformers/MetricTransformer.php index 09882756..caef7f60 100644 --- a/app/CachetHQ/Cachet/Transformers/MetricTransformer.php +++ b/app/CachetHQ/Cachet/Transformers/MetricTransformer.php @@ -7,7 +7,6 @@ use Metric; class MetricTransformer extends TransformerAbstract { - public function transform(Metric $metric) { return [ diff --git a/app/controllers/DashAPIController.php b/app/controllers/DashAPIController.php index d7b617d0..0a3c3f10 100644 --- a/app/controllers/DashAPIController.php +++ b/app/controllers/DashAPIController.php @@ -4,7 +4,9 @@ class DashAPIController extends Controller { /** * Updates a component with the entered info. - * @param Component $component + * + * @param Component $component + * * @return array */ public function postUpdateComponent(Component $component) diff --git a/app/controllers/DashboardController.php b/app/controllers/DashboardController.php index efdb331e..0020feff 100644 --- a/app/controllers/DashboardController.php +++ b/app/controllers/DashboardController.php @@ -11,6 +11,7 @@ class DashboardController extends Controller { // TODO: Find steps needed to complete setup. $components = Component::all(); + return View::make('dashboard.index')->with([ 'components' => $components, ]); diff --git a/app/controllers/HomeController.php b/app/controllers/HomeController.php index 65925ae5..8c8c48c9 100644 --- a/app/controllers/HomeController.php +++ b/app/controllers/HomeController.php @@ -5,7 +5,7 @@ class HomeController extends Controller /** * The component instance. * - * @var \Component $component + * @var \Component */ protected $component; diff --git a/app/database/migrations/2014_12_30_150326_AlterTableComponentsAddMetaColumns.php b/app/database/migrations/2014_12_30_150326_AlterTableComponentsAddMetaColumns.php index 1255847a..4c114efb 100644 --- a/app/database/migrations/2014_12_30_150326_AlterTableComponentsAddMetaColumns.php +++ b/app/database/migrations/2014_12_30_150326_AlterTableComponentsAddMetaColumns.php @@ -1,36 +1,33 @@ text('tags')->nullable()->default(null)->after('description'); - $table->text('link')->nullable()->default(null)->after('description'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('components', function(Blueprint $table) - { - $table->dropColumn('tags'); - $table->dropColumn('link'); - }); - } +class AlterTableComponentsAddMetaColumns extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('components', function (Blueprint $table) { + $table->text('tags')->nullable()->default(null)->after('description'); + $table->text('link')->nullable()->default(null)->after('description'); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('components', function (Blueprint $table) { + $table->dropColumn('tags'); + $table->dropColumn('link'); + }); + } } diff --git a/app/helpers.php b/app/helpers.php index 7b354ccd..0e6a3bc2 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -4,7 +4,8 @@ if (! function_exists('elixir')) { /** * Get the path to a versioned Elixir file. * - * @param string $file + * @param string $file + * * @return string */ function elixir($file) diff --git a/app/models/Component.php b/app/models/Component.php index d07b5be8..34111947 100644 --- a/app/models/Component.php +++ b/app/models/Component.php @@ -11,7 +11,7 @@ class Component extends Eloquent implements \Dingo\Api\Transformer\Transformable 'user_id' => 'integer|required', 'name' => 'required', 'status' => 'integer', - 'link' => 'url' + 'link' => 'url', ]; protected $fillable = [ @@ -20,11 +20,12 @@ class Component extends Eloquent implements \Dingo\Api\Transformer\Transformable 'status', 'user_id', 'tags', - 'link' + 'link', ]; /** * Lookup all of the incidents reported on the component. + * * @return Illuminate\Database\Eloquent\Relations */ public function incidents() @@ -34,6 +35,7 @@ class Component extends Eloquent implements \Dingo\Api\Transformer\Transformable /** * Looks up the human readable version of the status. + * * @return string */ public function getHumanStatusAttribute() @@ -43,6 +45,7 @@ class Component extends Eloquent implements \Dingo\Api\Transformer\Transformable /** * Get the transformer instance. + * * @return ComponentTransformer */ public function getTransformer() diff --git a/app/models/IncidentTemplate.php b/app/models/IncidentTemplate.php index 2514305e..728b1497 100644 --- a/app/models/IncidentTemplate.php +++ b/app/models/IncidentTemplate.php @@ -18,6 +18,7 @@ class IncidentTemplate extends Eloquent /** * Overrides the models boot method. + * * @return void */ public static function boot() diff --git a/app/models/Metric.php b/app/models/Metric.php index 7ff668be..7f83a570 100644 --- a/app/models/Metric.php +++ b/app/models/Metric.php @@ -16,6 +16,7 @@ class Metric extends Eloquent implements \Dingo\Api\Transformer\TransformableInt /** * Metrics contain many metric points. + * * @return Illuminate\Database\Eloquent\Builder */ public function points() @@ -25,6 +26,7 @@ class Metric extends Eloquent implements \Dingo\Api\Transformer\TransformableInt /** * Determines whether a chart should be shown. + * * @return bool */ public function getShouldDisplayAttribute() @@ -34,6 +36,7 @@ class Metric extends Eloquent implements \Dingo\Api\Transformer\TransformableInt /** * Get the transformer instance. + * * @return CachetHQ\Cachet\Transformers\MetricTransformer */ public function getTransformer() diff --git a/app/models/MetricPoint.php b/app/models/MetricPoint.php index 3647e3ce..4272ec94 100644 --- a/app/models/MetricPoint.php +++ b/app/models/MetricPoint.php @@ -4,6 +4,7 @@ class MetricPoint extends Eloquent { /** * A metric point belongs to a metric unit. + * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function metric() diff --git a/app/models/Service.php b/app/models/Service.php index 8a08ce00..91bf8704 100644 --- a/app/models/Service.php +++ b/app/models/Service.php @@ -14,7 +14,9 @@ class Service extends Eloquent /** * Returns a decoded properties object for the service. - * @param string $properties + * + * @param string $properties + * * @return object */ public function getPropertiesAttribute($properties) @@ -24,6 +26,7 @@ class Service extends Eloquent /** * Sets the properties attribute which auto encodes to a JSON string. + * * @param mixed $properties */ public function setPropertiesAttribute($properties) diff --git a/app/models/Setting.php b/app/models/Setting.php index ccbd95db..afe6d598 100644 --- a/app/models/Setting.php +++ b/app/models/Setting.php @@ -6,8 +6,10 @@ class Setting extends Eloquent /** * Returns a setting from the database. - * @param string $settingName - * @param bool $checkEnv + * + * @param string $settingName + * @param bool $checkEnv + * * @return string */ public static function get($settingName, $checkEnv = true) @@ -33,9 +35,12 @@ class Setting extends Eloquent } /** - * Throws an Exception - * @param string $setting + * Throws an Exception. + * + * @param string $setting + * * @throws Exception + * * @return void */ public static function unknownSettingException($setting) diff --git a/app/models/User.php b/app/models/User.php index 842fa256..b7b40ab7 100644 --- a/app/models/User.php +++ b/app/models/User.php @@ -11,26 +11,30 @@ class User extends Eloquent implements UserInterface, RemindableInterface /** * The database table used by the model. + * * @var string */ protected $table = 'users'; /** * The attributes excluded from the model's JSON form. + * * @var array */ protected $hidden = ['password', 'remember_token']; /** * Items which cannot be mass assigned. + * * @var array */ protected $guarded = []; /** - * Hash any password being inserted by default + * Hash any password being inserted by default. * * @param string @password + * * @return void */ public function setPasswordAttribute($password) @@ -40,7 +44,9 @@ class User extends Eloquent implements UserInterface, RemindableInterface /** * Returns a Gravatar URL for the users email address. - * @param integer $size + * + * @param int $size + * * @return string */ public function getGravatarAttribute($size = 200) diff --git a/app/models/WebHook.php b/app/models/WebHook.php index a0054a4f..263e5911 100644 --- a/app/models/WebHook.php +++ b/app/models/WebHook.php @@ -12,6 +12,7 @@ class WebHook extends Eloquent /** * Returns all responses for a WebHook. + * * @return Illuminate\Database\Eloquent\Builder */ public function response() @@ -21,7 +22,9 @@ class WebHook extends Eloquent /** * Returns all active hooks. - * @param Illuminate\Database\Eloquent\Builder $query + * + * @param Illuminate\Database\Eloquent\Builder $query + * * @return Illuminate\Database\Eloquent\Builder */ public function scopeActive($query) @@ -31,6 +34,7 @@ class WebHook extends Eloquent /** * Setups a Ping event that is fired upon a web hook. + * * @return array result of the ping */ public function ping() @@ -40,8 +44,10 @@ class WebHook extends Eloquent /** * Fires the actual web hook event. - * @param string $eventType the event to send X-Cachet-Event - * @param mixed $data Data to send to the Web Hook + * + * @param string $eventType the event to send X-Cachet-Event + * @param mixed $data Data to send to the Web Hook + * * @return object */ public function fire($eventType, $data = null) @@ -81,8 +87,10 @@ class WebHook extends Eloquent /** * Returns a human readable request type name. + * * @throws Exception - * @return string HEAD, GET, POST, DELETE, PATCH, PUT etc + * + * @return string HEAD, GET, POST, DELETE, PATCH, PUT etc */ public function getRequestMethodAttribute() { diff --git a/app/models/WebHookResponse.php b/app/models/WebHookResponse.php index 55378e95..f21bad6c 100644 --- a/app/models/WebHookResponse.php +++ b/app/models/WebHookResponse.php @@ -4,6 +4,7 @@ class WebHookResponse extends Eloquent { /** * Returns the hook that a response belongs to. + * * @return Illuminate\Database\Eloquent\Relations\BelongsTo */ public function hook() diff --git a/app/routes/dashboard.php b/app/routes/dashboard.php index b4d5a447..7c499603 100644 --- a/app/routes/dashboard.php +++ b/app/routes/dashboard.php @@ -36,7 +36,7 @@ Route::group(['before' => 'auth', 'prefix' => 'dashboard'], function () { // Internal API. // This should only be used for making requests within the dashboard. - Route::group(['prefix' => 'api'], function() { + Route::group(['prefix' => 'api'], function () { Route::post('components/{component}', 'DashAPIController@postUpdateComponent'); }); }); diff --git a/app/tests/Controllers/Api/ComponentControllerTest.php b/app/tests/Controllers/Api/ComponentControllerTest.php index 62dc7be6..fb6cec54 100644 --- a/app/tests/Controllers/Api/ComponentControllerTest.php +++ b/app/tests/Controllers/Api/ComponentControllerTest.php @@ -2,7 +2,6 @@ class ComponentControllerTest extends TestCase { - public function setUp() { $this->repo = Mockery::mock('CachetHQ\Cachet\Repositories\Component\ComponentRepository'); diff --git a/app/tests/TestCase.php b/app/tests/TestCase.php index e21b85b0..76f47391 100644 --- a/app/tests/TestCase.php +++ b/app/tests/TestCase.php @@ -2,7 +2,6 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase { - /** * Creates the application. * diff --git a/public/index.php b/public/index.php index f08822d9..40a5aaf4 100644 --- a/public/index.php +++ b/public/index.php @@ -1,8 +1,7 @@ */