-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Null output and format (#168)
- Loading branch information
Showing
5 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Constructor of class SimPod\\\\ClickHouseClient\\\\Output\\\\Null_ has an unused parameter \\$_\\.$#" | ||
count: 1 | ||
path: src/Output/Null_.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SimPod\ClickHouseClient\Format; | ||
|
||
use SimPod\ClickHouseClient\Output\Output; | ||
|
||
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps | ||
|
||
/** | ||
* @template T | ||
* @implements Format<\SimPod\ClickHouseClient\Output\Null_<T>> | ||
*/ | ||
final class Null_ implements Format | ||
{ | ||
public static function output(string $contents): Output | ||
{ | ||
return new \SimPod\ClickHouseClient\Output\Null_($contents); | ||
} | ||
|
||
public static function toSql(): string | ||
{ | ||
return 'FORMAT Null'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SimPod\ClickHouseClient\Output; | ||
|
||
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps | ||
|
||
/** | ||
* @psalm-immutable | ||
* @template T | ||
* @implements Output<T> | ||
*/ | ||
final class Null_ implements Output | ||
{ | ||
public function __construct(string $_) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters