Skip to content

Commit

Permalink
Merge pull request #2195 from CachetHQ/laravel-5.3-shift
Browse files Browse the repository at this point in the history
Laravel 5.3 Shift
  • Loading branch information
jbrooksuk authored Oct 22, 2016
2 parents d0dbf27 + e670f9b commit d501d85
Show file tree
Hide file tree
Showing 74 changed files with 1,038 additions and 487 deletions.
12 changes: 6 additions & 6 deletions app/Bus/Commands/Component/AddComponentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ final class AddComponentCommand
*/
public $rules = [
'name' => 'required|string',
'description' => 'string',
'status' => 'int|min:1|max:4',
'link' => 'url',
'order' => 'int',
'group_id' => 'int',
'enabled' => 'bool',
'description' => 'required|string',
'status' => 'required|int|min:1|max:4',
'link' => 'nullable|url',
'order' => 'nullable|int',
'group_id' => 'nullable|int',
'enabled' => 'nullable|bool',
];

/**
Expand Down
14 changes: 7 additions & 7 deletions app/Bus/Commands/Component/UpdateComponentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ final class UpdateComponentCommand
* @var string[]
*/
public $rules = [
'name' => 'string',
'description' => 'string',
'status' => 'int|min:1|max:4',
'link' => 'url',
'order' => 'int',
'group_id' => 'int',
'enabled' => 'bool',
'name' => 'nullable|string',
'description' => 'nullable|string',
'status' => 'nullable|int|min:1|max:4',
'link' => 'nullable|url',
'order' => 'nullable|int',
'group_id' => 'nullable|int',
'enabled' => 'nullable|bool',
];

/**
Expand Down
6 changes: 3 additions & 3 deletions app/Bus/Commands/ComponentGroup/AddComponentGroupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ final class AddComponentGroupCommand
*/
public $rules = [
'name' => 'required|string',
'order' => 'int',
'collapsed' => 'int|between:0,3',
'visible' => 'bool',
'order' => 'required|int',
'collapsed' => 'required|int|between:0,3',
'visible' => 'required|bool',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ final class UpdateComponentGroupCommand
* @var string[]
*/
public $rules = [
'name' => 'string',
'order' => 'int',
'collapsed' => 'int|between:0,3',
'visible' => 'bool',
'name' => 'nullable|string',
'order' => 'nullable|int',
'collapsed' => 'nullable|int|between:0,3',
'visible' => 'nullable|bool',
];

/**
Expand Down
16 changes: 8 additions & 8 deletions app/Bus/Commands/Incident/ReportIncidentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ final class ReportIncidentCommand
public $rules = [
'name' => 'required|string',
'status' => 'required|int|min:0|max:4',
'message' => 'string',
'visible' => 'bool',
'component_id' => 'int|required_with:component_status',
'component_status' => 'int|min:1|max:4|required_with:component_id',
'notify' => 'bool',
'stickied' => 'bool',
'incident_date' => 'string',
'template' => 'string',
'message' => 'required|string',
'visible' => 'nullable|bool',
'component_id' => 'nullable|required_with:component_status|int',
'component_status' => 'nullable|required_with:component_id|int|min:1|max:4',
'notify' => 'nullable|bool',
'stickied' => 'required|bool',
'incident_date' => 'nullable|string',
'template' => 'nullable|string',
];

/**
Expand Down
6 changes: 3 additions & 3 deletions app/Bus/Commands/Incident/ReportMaintenanceCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ final class ReportMaintenanceCommand
*/
public $rules = [
'name' => 'required|string',
'message' => 'string',
'notify' => 'bool',
'timestamp' => 'string',
'message' => 'required|string',
'notify' => 'nullable|bool',
'timestamp' => 'required|string',
];

/**
Expand Down
18 changes: 9 additions & 9 deletions app/Bus/Commands/Incident/UpdateIncidentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ final class UpdateIncidentCommand
* @var string[]
*/
public $rules = [
'name' => 'string',
'status' => 'int|min:0|max:4',
'message' => 'string',
'visible' => 'bool',
'component_id' => 'int',
'component_status' => 'int|min:1|max:4|required_with:component_id',
'notify' => 'bool',
'stickied' => 'bool',
'template' => 'string',
'name' => 'nullable|string',
'status' => 'nullable|int|min:0|max:4',
'message' => 'nullable|string',
'visible' => 'nullable|bool',
'component_id' => 'nullable|int',
'component_status' => 'nullable|int|min:1|max:4|required_with:component_id',
'notify' => 'nullable|bool',
'stickied' => 'nullable|bool',
'template' => 'nullable|string',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ final class UpdateIncidentUpdateCommand
* @var string[]
*/
public $rules = [
'update' => 'required',
'status' => 'int|min:1|max:4',
'message' => 'string',
'user' => 'required',
'status' => 'nullable|int|min:1|max:4',
'message' => 'nullable|string',
];

/**
Expand Down
18 changes: 9 additions & 9 deletions app/Bus/Commands/Metric/AddMetricCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ final class AddMetricCommand
public $rules = [
'name' => 'required|string',
'suffix' => 'required|string',
'description' => 'string',
'display_chart' => 'bool',
'default_value' => 'int',
'calc_type' => 'int',
'display_chart' => 'int',
'places' => 'int|between:0,4',
'default_view' => 'int|between:0,3',
'threshold' => 'numeric|between:0,10',
'order' => 'int',
'description' => 'nullable|string',
'display_chart' => 'nullable|bool',
'default_value' => 'required|int',
'calc_type' => 'required|int',
'display_chart' => 'nullable|int',
'places' => 'nullable|int|between:0,4',
'default_view' => 'required|int|between:0,3',
'threshold' => 'nullable|numeric|between:0,10',
'order' => 'nullable|int',
];

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Bus/Commands/Metric/AddMetricPointCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ final class AddMetricPointCommand
* @var string[]
*/
public $rules = [
'value' => 'numeric',
'created_at' => 'string',
'value' => 'required|numeric',
'created_at' => 'required|string',
];

/**
Expand Down
22 changes: 11 additions & 11 deletions app/Bus/Commands/Metric/UpdateMetricCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,17 @@ final class UpdateMetricCommand
* @var string[]
*/
public $rules = [
'name' => 'string',
'suffix' => 'string',
'description' => 'string',
'display_chart' => 'bool',
'default_value' => 'numeric',
'calc_type' => 'int|in:0,1',
'display_chart' => 'int',
'places' => 'numeric|between:0,4',
'default_view' => 'numeric|between:0,4',
'threshold' => 'numeric|between:0,10',
'order' => 'int',
'name' => 'nullable|string',
'suffix' => 'nullable|string',
'description' => 'nullable|string',
'display_chart' => 'nullable|bool',
'default_value' => 'nullable|numeric',
'calc_type' => 'nullable|int|in:0,1',
'display_chart' => 'nullable|int',
'places' => 'nullable|numeric|between:0,4',
'default_view' => 'nullable|numeric|between:0,4',
'threshold' => 'nullable|numeric|between:0,10',
'order' => 'nullable|int',
];

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Bus/Commands/Metric/UpdateMetricPointCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ final class UpdateMetricPointCommand
* @var string[]
*/
public $rules = [
'value' => 'numeric',
'created_at' => 'string',
'value' => 'nullable|numeric',
'created_at' => 'nullable|string',
];

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Bus/Commands/User/AddUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ final class AddUserCommand
*/
public $rules = [
'username' => 'required|string',
'password' => 'string',
'level' => 'int',
'password' => 'required|string',
'level' => 'required|int',
];

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Bus/Commands/User/SignupUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ final class SignupUserCommand
*/
public $rules = [
'username' => 'required|string',
'password' => 'string',
'password' => 'required|string',
'email' => 'required|string|email',
'level' => 'int',
'level' => 'required|int',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function handle(ReportIncidentCommand $command)
'stickied' => $command->stickied,
];

if ($template = IncidentTemplate::where('slug', $command->template)->first()) {
if ($template = IncidentTemplate::where('slug', '=', $command->template)->first()) {
$data['message'] = $this->parseTemplate($template, $command);
} else {
$data['message'] = $command->message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __construct(DateFactory $dates)
*/
public function handle(UpdateIncidentCommand $command)
{
if ($template = IncidentTemplate::where('slug', $command->template)->first()) {
if ($template = IncidentTemplate::where('slug', '=', $command->template)->first()) {
$command->message = $this->parseTemplate($template, $command);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function handle(AddMetricPointCommand $command)
protected function findOrCreatePoint(AddMetricPointCommand $command)
{
$buffer = Carbon::now()->subMinutes($command->metric->threshold);
$point = MetricPoint::where('metric_id', $command->metric->id)->where('value', $command->value)->where('created_at', '>=', $buffer)->first();
$point = MetricPoint::where('metric_id', '=', $command->metric->id)->where('value', '=', $command->value)->where('created_at', '>=', $buffer)->first();

if ($point) {
return $point;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SubscribeSubscriberCommandHandler
*/
public function handle(SubscribeSubscriberCommand $command)
{
if ($subscriber = Subscriber::where('email', $command->email)->first()) {
if ($subscriber = Subscriber::where('email', '=', $command->email)->first()) {
return $subscriber;
}

Expand Down
2 changes: 1 addition & 1 deletion app/Foundation/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class EventServiceProvider extends ServiceProvider
{
/**
* The event handler mappings for the application.
* The event listener mappings for the application.
*
* @var array
*/
Expand Down
4 changes: 2 additions & 2 deletions app/Foundation/Providers/ModuleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ModuleServiceProvider extends ServiceProvider
*/
public function boot(BladeCompiler $blade)
{
$blade->directive('modules', function ($group = null) {
$blade->directive('modules', function ($group) {
return sprintf(
'<?php echo $app->call(\'%s@%s\', [
\'factory\' => $__env,
Expand All @@ -68,7 +68,7 @@ public function boot(BladeCompiler $blade)
]); ?>',
ModulesRenderer::class,
'renderModules',
$group === null ? 'null' : $group
empty($group) ? 'null' : $group
);
});
}
Expand Down
Loading

0 comments on commit d501d85

Please sign in to comment.