From 0657caa8882ef073413159a148f4fc2f311cd6a0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Feb 2026 03:47:50 +0000 Subject: [PATCH 1/4] Initial plan From 1a96dd663153c5647b98b342006409d03ae68dec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Feb 2026 03:53:24 +0000 Subject: [PATCH 2/4] Add SessionContext, SessionListFilter, and update listSessions with filtering Co-authored-by: kawax <1502086+kawax@users.noreply.github.com> --- copilot-sdk | 2 +- src/Client.php | 26 +++++++++++++++++-- src/Contracts/CopilotClient.php | 12 +++++++++ src/Enums/SessionEventType.php | 1 + src/Types/SessionContext.php | 46 +++++++++++++++++++++++++++++++++ src/Types/SessionListFilter.php | 46 +++++++++++++++++++++++++++++++++ src/Types/SessionMetadata.php | 3 +++ 7 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 src/Types/SessionContext.php create mode 100644 src/Types/SessionListFilter.php diff --git a/copilot-sdk b/copilot-sdk index b904431..e40d57c 160000 --- a/copilot-sdk +++ b/copilot-sdk @@ -1 +1 @@ -Subproject commit b904431d1917e2b86f76fcde79a563921d8ef28c +Subproject commit e40d57c86e18b495722adbf42045288c03924342 diff --git a/src/Client.php b/src/Client.php index 0b2ac5a..4ecaeb2 100644 --- a/src/Client.php +++ b/src/Client.php @@ -29,6 +29,7 @@ use Revolution\Copilot\Types\SessionConfig; use Revolution\Copilot\Types\SessionEvent; use Revolution\Copilot\Types\SessionLifecycleEvent; +use Revolution\Copilot\Types\SessionListFilter; use Revolution\Copilot\Types\SessionMetadata; use Revolution\Copilot\Types\ToolResultObject; use Revolution\Copilot\Types\UserInputRequest; @@ -492,15 +493,36 @@ public function deleteSession(string $sessionId): void /** * List all available sessions. * + * Returns metadata about each session including ID, timestamps, summary, and context. + * + * @param SessionListFilter|array{cwd?: string, gitRoot?: string, repository?: string, branch?: string}|null $filter Optional filter to limit returned sessions by context fields * @return array * * @throws JsonRpcException + * + * @example + * // List all sessions + * $sessions = $client->listSessions(); + * + * // List sessions for a specific repository + * $sessions = $client->listSessions(['repository' => 'owner/repo']); + * + * // List sessions in a specific working directory + * $sessions = $client->listSessions(new SessionListFilter(cwd: '/path/to/project')); */ - public function listSessions(): array + public function listSessions(SessionListFilter|array|null $filter = null): array { $this->ensureConnected(); - $response = $this->rpcClient->request('session.list', []); + $filterArray = match (true) { + $filter instanceof SessionListFilter => $filter->toArray(), + is_array($filter) => array_filter($filter, fn ($v) => $v !== null), + default => [], + }; + + $response = $this->rpcClient->request('session.list', array_filter([ + 'filter' => $filterArray ?: null, + ])); return array_map( fn (array $session) => SessionMetadata::fromArray($session), diff --git a/src/Contracts/CopilotClient.php b/src/Contracts/CopilotClient.php index 7a7a8ed..51f0fad 100644 --- a/src/Contracts/CopilotClient.php +++ b/src/Contracts/CopilotClient.php @@ -11,6 +11,8 @@ use Revolution\Copilot\Types\ResumeSessionConfig; use Revolution\Copilot\Types\SessionConfig; use Revolution\Copilot\Types\SessionLifecycleEvent; +use Revolution\Copilot\Types\SessionListFilter; +use Revolution\Copilot\Types\SessionMetadata; use Throwable; /** @@ -69,6 +71,16 @@ public function getAuthStatus(): GetAuthStatusResponse; */ public function listModels(): array; + /** + * List all available sessions. + * + * @param SessionListFilter|array{cwd?: string, gitRoot?: string, repository?: string, branch?: string}|null $filter + * @return array + * + * @throws JsonRpcException + */ + public function listSessions(SessionListFilter|array|null $filter = null): array; + /** * Gets the foreground session ID in TUI+server mode. * diff --git a/src/Enums/SessionEventType.php b/src/Enums/SessionEventType.php index 068ac4d..e9af3c1 100644 --- a/src/Enums/SessionEventType.php +++ b/src/Enums/SessionEventType.php @@ -23,6 +23,7 @@ enum SessionEventType: string case SESSION_USAGE_INFO = 'session.usage_info'; case SESSION_COMPACTION_START = 'session.compaction_start'; case SESSION_COMPACTION_COMPLETE = 'session.compaction_complete'; + case SESSION_CONTEXT_CHANGED = 'session.context_changed'; // User messages case USER_MESSAGE = 'user.message'; diff --git a/src/Types/SessionContext.php b/src/Types/SessionContext.php new file mode 100644 index 0000000..fff952f --- /dev/null +++ b/src/Types/SessionContext.php @@ -0,0 +1,46 @@ + $this->cwd, + 'gitRoot' => $this->gitRoot, + 'repository' => $this->repository, + 'branch' => $this->branch, + ], fn ($value) => $value !== null); + } +} diff --git a/src/Types/SessionListFilter.php b/src/Types/SessionListFilter.php new file mode 100644 index 0000000..6b67f21 --- /dev/null +++ b/src/Types/SessionListFilter.php @@ -0,0 +1,46 @@ + $this->cwd, + 'gitRoot' => $this->gitRoot, + 'repository' => $this->repository, + 'branch' => $this->branch, + ], fn ($value) => $value !== null); + } +} diff --git a/src/Types/SessionMetadata.php b/src/Types/SessionMetadata.php index 77d8581..0b6d2d8 100644 --- a/src/Types/SessionMetadata.php +++ b/src/Types/SessionMetadata.php @@ -17,6 +17,7 @@ public function __construct( public string $modifiedTime, public ?string $summary = null, public bool $isRemote = false, + public ?SessionContext $context = null, ) {} /** @@ -30,6 +31,7 @@ public static function fromArray(array $data): self modifiedTime: $data['modifiedTime'], summary: $data['summary'] ?? null, isRemote: $data['isRemote'] ?? false, + context: isset($data['context']) ? SessionContext::fromArray($data['context']) : null, ); } @@ -44,6 +46,7 @@ public function toArray(): array 'modifiedTime' => $this->modifiedTime, 'summary' => $this->summary, 'isRemote' => $this->isRemote, + 'context' => $this->context?->toArray(), ], fn ($value) => $value !== null); } } From 98c9e7dde99cf159aaefb3c89e49990f890b2037 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Feb 2026 03:59:40 +0000 Subject: [PATCH 3/4] Add tests for SessionContext, SessionListFilter, and SessionMetadata context field Co-authored-by: kawax <1502086+kawax@users.noreply.github.com> --- tests/Unit/Types/SessionContextTest.php | 97 +++++++++++++++++++ tests/Unit/Types/SessionListFilterTest.php | 103 +++++++++++++++++++++ tests/Unit/Types/SessionMetadataTest.php | 46 +++++++++ 3 files changed, 246 insertions(+) create mode 100644 tests/Unit/Types/SessionContextTest.php create mode 100644 tests/Unit/Types/SessionListFilterTest.php diff --git a/tests/Unit/Types/SessionContextTest.php b/tests/Unit/Types/SessionContextTest.php new file mode 100644 index 0000000..70e5b97 --- /dev/null +++ b/tests/Unit/Types/SessionContextTest.php @@ -0,0 +1,97 @@ +cwd)->toBe('/home/user/project') + ->and($context->gitRoot)->toBe('/home/user/project') + ->and($context->repository)->toBe('owner/repo') + ->and($context->branch)->toBe('main'); + }); + + it('can be created with minimal fields', function () { + $context = new SessionContext( + cwd: '/home/user/project', + ); + + expect($context->cwd)->toBe('/home/user/project') + ->and($context->gitRoot)->toBeNull() + ->and($context->repository)->toBeNull() + ->and($context->branch)->toBeNull(); + }); + + it('can be created from array with all fields', function () { + $context = SessionContext::fromArray([ + 'cwd' => '/home/user/work', + 'gitRoot' => '/home/user/work', + 'repository' => 'org/project', + 'branch' => 'develop', + ]); + + expect($context->cwd)->toBe('/home/user/work') + ->and($context->gitRoot)->toBe('/home/user/work') + ->and($context->repository)->toBe('org/project') + ->and($context->branch)->toBe('develop'); + }); + + it('can be created from array with minimal fields', function () { + $context = SessionContext::fromArray([ + 'cwd' => '/tmp/test', + ]); + + expect($context->cwd)->toBe('/tmp/test') + ->and($context->gitRoot)->toBeNull() + ->and($context->repository)->toBeNull() + ->and($context->branch)->toBeNull(); + }); + + it('can convert to array with all fields', function () { + $context = new SessionContext( + cwd: '/var/www/app', + gitRoot: '/var/www/app', + repository: 'company/webapp', + branch: 'feature/new', + ); + + $array = $context->toArray(); + + expect($array)->toBe([ + 'cwd' => '/var/www/app', + 'gitRoot' => '/var/www/app', + 'repository' => 'company/webapp', + 'branch' => 'feature/new', + ]); + }); + + it('filters null values in toArray', function () { + $context = new SessionContext( + cwd: '/workspace', + repository: 'team/project', + ); + + $array = $context->toArray(); + + expect($array)->toBe([ + 'cwd' => '/workspace', + 'repository' => 'team/project', + ]); + expect($array)->not->toHaveKey('gitRoot') + ->and($array)->not->toHaveKey('branch'); + }); + + it('implements Arrayable interface', function () { + $context = new SessionContext(cwd: '/home'); + + expect($context)->toBeInstanceOf(\Illuminate\Contracts\Support\Arrayable::class); + }); +}); diff --git a/tests/Unit/Types/SessionListFilterTest.php b/tests/Unit/Types/SessionListFilterTest.php new file mode 100644 index 0000000..9a8e327 --- /dev/null +++ b/tests/Unit/Types/SessionListFilterTest.php @@ -0,0 +1,103 @@ +cwd)->toBe('/home/user/project') + ->and($filter->gitRoot)->toBe('/home/user/project') + ->and($filter->repository)->toBe('owner/repo') + ->and($filter->branch)->toBe('main'); + }); + + it('can be created with no fields', function () { + $filter = new SessionListFilter(); + + expect($filter->cwd)->toBeNull() + ->and($filter->gitRoot)->toBeNull() + ->and($filter->repository)->toBeNull() + ->and($filter->branch)->toBeNull(); + }); + + it('can be created from array with all fields', function () { + $filter = SessionListFilter::fromArray([ + 'cwd' => '/home/user/work', + 'gitRoot' => '/home/user/work', + 'repository' => 'org/project', + 'branch' => 'develop', + ]); + + expect($filter->cwd)->toBe('/home/user/work') + ->and($filter->gitRoot)->toBe('/home/user/work') + ->and($filter->repository)->toBe('org/project') + ->and($filter->branch)->toBe('develop'); + }); + + it('can be created from array with partial fields', function () { + $filter = SessionListFilter::fromArray([ + 'repository' => 'company/app', + 'branch' => 'feature', + ]); + + expect($filter->cwd)->toBeNull() + ->and($filter->gitRoot)->toBeNull() + ->and($filter->repository)->toBe('company/app') + ->and($filter->branch)->toBe('feature'); + }); + + it('can convert to array with all fields', function () { + $filter = new SessionListFilter( + cwd: '/var/www/app', + gitRoot: '/var/www/app', + repository: 'company/webapp', + branch: 'feature/new', + ); + + $array = $filter->toArray(); + + expect($array)->toBe([ + 'cwd' => '/var/www/app', + 'gitRoot' => '/var/www/app', + 'repository' => 'company/webapp', + 'branch' => 'feature/new', + ]); + }); + + it('filters null values in toArray', function () { + $filter = new SessionListFilter( + repository: 'team/project', + ); + + $array = $filter->toArray(); + + expect($array)->toBe([ + 'repository' => 'team/project', + ]); + expect($array)->not->toHaveKey('cwd') + ->and($array)->not->toHaveKey('gitRoot') + ->and($array)->not->toHaveKey('branch'); + }); + + it('returns empty array when all fields are null', function () { + $filter = new SessionListFilter(); + + $array = $filter->toArray(); + + expect($array)->toBe([]); + }); + + it('implements Arrayable interface', function () { + $filter = new SessionListFilter(); + + expect($filter)->toBeInstanceOf(\Illuminate\Contracts\Support\Arrayable::class); + }); +}); diff --git a/tests/Unit/Types/SessionMetadataTest.php b/tests/Unit/Types/SessionMetadataTest.php index 0b2d212..a038266 100644 --- a/tests/Unit/Types/SessionMetadataTest.php +++ b/tests/Unit/Types/SessionMetadataTest.php @@ -2,6 +2,7 @@ declare(strict_types=1); +use Revolution\Copilot\Types\SessionContext; use Revolution\Copilot\Types\SessionMetadata; describe('SessionMetadata', function () { @@ -80,4 +81,49 @@ expect($metadata)->toBeInstanceOf(\Illuminate\Contracts\Support\Arrayable::class); }); + + it('can be created with context', function () { + $metadata = SessionMetadata::fromArray([ + 'sessionId' => 'session-with-context', + 'startTime' => '2026-01-24T10:00:00Z', + 'modifiedTime' => '2026-01-24T10:30:00Z', + 'context' => [ + 'cwd' => '/home/user/project', + 'gitRoot' => '/home/user/project', + 'repository' => 'owner/repo', + 'branch' => 'main', + ], + ]); + + expect($metadata->context)->toBeInstanceOf(SessionContext::class) + ->and($metadata->context->cwd)->toBe('/home/user/project') + ->and($metadata->context->gitRoot)->toBe('/home/user/project') + ->and($metadata->context->repository)->toBe('owner/repo') + ->and($metadata->context->branch)->toBe('main'); + }); + + it('can convert to array with context', function () { + $context = new SessionContext( + cwd: '/home/user/project', + gitRoot: '/home/user/project', + repository: 'owner/repo', + branch: 'feature-branch', + ); + + $metadata = new SessionMetadata( + sessionId: 'session-ctx', + startTime: '2026-01-24T11:00:00Z', + modifiedTime: '2026-01-24T11:30:00Z', + context: $context, + ); + + $array = $metadata->toArray(); + + expect($array['context'])->toBe([ + 'cwd' => '/home/user/project', + 'gitRoot' => '/home/user/project', + 'repository' => 'owner/repo', + 'branch' => 'feature-branch', + ]); + }); }); From 903264c91ce6cc6cdaa07d8b6aeea44809f8e9ae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Feb 2026 04:00:59 +0000 Subject: [PATCH 4/4] Add documentation for session context, filtering, and context_changed event Co-authored-by: kawax <1502086+kawax@users.noreply.github.com> --- README.md | 23 ++ docs/getting-started.md | 5 + docs/jp/session-context.md | 242 +++++++++++++++++++++ tests/Unit/Types/SessionListFilterTest.php | 6 +- 4 files changed, 273 insertions(+), 3 deletions(-) create mode 100644 docs/jp/session-context.md diff --git a/README.md b/README.md index f40f891..66e5d4a 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,29 @@ $content = Copilot::start(function (CopilotSession $session) { dump($content); ``` +### List sessions with filtering + +```php +use Revolution\Copilot\Facades\Copilot; + +// List all sessions +$sessions = Copilot::client()->listSessions(); + +// Filter sessions by repository +$sessions = Copilot::client()->listSessions(['repository' => 'owner/repo']); + +// Filter by branch +$sessions = Copilot::client()->listSessions(['branch' => 'main']); + +foreach ($sessions as $metadata) { + echo "Session: {$metadata->sessionId}\n"; + if ($metadata->context !== null) { + echo " Repository: {$metadata->context->repository}\n"; + echo " Branch: {$metadata->context->branch}\n"; + } +} +``` + ### `copilot()` helper Alternatively, you can use the `copilot()` helper function. diff --git a/docs/getting-started.md b/docs/getting-started.md index 1b7c0e3..78d3547 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -441,7 +441,12 @@ $config = new SessionConfig( Now that you've got the basics, explore more features: +- **Session Management** + - `listSessions()` - List and filter sessions by repository, branch, or working directory + - `resumeSession()` - Resume previous sessions + - Session context tracking (cwd, git info) - **[Official SDK Documentation](https://github.com/github/copilot-sdk)** - Full reference +- **[Japanese Documentation](../docs/jp/)** - Detailed docs in Japanese --- diff --git a/docs/jp/session-context.md b/docs/jp/session-context.md new file mode 100644 index 0000000..be02142 --- /dev/null +++ b/docs/jp/session-context.md @@ -0,0 +1,242 @@ +# セッションコンテキストとフィルタリング + +GitHub Copilot SDK v0.1.24以降では、セッションに作業ディレクトリとGit情報を含むコンテキストが追加され、セッション一覧でフィルタリングできるようになりました。 + +## SessionContext + +`SessionContext`は、セッションが作成された時の作業ディレクトリとGitリポジトリの情報を保持します。 + +### プロパティ + +- `cwd` (string): 作業ディレクトリの絶対パス +- `gitRoot` (?string): Gitリポジトリのルートディレクトリ(Gitリポジトリ内でない場合はnull) +- `repository` (?string): GitHubリポジトリ(`owner/repo`形式、例: `invokable/laravel-copilot-sdk`) +- `branch` (?string): 現在のGitブランチ名 + +### 使用例 + +```php +use Revolution\Copilot\Facades\Copilot; + +// セッション一覧を取得 +$sessions = Copilot::client()->listSessions(); + +foreach ($sessions as $metadata) { + echo "Session: {$metadata->sessionId}\n"; + + if ($metadata->context !== null) { + echo " 作業ディレクトリ: {$metadata->context->cwd}\n"; + + if ($metadata->context->repository !== null) { + echo " リポジトリ: {$metadata->context->repository}\n"; + echo " ブランチ: {$metadata->context->branch}\n"; + } + } +} +``` + +## SessionListFilter + +`SessionListFilter`を使用して、特定の作業ディレクトリやリポジトリのセッションのみを取得できます。 + +### プロパティ + +- `cwd` (?string): 作業ディレクトリで完全一致フィルタ +- `gitRoot` (?string): Gitルートディレクトリでフィルタ +- `repository` (?string): リポジトリ(`owner/repo`形式)でフィルタ +- `branch` (?string): ブランチ名でフィルタ + +### 使用例 + +#### 配列でフィルタ指定 + +```php +use Revolution\Copilot\Facades\Copilot; + +// 特定のリポジトリのセッションのみを取得 +$sessions = Copilot::client()->listSessions([ + 'repository' => 'invokable/laravel-copilot-sdk', +]); + +// 特定のブランチで作業中のセッションを取得 +$sessions = Copilot::client()->listSessions([ + 'repository' => 'owner/repo', + 'branch' => 'feature/new-feature', +]); + +// 特定の作業ディレクトリのセッションを取得 +$sessions = Copilot::client()->listSessions([ + 'cwd' => '/home/user/projects/my-app', +]); +``` + +#### SessionListFilterクラスを使用 + +```php +use Revolution\Copilot\Facades\Copilot; +use Revolution\Copilot\Types\SessionListFilter; + +$filter = new SessionListFilter( + repository: 'owner/repo', + branch: 'main', +); + +$sessions = Copilot::client()->listSessions($filter); +``` + +## session.context_changed イベント + +セッション中に作業ディレクトリが変更されると、`session.context_changed`イベントが発火します。 + +### イベントタイプ + +```php +use Revolution\Copilot\Enums\SessionEventType; + +SessionEventType::SESSION_CONTEXT_CHANGED; // 'session.context_changed' +``` + +### イベントデータ + +イベントデータには更新されたコンテキスト情報が含まれます: + +```php +use Revolution\Copilot\Facades\Copilot; + +Copilot::start(function ($session) { + $session->on(function ($event) { + if ($event->type === 'session.context_changed') { + $data = $event->data; + + echo "作業ディレクトリが変更されました\n"; + echo " cwd: {$data['cwd']}\n"; + echo " repository: {$data['repository']}\n"; + echo " branch: {$data['branch']}\n"; + } + }); + + $response = $session->sendAndWait( + prompt: 'Change to a different directory and list files', + ); +}); +``` + +## SessionMetadata + +`SessionMetadata`に`context`プロパティが追加されました。 + +### 新しいプロパティ + +- `context` (?SessionContext): セッションの作業ディレクトリとGit情報 + +### 使用例 + +```php +use Revolution\Copilot\Facades\Copilot; + +$sessions = Copilot::client()->listSessions(); + +foreach ($sessions as $metadata) { + echo "Session ID: {$metadata->sessionId}\n"; + echo "開始時刻: {$metadata->startTime}\n"; + + // contextはオプショナルなので、nullチェックが必要 + if ($metadata->context !== null) { + echo "コンテキスト:\n"; + echo " 作業ディレクトリ: {$metadata->context->cwd}\n"; + + if ($metadata->context->repository !== null) { + echo " リポジトリ: {$metadata->context->repository}\n"; + } + + if ($metadata->context->branch !== null) { + echo " ブランチ: {$metadata->context->branch}\n"; + } + } + + echo "\n"; +} +``` + +## 実用例 + +### 特定のプロジェクトのセッションを取得 + +```php +use Revolution\Copilot\Facades\Copilot; + +// Laravel Copilot SDKプロジェクトのセッションのみを取得 +$sessions = Copilot::client()->listSessions([ + 'repository' => 'invokable/laravel-copilot-sdk', +]); + +// 作業中のセッションを表示 +foreach ($sessions as $metadata) { + echo "{$metadata->sessionId}: {$metadata->summary}\n"; + echo " ブランチ: {$metadata->context->branch}\n"; +} +``` + +### 機能ブランチのセッションを管理 + +```php +use Revolution\Copilot\Facades\Copilot; + +// feature/* ブランチで作業中のセッションを取得(簡易的な例) +$sessions = Copilot::client()->listSessions(); + +$featureSessions = array_filter($sessions, function ($metadata) { + return $metadata->context !== null + && str_starts_with($metadata->context->branch ?? '', 'feature/'); +}); + +// 機能ブランチごとにセッションをグループ化 +$byBranch = []; +foreach ($featureSessions as $metadata) { + $branch = $metadata->context->branch; + $byBranch[$branch][] = $metadata; +} + +foreach ($byBranch as $branch => $sessions) { + echo "{$branch}: " . count($sessions) . " セッション\n"; +} +``` + +### 作業ディレクトリごとにセッションを整理 + +```php +use Revolution\Copilot\Facades\Copilot; + +$sessions = Copilot::client()->listSessions(); + +// 作業ディレクトリでグループ化 +$byCwd = []; +foreach ($sessions as $metadata) { + if ($metadata->context !== null) { + $cwd = $metadata->context->cwd; + $byCwd[$cwd][] = $metadata; + } +} + +// ディレクトリごとのセッション数を表示 +foreach ($byCwd as $cwd => $sessions) { + echo "{$cwd}: " . count($sessions) . " セッション\n"; +} +``` + +## 注意事項 + +- `context`は、セッションがGitリポジトリ内で作成された場合にのみGit関連情報(`gitRoot`, `repository`, `branch`)を含みます。 +- `context`フィールドは、Copilot CLI v0.0.409以降で利用可能です。古いバージョンでは`null`が返されます。 +- フィルタリングは完全一致で動作します。部分一致やワイルドカードはサポートされていません。 +- `SessionListFilter`のすべてのフィールドはオプショナルです。フィルタを指定しない場合は、すべてのセッションが返されます。 + +## 公式SDKとの互換性 + +この機能は、公式GitHub Copilot SDK PR #427で追加されたものと同等です: +- Node.js SDK +- Python SDK +- Go SDK +- .NET SDK + +すべてのSDKで同じAPIと動作を提供しています。 diff --git a/tests/Unit/Types/SessionListFilterTest.php b/tests/Unit/Types/SessionListFilterTest.php index 9a8e327..7cd79d0 100644 --- a/tests/Unit/Types/SessionListFilterTest.php +++ b/tests/Unit/Types/SessionListFilterTest.php @@ -20,7 +20,7 @@ }); it('can be created with no fields', function () { - $filter = new SessionListFilter(); + $filter = new SessionListFilter; expect($filter->cwd)->toBeNull() ->and($filter->gitRoot)->toBeNull() @@ -88,7 +88,7 @@ }); it('returns empty array when all fields are null', function () { - $filter = new SessionListFilter(); + $filter = new SessionListFilter; $array = $filter->toArray(); @@ -96,7 +96,7 @@ }); it('implements Arrayable interface', function () { - $filter = new SessionListFilter(); + $filter = new SessionListFilter; expect($filter)->toBeInstanceOf(\Illuminate\Contracts\Support\Arrayable::class); });