Skip to content

Commit

Permalink
make compatible with Laravel 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Sep 1, 2017
1 parent 81a4700 commit fbd8c6d
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 34 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -3,6 +3,7 @@ language: php
php:
- 7.0
- 7.1
- 7.2

env:
matrix:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,11 @@

All notable changes to laravel-failed-job-monitor will be documented in this file

## 3.0.0 - 2017-09-01

- add support for Laravel 5.5
- renamed config file from `laravel-failed-job-monitor` to `failed-job-monitor`

## 2.2.0 - 2017-01-23

- add support for Laravel 5.4
Expand Down
10 changes: 1 addition & 9 deletions README.md
Expand Up @@ -24,15 +24,7 @@ If you intend to use Slack notifications you should also install the guzzle clie
composer require guzzlehttp/guzzle
```

Next up, the service provider must be registered:

```php
'providers' => [
...
Spatie\FailedJobMonitor\FailedJobMonitorServiceProvider::class,
...
];
```
The service provider will automatically be registered.

Next, you must publish the config file:

Expand Down
12 changes: 6 additions & 6 deletions composer.json
Expand Up @@ -22,15 +22,15 @@
],
"require": {
"php" : "^7.0",
"illuminate/contracts": "~5.3.29|~5.4.0",
"illuminate/queue": "~5.3.29|~5.4.0",
"illuminate/notifications": "~5.3.29|~5.4.0",
"illuminate/support": "~5.3.29|~5.4.0"
"illuminate/contracts": "~5.5.0",
"illuminate/queue": "~5.5.0",
"illuminate/notifications": "~5.5.0",
"illuminate/support": "~5.5.0"

},
"require-dev": {
"phpunit/phpunit": "^5.5.4",
"orchestra/testbench":"~3.3.4|~3.4.0"
"phpunit/phpunit": "^6.3",
"orchestra/testbench":"~3.5.0"
},
"autoload": {
"psr-4": {
Expand Down
File renamed without changes.
7 changes: 0 additions & 7 deletions phpunit.xml.dist
Expand Up @@ -19,11 +19,4 @@
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
6 changes: 3 additions & 3 deletions src/FailedJobMonitorServiceProvider.php
Expand Up @@ -12,7 +12,7 @@ class FailedJobMonitorServiceProvider extends IlluminateServiceProvider
public function boot()
{
$this->publishes([
__DIR__.'/../config/laravel-failed-job-monitor.php' => config_path('laravel-failed-job-monitor.php'),
__DIR__.'/../config/failed-job-monitor.php' => config_path('failed-job-monitor.php'),
], 'config');

$this->app->make(FailedJobNotifier::class)->register();
Expand All @@ -24,8 +24,8 @@ public function boot()
public function register()
{
$this->mergeConfigFrom(
__DIR__.'/../config/laravel-failed-job-monitor.php',
'laravel-failed-job-monitor'
__DIR__.'/../config/failed-job-monitor.php',
'failed-job-monitor'
);

$this->app->singleton(FailedJobNotifier::class);
Expand Down
6 changes: 3 additions & 3 deletions src/FailedJobNotifier.php
Expand Up @@ -11,9 +11,9 @@ class FailedJobNotifier
public function register()
{
app(QueueManager::class)->failing(function (JobFailed $event) {
$notifiable = app(config('laravel-failed-job-monitor.notifiable'));
$notifiable = app(config('failed-job-monitor.notifiable'));

$notification = app(config('laravel-failed-job-monitor.notification'))->setEvent($event);
$notification = app(config('failed-job-monitor.notification'))->setEvent($event);

if (! $this->isValidNotificationClass($notification)) {
throw InvalidConfiguration::notificationClassInvalid(get_class($notification));
Expand All @@ -40,7 +40,7 @@ public function isValidNotificationClass($notification): bool

public function shouldSendNotification($notification)
{
$callable = config('laravel-failed-job-monitor.notificationFilter');
$callable = config('failed-job-monitor.notificationFilter');

if (! is_callable($callable)) {
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/Notifiable.php
Expand Up @@ -10,12 +10,12 @@ class Notifiable

public function routeNotificationForMail(): string
{
return config('laravel-failed-job-monitor.mail.to');
return config('failed-job-monitor.mail.to');
}

public function routeNotificationForSlack(): string
{
return config('laravel-failed-job-monitor.slack.webhook_url');
return config('failed-job-monitor.slack.webhook_url');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Notification.php
Expand Up @@ -15,7 +15,7 @@ class Notification extends IlluminateNotification

public function via($notifiable): array
{
return config('laravel-failed-job-monitor.channels');
return config('failed-job-monitor.channels');
}

public function setEvent(JobFailed $event): self
Expand Down
6 changes: 3 additions & 3 deletions tests/FailedJobMonitorTest.php
Expand Up @@ -36,7 +36,7 @@ public function it_can_send_notification_when_a_job_failed()
/** @test */
public function it_can_send_notification_when_job_failed_to_different_notifiable()
{
$this->app['config']->set('laravel-failed-job-monitor.notifiable', AnotherNotifiable::class);
$this->app['config']->set('failed-job-monitor.notifiable', AnotherNotifiable::class);

$this->fireFailedEvent();

Expand All @@ -46,7 +46,7 @@ public function it_can_send_notification_when_job_failed_to_different_notifiable
/** @test */
public function it_can_send_notification_when_job_failed_to_different_notification()
{
$this->app['config']->set('laravel-failed-job-monitor.notification', AnotherNotification::class);
$this->app['config']->set('failed-job-monitor.notification', AnotherNotification::class);

$this->fireFailedEvent();

Expand All @@ -56,7 +56,7 @@ public function it_can_send_notification_when_job_failed_to_different_notificati
/** @test */
public function it_filters_out_notifications_when_the_notificationFilter_returns_false()
{
$this->app['config']->set('laravel-failed-job-monitor.callback', [$this, 'returnsFalseWhenExceptionIsEmpty']);
$this->app['config']->set('failed-job-monitor.callback', [$this, 'returnsFalseWhenExceptionIsEmpty']);

$this->fireFailedEvent();

Expand Down

0 comments on commit fbd8c6d

Please sign in to comment.