···17171818 public function __construct(
1919 private readonly string $data,
2020- ) {}
2020+ ) {
2121+ }
21222223 /**
2324 * Get current position in the data.
···5859 */
5960 public function peek(): int
6061 {
6161- if (!$this->hasMore()) {
6262+ if (! $this->hasMore()) {
6263 throw new RuntimeException('Unexpected end of data');
6364 }
6465
+2-3
src/CAR/BlockReader.php
···77use Generator;
88use SocialDept\Signal\Binary\Reader;
99use SocialDept\Signal\Core\CID;
1010-use SocialDept\Signal\Core\CBOR;
11101211/**
1312 * CAR (Content Addressable aRchive) block reader.
···4948 */
5049 private function skipHeader(): void
5150 {
5252- if (!$this->reader->hasMore()) {
5151+ if (! $this->reader->hasMore()) {
5352 return;
5453 }
5554···6766 */
6867 private function readBlock(): ?array
6968 {
7070- if (!$this->reader->hasMore()) {
6969+ if (! $this->reader->hasMore()) {
7170 return null;
7271 }
7372
+7-6
src/CAR/RecordExtractor.php
···55namespace SocialDept\Signal\CAR;
6677use Generator;
88-use SocialDept\Signal\Core\CID;
98use SocialDept\Signal\Core\CBOR;
99+use SocialDept\Signal\Core\CID;
10101111/**
1212 * Extract records from AT Protocol MST (Merkle Search Tree) blocks.
···2121 public function __construct(
2222 private readonly array $blocks,
2323 private readonly string $did,
2424- ) {}
2424+ ) {
2525+ }
25262627 /**
2728 * Extract all records from blocks.
···4748 $cidStr = $cid->toString();
48494950 // Get block data
5050- if (!isset($this->blocks[$cidStr])) {
5151+ if (! isset($this->blocks[$cidStr])) {
5152 // Block not found - might be a pruned tree, skip it
5253 return;
5354 }
···5758 // Decode CBOR block
5859 $node = CBOR::decode($blockData);
59606060- if (!is_array($node)) {
6161+ if (! is_array($node)) {
6162 return;
6263 }
6364···6970 // Process entries
7071 if (isset($node['e']) && is_array($node['e'])) {
7172 foreach ($node['e'] as $entry) {
7272- if (!is_array($entry)) {
7373+ if (! is_array($entry)) {
7374 continue;
7475 }
7576···121122 {
122123 $cidStr = $cid->toString();
123124124124- if (!isset($this->blocks[$cidStr])) {
125125+ if (! isset($this->blocks[$cidStr])) {
125126 return null;
126127 }
127128
+3-4
src/Core/CAR.php
···4455namespace SocialDept\Signal\Core;
6677-use Generator;
87use SocialDept\Signal\CAR\BlockReader;
99-use SocialDept\Signal\CAR\RecordExtractor;
108119/**
1210 * CAR (Content Addressable aRchive) facade.
···2927 {
3028 // Read all blocks from CAR
3129 $blockReader = new BlockReader($data);
3030+3231 return $blockReader->getBlockMap();
3332 }
3433···46454746 $decoded = CBOR::decode($firstBlock);
48474949- if (!is_array($decoded)) {
4848+ if (! is_array($decoded)) {
5049 return null;
5150 }
5251···67666867 $commit = CBOR::decode($firstBlock);
69687070- if (!is_array($commit)) {
6969+ if (! is_array($commit)) {
7170 return null;
7271 }
7372
+2-1
src/Core/CID.php
···2323 public readonly int $version,
2424 public readonly int $codec,
2525 public readonly string $hash,
2626- ) {}
2626+ ) {
2727+ }
27282829 /**
2930 * Parse CID from binary data.
+2-1
src/Events/AccountEvent.php
···1212 public ?string $status = null,
1313 public int $seq = 0,
1414 public ?string $time = null,
1515- ) {}
1515+ ) {
1616+ }
16171718 public static function fromArray(array $data): self
1819 {
+2-1
src/Events/IdentityEvent.php
···1111 public ?string $handle = null,
1212 public int $seq = 0,
1313 public ?string $time = null,
1414- ) {}
1414+ ) {
1515+ }
15161617 public static function fromArray(array $data): self
1718 {
+2-1
src/Events/SignalEvent.php
···1313 public ?CommitEvent $commit = null,
1414 public ?IdentityEvent $identity = null,
1515 public ?AccountEvent $account = null,
1616- ) {}
1616+ ) {
1717+ }
17181819 public function isCommit(): bool
1920 {
+6-2
src/Jobs/ProcessSignalJob.php
···12121313class ProcessSignalJob implements ShouldQueue
1414{
1515- use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
1515+ use Dispatchable;
1616+ use InteractsWithQueue;
1717+ use Queueable;
1818+ use SerializesModels;
16191720 public function __construct(
1821 protected Signal $signal,
1922 protected SignalEvent $event,
2020- ) {}
2323+ ) {
2424+ }
21252226 public function handle(): void
2327 {
+2-1
src/Services/FirehoseConsumer.php
···8383 */
8484 protected function connect(string $url): void
8585 {
8686- $this->connection = new WebSocketConnection;
8686+ $this->connection = new WebSocketConnection();
87878888 // Set up event handlers
8989 $this->connection
···413413414414 if ($this->reconnectAttempts >= $maxAttempts) {
415415 Log::error('Signal: Max reconnection attempts reached');
416416+416417 throw new ConnectionException('Failed to reconnect to Firehose after '.$maxAttempts.' attempts');
417418 }
418419
+2-1
src/Services/JetstreamConsumer.php
···7676 */
7777 protected function connect(string $url): void
7878 {
7979- $this->connection = new WebSocketConnection;
7979+ $this->connection = new WebSocketConnection();
80808181 // Set up event handlers
8282 $this->connection
···178178179179 if ($this->reconnectAttempts >= $maxAttempts) {
180180 Log::error('Signal: Max reconnection attempts reached');
181181+181182 throw new ConnectionException('Failed to reconnect to Jetstream after '.$maxAttempts.' attempts');
182183 }
183184
+2-1
src/Services/SignalManager.php
···99 public function __construct(
1010 protected FirehoseConsumer $firehoseConsumer,
1111 protected JetstreamConsumer $jetstreamConsumer,
1212- ) {}
1212+ ) {
1313+ }
13141415 /**
1516 * Start consuming events from the AT Protocol.
+4-4
src/SignalServiceProvider.php
···2727 // Register cursor store
2828 $this->app->singleton(CursorStore::class, function ($app) {
2929 return match (config('signal.cursor_storage')) {
3030- 'redis' => new RedisCursorStore,
3131- 'file' => new FileCursorStore,
3232- default => new DatabaseCursorStore,
3030+ 'redis' => new RedisCursorStore(),
3131+ 'file' => new FileCursorStore(),
3232+ default => new DatabaseCursorStore(),
3333 };
3434 });
35353636 // Register signal registry
3737 $this->app->singleton(SignalRegistry::class, function ($app) {
3838- $registry = new SignalRegistry;
3838+ $registry = new SignalRegistry();
39394040 // Register configured signals
4141 foreach (config('signal.signals', []) as $signal) {
+2-2
src/Storage/FileCursorStore.php
···15151616 // Ensure directory exists
1717 $directory = dirname($this->path);
1818- if (!File::exists($directory)) {
1818+ if (! File::exists($directory)) {
1919 File::makeDirectory($directory, 0755, true);
2020 }
2121 }
22222323 public function get(): ?int
2424 {
2525- if (!File::exists($this->path)) {
2525+ if (! File::exists($this->path)) {
2626 return null;
2727 }
2828
···1212 /** @test */
1313 public function it_can_create_a_signal()
1414 {
1515- $signal = new class extends Signal {
1515+ $signal = new class () extends Signal {
1616 public function eventTypes(): array
1717 {
1818 return ['commit'];
···3131 /** @test */
3232 public function it_can_filter_by_exact_collection()
3333 {
3434- $signal = new class extends Signal {
3434+ $signal = new class () extends Signal {
3535 public function eventTypes(): array
3636 {
3737 return ['commit'];
···6666 /** @test */
6767 public function it_can_filter_by_wildcard_collection()
6868 {
6969- $signalClass = new class extends Signal {
6969+ $signalClass = new class () extends Signal {
7070 public function eventTypes(): array
7171 {
7272 return ['commit'];
···8484 };
85858686 // Create registry and register the signal
8787- $registry = new \SocialDept\Signal\Services\SignalRegistry;
8787+ $registry = new \SocialDept\Signal\Services\SignalRegistry();
8888 $registry->register($signalClass::class);
89899090 // Test that it matches app.bsky.feed.post