Skip to content

Commit

Permalink
The dreaded formatting PR (#99)
Browse files Browse the repository at this point in the history
* The dreaded formatting commit

* Fix a few remaining tests

* Apply hackfmt with applicable args
  • Loading branch information
muglug committed May 8, 2023
1 parent 395f442 commit 0a1e659
Show file tree
Hide file tree
Showing 72 changed files with 9,124 additions and 9,145 deletions.
10 changes: 7 additions & 3 deletions .devcontainer/devcontainer.json
Expand Up @@ -7,9 +7,13 @@
"userEnvProbe": "loginShell",

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"pranayagarwal.vscode-hack"
],
"customizations": {
"vscode": {
"extensions": [
"pranayagarwal.vscode-hack"
]
}
},

"mounts": [],

Expand Down
3 changes: 1 addition & 2 deletions .hhconfig
@@ -1,5 +1,4 @@
hackfmt.line_width=120
hackfmt.tabs=true
allowed_decl_fixme_codes=2053,3012,4045,4047,4341
allowed_fixme_codes_strict=2011,2049,2050,2053,2083,3012,3084,4027,4038,4045,4047,4104,4105,4106,4107,4108,4110,4128,4135,4188,4223,4240,4323,4341,4390,4401


2 changes: 1 addition & 1 deletion bin/setup-devcontainer
Expand Up @@ -39,6 +39,6 @@ echo ""

# Install dependencies
echo "Installing dependencies..."
php composer.phar install
php composer.phar install --ignore-platform-reqs
echo ""

2 changes: 1 addition & 1 deletion src/AsyncMysql/AsyncMysqlClient.php
Expand Up @@ -25,7 +25,7 @@ public static function setPoolsConnectionLimit(int $_limit): void {}
int $_tcp_timeout_micros = 0,
string $_sni_server_name = '',
string $_server_cert_extension = '',
string $_server_cert_values = '',
string $_server_cert_values = '',
): Awaitable<\AsyncMysqlConnection> {
return new AsyncMysqlConnection($host, $port, $dbname);
}
Expand Down
44 changes: 22 additions & 22 deletions src/AsyncMysql/AsyncMysqlClientStats.php
Expand Up @@ -9,27 +9,27 @@
<<__MockClass>>
final class AsyncMysqlClientStats extends \AsyncMysqlClientStats {

/* HH_IGNORE_ERROR[3012] I don't want to call parent::construct */
public function __construct() {}
/* HH_IGNORE_ERROR[3012] I don't want to call parent::construct */
public function __construct() {}

<<__Override>>
public function ioEventLoopMicrosAvg(): float {
return 0.0;
}
<<__Override>>
public function callbackDelayMicrosAvg(): float {
return 0.0;
}
<<__Override>>
public function ioThreadBusyMicrosAvg(): float {
return 0.0;
}
<<__Override>>
public function ioThreadIdleMicrosAvg(): float {
return 0.0;
}
<<__Override>>
public function notificationQueueSize(): int {
return 0;
}
<<__Override>>
public function ioEventLoopMicrosAvg(): float {
return 0.0;
}
<<__Override>>
public function callbackDelayMicrosAvg(): float {
return 0.0;
}
<<__Override>>
public function ioThreadBusyMicrosAvg(): float {
return 0.0;
}
<<__Override>>
public function ioThreadIdleMicrosAvg(): float {
return 0.0;
}
<<__Override>>
public function notificationQueueSize(): int {
return 0;
}
}
56 changes: 28 additions & 28 deletions src/AsyncMysql/AsyncMysqlConnectResult.php
Expand Up @@ -4,35 +4,35 @@

<<__MockClass>>
final class AsyncMysqlConnectResult extends \AsyncMysqlConnectResult {
private float $elapsed;
private float $start;
private float $elapsed;
private float $start;

/* HH_IGNORE_ERROR[3012] I don't want to call parent::construct */
public function __construct(bool $from_pool) {
// pretend connections take longer if they don't come from the pool
if ($from_pool) {
$this->elapsed = .001;
} else {
$this->elapsed = .01;
}
$this->start = \microtime(true);
}
/* HH_IGNORE_ERROR[3012] I don't want to call parent::construct */
public function __construct(bool $from_pool) {
// pretend connections take longer if they don't come from the pool
if ($from_pool) {
$this->elapsed = .001;
} else {
$this->elapsed = .01;
}
$this->start = \microtime(true);
}

<<__Override>>
public function elapsedMicros(): int {
return (int)($this->elapsed * 1000000);
}
<<__Override>>
public function startTime(): float {
return $this->start;
}
<<__Override>>
public function endTime(): float {
return $this->start + $this->elapsed;
}
<<__Override>>
public function elapsedMicros(): int {
return (int)($this->elapsed * 1000000);
}
<<__Override>>
public function startTime(): float {
return $this->start;
}
<<__Override>>
public function endTime(): float {
return $this->start + $this->elapsed;
}

<<__Override>>
public function clientStats(): \AsyncMysqlClientStats {
return new AsyncMysqlClientStats();
}
<<__Override>>
public function clientStats(): \AsyncMysqlClientStats {
return new AsyncMysqlClientStats();
}
}

0 comments on commit 0a1e659

Please sign in to comment.