Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Jan 8, 2021
1 parent f1b3f4c commit d9e43ac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `ray` will be documented in this file

## 1.1.3 - 2020-01-08

- prevent exception when installing in an Orchestra powered testsuite

## 1.1.2 - 2020-01-08

- enforce Composer 2 requirement
Expand Down
10 changes: 9 additions & 1 deletion src/helpers.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use Illuminate\Contracts\Container\BindingResolutionException;
use Spatie\LaravelRay\Ray as LaravelRay;
use Spatie\Ray\Ray;
use Spatie\Ray\Settings\SettingsFactory;
Expand All @@ -13,7 +14,14 @@
function ray(...$args)
{
if (class_exists(LaravelRay::class)) {
return app(LaravelRay::class)->send(...$args);
try {
return app(LaravelRay::class)->send(...$args);
}
catch(BindingResolutionException $exception) {
// this exception can occur when requiring spatie/ray in an Orchestra powered
// testsuite without spatie/laravel-ray's service provider being registered
// in `getPackageProviders` of the base test suite
}
}

$settings = SettingsFactory::createFromConfigFile();
Expand Down

0 comments on commit d9e43ac

Please sign in to comment.