Skip to content

Commit b31e48c

Browse files
committed
Remove Laravel dependency
1 parent 561c624 commit b31e48c

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"require-dev": {
2626
"guzzlehttp/guzzle": "^7.8.0",
2727
"guzzlehttp/psr7": "^2.6.1",
28-
"illuminate/contracts": "^9.0|^10.0",
2928
"laravel/pint": "^1.13.6",
3029
"mockery/mockery": "^1.6.6",
3130
"nunomaduro/collision": "^7.10.0",

src/Events/Dispatcher.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
namespace OpenAI\Events;
44

5-
use Illuminate\Contracts\Events\Dispatcher as LaravelDispatcher;
65
use OpenAI\Contracts\DispatcherContract;
76
use Psr\EventDispatcher\EventDispatcherInterface;
87

98
class Dispatcher implements DispatcherContract
109
{
1110
public function __construct(
12-
private readonly LaravelDispatcher|EventDispatcherInterface|null $events
11+
private readonly ?EventDispatcherInterface $events
1312
) {
1413
}
1514

src/Factory.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Exception;
77
use GuzzleHttp\Client as GuzzleClient;
88
use Http\Discovery\Psr18ClientDiscovery;
9-
use Illuminate\Contracts\Events\Dispatcher as LaravelDispatcher;
109
use OpenAI\Events\Dispatcher;
1110
use OpenAI\Transporters\HttpTransporter;
1211
use OpenAI\ValueObjects\ApiKey;
@@ -57,7 +56,7 @@ final class Factory
5756

5857
private ?Closure $streamHandler = null;
5958

60-
private LaravelDispatcher|EventDispatcherInterface|null $events = null;
59+
private ?EventDispatcherInterface $events = null;
6160

6261
/**
6362
* Sets the API key for the requests.
@@ -134,7 +133,7 @@ public function withQueryParam(string $name, string $value): self
134133
/**
135134
* Set the event dispatcher instance.
136135
*/
137-
public function withEventDispatcher(LaravelDispatcher|EventDispatcherInterface $events): self
136+
public function withEventDispatcher(EventDispatcherInterface $events): self
138137
{
139138
$this->events = $events;
140139

tests/Arch.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
'Http\Discovery\Psr17Factory',
6363
'Http\Discovery\Psr18ClientDiscovery',
6464
'Http\Message\MultipartStream\MultipartStreamBuilder',
65-
'Illuminate\Contracts\Events\Dispatcher',
6665
'OpenAI\Contracts',
6766
'OpenAI\Resources',
6867
'Psr\EventDispatcher\EventDispatcherInterface',

0 commit comments

Comments
 (0)