Merge pull request #2753 from luismulinari/code-clean-up

Code cleanup
This commit is contained in:
James Brooks
2017-10-11 20:52:18 +01:00
committed by GitHub
9 changed files with 13 additions and 18 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

@@ -69,9 +69,6 @@ class EventServiceProvider extends ServiceProvider
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasUpdatedEvent' => [
//
],
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasRemovedEvent' => [
//
],
'CachetHQ\Cachet\Bus\Events\Invite\InviteWasClaimedEvent' => [
//
],

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,8 +62,8 @@ class DashboardController extends Controller
/**
* Creates a new dashboard controller instance.
*
* @param \CachetHQ\Cachet\Integrations\Feed $feed
* @param \Illuminate\Contracts\Auth\Guard $guard
* @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;
});
}