Code clean up. Remove some duplicate keys; Remove some unused parameters; Fix some FQCN;

This commit is contained in:
Luis Henrique Mulinari
2017-10-11 21:19:07 +02:00
parent e426eff98c
commit 968bc6a3ce
9 changed files with 12 additions and 17 deletions

View File

@@ -105,7 +105,6 @@ final class CreateMetricCommand
'name' => 'required|string',
'suffix' => 'required|string',
'description' => 'nullable|string',
'display_chart' => 'nullable|bool',
'default_value' => 'required|int',
'calc_type' => 'required|int',
'display_chart' => 'nullable|int',

View File

@@ -108,7 +108,6 @@ final class UpdateMetricCommand
'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',

View File

@@ -56,14 +56,14 @@ class DemoSeederCommand extends Command
/**
* The settings repository.
*
* @var \CachetHQ\Cache\Settings\Repository
* @var \CachetHQ\Cachet\Settings\Repository
*/
protected $settings;
/**
* Create a new demo seeder command instance.
*
* @param \CachetHQ\Cache\Settings\Repository $settings
* @param \CachetHQ\Cachet\Settings\Repository $settings
*
* @return void
*/

View File

@@ -63,9 +63,6 @@ class EventServiceProvider extends ServiceProvider
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasCreatedEvent' => [
'CachetHQ\Cachet\Bus\Handlers\Events\Incident\SendIncidentEmailNotificationHandler',
],
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasRemovedEvent' => [
//
],
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasUpdatedEvent' => [
//
],

View File

@@ -149,7 +149,7 @@ class ComponentController extends Controller
$tags = preg_split('/ ?, ?/', $tags);
// For every tag, do we need to create it?
$componentTags = array_map(function ($taggable) use ($component) {
$componentTags = array_map(function ($taggable) {
return Tag::firstOrCreate(['name' => $taggable])->id;
}, $tags);
@@ -203,7 +203,7 @@ class ComponentController extends Controller
$tags = preg_split('/ ?, ?/', $tags);
// For every tag, do we need to create it?
$componentTags = array_map(function ($taggable) use ($component) {
$componentTags = array_map(function ($taggable) {
return Tag::firstOrCreate(['name' => $taggable])->id;
}, $tags);

View File

@@ -48,7 +48,7 @@ class DashboardController extends Controller
/**
* The feed integration.
*
* @var \CachetHQ\Cachet\Integrations\Feed
* @var \CachetHQ\Cachet\Integrations\Contracts\Feed
*/
protected $feed;
@@ -62,7 +62,7 @@ class DashboardController extends Controller
/**
* Creates a new dashboard controller instance.
*
* @param \CachetHQ\Cachet\Integrations\Feed $feed
* @param \CachetHQ\Cachet\Integrations\Contracts\Feed $feed
* @param \Illuminate\Contracts\Auth\Guard $guard
*
* @return void

View File

@@ -146,7 +146,7 @@ class SubscribeController extends Controller
if ($subscription) {
dispatch(new UnsubscribeSubscriptionCommand(Subscription::forSubscriber($subscriber->id)->firstOrFail()));
} else {
dispatch(new UnsubscribeSubscriberCommand($subscriber, $subscription));
dispatch(new UnsubscribeSubscriberCommand($subscriber));
}
return cachet_redirect('status-page')

View File

@@ -122,7 +122,7 @@ class NewIncidentNotification extends Notification
return (new SlackMessage())
->$status()
->content($content)
->attachment(function ($attachment) use ($content, $notifiable) {
->attachment(function ($attachment) use ($notifiable) {
$attachment->title(trans('notifications.incident.new.slack.title', [$this->incident->name]))
->timestamp($this->incident->getWrappedObject()->occurred_at)
->fields(array_filter([

View File

@@ -71,7 +71,7 @@ class MetricRepository
$pointKey = $dateTime->sub(new DateInterval('PT1M'))->format('H:i');
}
return $points->sortBy(function ($point, $key) use ($points) {
return $points->sortBy(function ($point, $key) {
return $key;
});
}
@@ -98,7 +98,7 @@ class MetricRepository
$pointKey = $dateTime->sub(new DateInterval('PT1H'))->format('H:00');
}
return $points->sortBy(function ($point, $key) use ($points) {
return $points->sortBy(function ($point, $key) {
return $key;
});
}
@@ -124,7 +124,7 @@ class MetricRepository
$pointKey = $dateTime->sub(new DateInterval('P1D'))->format('Y-m-d');
}
return $points->sortBy(function ($point, $key) use ($points) {
return $points->sortBy(function ($point, $key) {
return $key;
});
}
@@ -151,7 +151,7 @@ class MetricRepository
$pointKey = $dateTime->sub(new DateInterval('P1D'))->format('Y-m-d');
}
return $points->sortBy(function ($point, $key) use ($points) {
return $points->sortBy(function ($point, $key) {
return $key;
});
}