Skip to content

Commit

Permalink
drop old larave php support; fix report exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
halaei committed May 4, 2021
1 parent 49e30d8 commit a323c59
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
language: php
php:
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0

env:
- LARAVEL_VERSION=6.*
- LARAVEL_VERSION=8.*

services:
- redis-server

before_install:
- composer require "illuminate/console:${LARAVEL_VERSION}" --no-update --prefer-dist
- composer require "illuminate/support:${LARAVEL_VERSION}" --no-update --prefer-dist
- composer require "illuminate/support:${LARAVEL_VERSION}" --no-update --prefer-dist
- composer require "illuminate/support:${LARAVEL_VERSION}" --no-update --prefer-dist
install:
- composer install --no-interaction --prefer-source
script: vendor/bin/phpunit
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

#v0.8.0
- Drop support for old PHP and Laravel versions.
- Fix reporting throwable by calling `report()` helper function.

#v0.7.0
- Supervisor can return instead of exit using dontDie option.
- Bugfix in handling Throwable errors.
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
}
],
"require": {
"php": ">=7.1.0"
"php": ">=7.4.0"
},
"require-dev": {
"predis/predis": "^1.1",
"illuminate/console": "~5.7.0|~5.8.0|^6.0|^7.0|^8.0",
"illuminate/cache": "~5.7.0|~5.8.0|^6.0|^7.0|^8.0",
"illuminate/database": "~5.7.0|~5.8.0|^6.0|^7.0|^8.0",
"illuminate/console": "^6.0|^7.0|^8.0",
"illuminate/cache": "^6.0|^7.0|^8.0",
"illuminate/database": "^6.0|^7.0|^8.0",
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^7.0|^8.0|^9.0",
"phpunit/phpunit": "^8.0|^9.0",
"symfony/process": "^4.2|^5.0"
},
"autoload": {
Expand Down
13 changes: 1 addition & 12 deletions src/Listeners/RefreshDBConnections.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,16 @@
namespace Halaei\Helpers\Listeners;

use Exception;
use Illuminate\Contracts\Debug\ExceptionHandler;

class RefreshDBConnections
{
/**
* @var ExceptionHandler
*/
protected $exceptions;

public function __construct(ExceptionHandler $exceptions)
{
$this->exceptions = $exceptions;
}

public function handle()
{
try {
\DB::rollBack(0);
} catch (Exception $e) {
\DB::reconnect();
$this->exceptions->report($e);
report($e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Supervisor/Supervisor.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected function run(Closure $closure, SupervisorOptions $options, SupervisorS
if ($options->stopOnError) {
$state->shouldQuit = true;
}
$this->exceptions->report($e);
report($e);
$this->events->dispatch(new RunFailed($options, $state, $e));
sleep(1);
}
Expand Down

0 comments on commit a323c59

Please sign in to comment.