Skip to content

Commit 18d464f

Browse files
committed
(chore): Remove orphaned docblock, profanity in comments, and section header comments
1 parent 48c8f49 commit 18d464f

File tree

8 files changed

+3
-160
lines changed

8 files changed

+3
-160
lines changed

src/Adapter.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@ public function notifyClose(string $resourceId, array $metadata = []): void
9696
unset($this->lastActivityUpdate[$resourceId]);
9797
}
9898

99-
/**
100-
* Track activity for a resource
101-
*
102-
* @param array<string, mixed> $metadata Activity metadata
103-
*/
10499
/**
105100
* Record bytes transferred for a resource
106101
*/

src/Server/HTTP/Swoole.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function onWorkerStart(Server $server, int $workerId): void
164164
}
165165

166166
/**
167-
* Main request handler - FAST AS FUCK
167+
* Main request handler
168168
*
169169
* Performance: <1ms for cache hit
170170
*/

src/Server/HTTP/SwooleCoroutine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function onWorkerStart(int $workerId = 0): void
156156
}
157157

158158
/**
159-
* Main request handler - FAST AS FUCK
159+
* Main request handler
160160
*
161161
* Performance: <1ms for cache hit
162162
*/

src/Server/TCP/Swoole.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function onConnect(Server $server, int $fd, int $reactorId): void
204204
}
205205

206206
/**
207-
* Main receive handler - FAST AS FUCK
207+
* Main receive handler
208208
*
209209
* Performance: <1ms overhead for proxying
210210
*

tests/Integration/EdgeIntegrationTest.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ protected function setUp(): void
3131
}
3232
}
3333

34-
// ---------------------------------------------------------------
35-
// 1. Full Resolution Flow
36-
// ---------------------------------------------------------------
37-
3834
/**
3935
* @group integration
4036
*/
@@ -130,10 +126,6 @@ public function testMysqlDatabaseIdExtractionFeedsIntoResolution(): void
130126
$this->assertSame(Protocol::MySQL, $result->protocol);
131127
}
132128

133-
// ---------------------------------------------------------------
134-
// 2. Read/Write Split Resolution
135-
// ---------------------------------------------------------------
136-
137129
/**
138130
* @group integration
139131
*/
@@ -267,10 +259,6 @@ public function testTransactionPinsReadsToPrimaryThroughFullFlow(): void
267259
$this->assertSame('10.0.1.20:5432', $result->endpoint);
268260
}
269261

270-
// ---------------------------------------------------------------
271-
// 3. Failover Behavior
272-
// ---------------------------------------------------------------
273-
274262
/**
275263
* @group integration
276264
*/
@@ -377,10 +365,6 @@ public function testFailoverResolverHandlesUnavailablePrimary(): void
377365
$this->assertTrue($failoverResolver->didFailover());
378366
}
379367

380-
// ---------------------------------------------------------------
381-
// 4. Connection Caching/Pooling
382-
// ---------------------------------------------------------------
383-
384368
/**
385369
* @group integration
386370
*/
@@ -482,10 +466,6 @@ public function testDifferentDatabasesResolveIndependently(): void
482466
$this->assertNotSame($result1->endpoint, $result2->endpoint);
483467
}
484468

485-
// ---------------------------------------------------------------
486-
// 5. Concurrent Resolution for Multiple Database IDs
487-
// ---------------------------------------------------------------
488-
489469
/**
490470
* @group integration
491471
*/
@@ -565,10 +545,6 @@ public function testConcurrentResolutionWithMixedSuccessAndFailure(): void
565545
$this->assertSame(2, $stats['connections']);
566546
}
567547

568-
// ---------------------------------------------------------------
569-
// 6. Lifecycle Tracking (connect/disconnect/activity)
570-
// ---------------------------------------------------------------
571-
572548
/**
573549
* @group integration
574550
*/
@@ -650,10 +626,6 @@ public function testStatsAggregateAcrossOperations(): void
650626
$this->assertSame(1, $resolverStats['disconnects']);
651627
}
652628

653-
// ---------------------------------------------------------------
654-
// Helper: Build a PostgreSQL Simple Query message
655-
// ---------------------------------------------------------------
656-
657629
private function buildPgQuery(string $sql): string
658630
{
659631
$body = $sql . "\x00";
@@ -663,10 +635,6 @@ private function buildPgQuery(string $sql): string
663635
}
664636
}
665637

666-
// ---------------------------------------------------------------------------
667-
// Mock Resolvers that simulate Edge HTTP interactions
668-
// ---------------------------------------------------------------------------
669-
670638
/**
671639
* Simulates an Edge service resolver that resolves database IDs to backend
672640
* endpoints via HTTP lookups. In production, the resolve() call would be an

tests/Performance/PerformanceTest.php

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ protected function setUp(): void
105105
$this->readWriteSplitPort = (int) (getenv('PERF_READ_WRITE_SPLIT_PORT') ?: 0);
106106
}
107107

108-
// -------------------------------------------------------------------------
109-
// Test: Connection Rate
110-
// -------------------------------------------------------------------------
111-
112108
/**
113109
* Measure how many TCP connections per second can be established
114110
* and complete the PostgreSQL startup handshake through the proxy.
@@ -161,10 +157,6 @@ public function testConnectionRate(): void
161157
);
162158
}
163159

164-
// -------------------------------------------------------------------------
165-
// Test: Query Throughput
166-
// -------------------------------------------------------------------------
167-
168160
/**
169161
* Measure queries per second through the proxy by sending PostgreSQL
170162
* simple query protocol messages and counting responses.
@@ -218,10 +210,6 @@ public function testQueryThroughput(): void
218210
$this->assertGreaterThan(0, $successful, 'Should complete at least one query');
219211
}
220212

221-
// -------------------------------------------------------------------------
222-
// Test: Cold Start Latency
223-
// -------------------------------------------------------------------------
224-
225213
/**
226214
* Measure time from first connection to first query response. This includes
227215
* the resolver lookup, backend connection establishment, and initial handshake.
@@ -282,10 +270,6 @@ public function testColdStartLatency(): void
282270
$this->recordResult('cold_start_p99', $p99, 'ms', null);
283271
}
284272

285-
// -------------------------------------------------------------------------
286-
// Test: Failover Latency
287-
// -------------------------------------------------------------------------
288-
289273
/**
290274
* Measure the time to detect backend failure and establish a new connection.
291275
* This simulates what happens when the resolver returns a different backend
@@ -352,10 +336,6 @@ public function testFailoverLatency(): void
352336
$this->recordResult('failover_p95', $p95, 'ms', null);
353337
}
354338

355-
// -------------------------------------------------------------------------
356-
// Test: Large Payload Throughput
357-
// -------------------------------------------------------------------------
358-
359339
/**
360340
* Send increasingly large payloads (1KB, 10KB, 100KB, 1MB, 10MB) through
361341
* the proxy and measure throughput at each size.
@@ -428,10 +408,6 @@ public function testLargePayloadThroughput(): void
428408
}
429409
}
430410

431-
// -------------------------------------------------------------------------
432-
// Test: Connection Pool Exhaustion
433-
// -------------------------------------------------------------------------
434-
435411
/**
436412
* Open connections until the max_connections limit is reached.
437413
* Verify the proxy handles this gracefully (rejects with an error
@@ -522,10 +498,6 @@ public function testConnectionPoolExhaustion(): void
522498
}
523499
}
524500

525-
// -------------------------------------------------------------------------
526-
// Test: Concurrent Connection Scaling
527-
// -------------------------------------------------------------------------
528-
529501
/**
530502
* Measure query latency with 10, 100, 1000, and 10000 concurrent connections
531503
* to observe how the proxy scales under increasing load.
@@ -641,10 +613,6 @@ public function testConcurrentConnectionScaling(): void
641613
$this->assertArrayHasKey('latency_at_10_avg', self::$results);
642614
}
643615

644-
// -------------------------------------------------------------------------
645-
// Test: Read/Write Split Overhead
646-
// -------------------------------------------------------------------------
647-
648616
/**
649617
* Compare query latency with and without read/write split enabled.
650618
* Measures the overhead introduced by query classification.
@@ -699,10 +667,6 @@ public function testReadWriteSplitOverhead(): void
699667
);
700668
}
701669

702-
// =========================================================================
703-
// PostgreSQL wire protocol helpers
704-
// =========================================================================
705-
706670
/**
707671
* Build a PostgreSQL StartupMessage with the database name encoding the
708672
* database ID for the proxy resolver.
@@ -860,10 +824,6 @@ private function benchmarkQueryLatency(string $host, int $port, int $count): arr
860824
return $latencies;
861825
}
862826

863-
// =========================================================================
864-
// Result recording and logging
865-
// =========================================================================
866-
867827
/**
868828
* Record a benchmark result for the summary table.
869829
*/

tests/QueryParserTest.php

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ protected function setUp(): void
1919
$this->mysqlParser = new MySQL();
2020
}
2121

22-
// ---------------------------------------------------------------
23-
// PostgreSQL Simple Query Protocol
24-
// ---------------------------------------------------------------
25-
2622
/**
2723
* Build a PostgreSQL Simple Query ('Q') message
2824
*
@@ -189,10 +185,6 @@ public function testPgDo(): void
189185
$this->assertSame(QueryType::Write, $this->pgParser->parse($data));
190186
}
191187

192-
// ---------------------------------------------------------------
193-
// PostgreSQL Transaction Commands
194-
// ---------------------------------------------------------------
195-
196188
public function testPgBeginTransaction(): void
197189
{
198190
$data = $this->buildPgQuery('BEGIN');
@@ -235,10 +227,6 @@ public function testPgSetCommand(): void
235227
$this->assertSame(QueryType::Transaction, $this->pgParser->parse($data));
236228
}
237229

238-
// ---------------------------------------------------------------
239-
// PostgreSQL Extended Query Protocol
240-
// ---------------------------------------------------------------
241-
242230
public function testPgParseMessageRoutesToWrite(): void
243231
{
244232
$data = $this->buildPgParse('stmt1', 'SELECT * FROM users');
@@ -257,10 +245,6 @@ public function testPgExecuteMessageRoutesToWrite(): void
257245
$this->assertSame(QueryType::Write, $this->pgParser->parse($data));
258246
}
259247

260-
// ---------------------------------------------------------------
261-
// PostgreSQL Edge Cases
262-
// ---------------------------------------------------------------
263-
264248
public function testPgTooShortPacket(): void
265249
{
266250
$this->assertSame(QueryType::Unknown, $this->pgParser->parse('Q'));
@@ -272,10 +256,6 @@ public function testPgUnknownMessageType(): void
272256
$this->assertSame(QueryType::Unknown, $this->pgParser->parse($data));
273257
}
274258

275-
// ---------------------------------------------------------------
276-
// MySQL COM_QUERY Protocol
277-
// ---------------------------------------------------------------
278-
279259
/**
280260
* Build a MySQL COM_QUERY packet
281261
*
@@ -393,10 +373,6 @@ public function testMysqlTruncate(): void
393373
$this->assertSame(QueryType::Write, $this->mysqlParser->parse($data));
394374
}
395375

396-
// ---------------------------------------------------------------
397-
// MySQL Transaction Commands
398-
// ---------------------------------------------------------------
399-
400376
public function testMysqlBeginTransaction(): void
401377
{
402378
$data = $this->buildMySQLQuery('BEGIN');
@@ -427,10 +403,6 @@ public function testMysqlSetCommand(): void
427403
$this->assertSame(QueryType::Transaction, $this->mysqlParser->parse($data));
428404
}
429405

430-
// ---------------------------------------------------------------
431-
// MySQL Prepared Statement Protocol
432-
// ---------------------------------------------------------------
433-
434406
public function testMysqlStmtPrepareRoutesToWrite(): void
435407
{
436408
$data = $this->buildMySQLStmtPrepare('SELECT * FROM users WHERE id = ?');
@@ -443,10 +415,6 @@ public function testMysqlStmtExecuteRoutesToWrite(): void
443415
$this->assertSame(QueryType::Write, $this->mysqlParser->parse($data));
444416
}
445417

446-
// ---------------------------------------------------------------
447-
// MySQL Edge Cases
448-
// ---------------------------------------------------------------
449-
450418
public function testMysqlTooShortPacket(): void
451419
{
452420
$this->assertSame(QueryType::Unknown, $this->mysqlParser->parse("\x00\x00"));
@@ -461,10 +429,6 @@ public function testMysqlUnknownCommand(): void
461429
$this->assertSame(QueryType::Unknown, $this->mysqlParser->parse($data));
462430
}
463431

464-
// ---------------------------------------------------------------
465-
// SQL Classification (classifySQL) — Edge Cases
466-
// ---------------------------------------------------------------
467-
468432
public function testClassifyLeadingWhitespace(): void
469433
{
470434
$this->assertSame(QueryType::Read, $this->pgParser->classifySQL(" \t\n SELECT * FROM users"));
@@ -518,10 +482,6 @@ public function testClassifySelectWithSemicolon(): void
518482
$this->assertSame(QueryType::Read, $this->pgParser->classifySQL('SELECT;'));
519483
}
520484

521-
// ---------------------------------------------------------------
522-
// COPY Direction Classification
523-
// ---------------------------------------------------------------
524-
525485
public function testClassifyCopyTo(): void
526486
{
527487
$this->assertSame(QueryType::Read, $this->pgParser->classifySQL('COPY users TO STDOUT'));
@@ -538,10 +498,6 @@ public function testClassifyCopyAmbiguous(): void
538498
$this->assertSame(QueryType::Write, $this->pgParser->classifySQL('COPY users'));
539499
}
540500

541-
// ---------------------------------------------------------------
542-
// CTE (WITH) Classification
543-
// ---------------------------------------------------------------
544-
545501
public function testClassifyCteWithSelect(): void
546502
{
547503
$sql = 'WITH active_users AS (SELECT * FROM users WHERE active = true) SELECT * FROM active_users';
@@ -579,10 +535,6 @@ public function testClassifyCteNoFinalKeyword(): void
579535
$this->assertSame(QueryType::Read, $this->pgParser->classifySQL($sql));
580536
}
581537

582-
// ---------------------------------------------------------------
583-
// Keyword Extraction
584-
// ---------------------------------------------------------------
585-
586538
public function testExtractKeywordSimple(): void
587539
{
588540
$this->assertSame('SELECT', $this->pgParser->extractKeyword('SELECT * FROM users'));
@@ -613,10 +565,6 @@ public function testExtractKeywordParenthesized(): void
613565
$this->assertSame('SELECT', $this->pgParser->extractKeyword('SELECT(1)'));
614566
}
615567

616-
// ---------------------------------------------------------------
617-
// Performance
618-
// ---------------------------------------------------------------
619-
620568
public function testParsePerformance(): void
621569
{
622570
$pgData = $this->buildPgQuery('SELECT * FROM users WHERE id = 1');

0 commit comments

Comments
 (0)