Skip to content

Commit

Permalink
Merge pull request #27 from ray-di/cs
Browse files Browse the repository at this point in the history
Add Variable-length argument symbol "..." to phpdoc
  • Loading branch information
koriym authored Nov 15, 2021
2 parents 26acc60 + 878cb2f commit 511342e
Show file tree
Hide file tree
Showing 8 changed files with 159 additions and 160 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
"ext-pdo": "*",
"aura/sql": "^3.0",
"bear/resource": "^1.15",
"doctrine/annotations": "^1.11",
"doctrine/annotations": "^1.12",
"guzzlehttp/guzzle": "^6.3 || ^7.0",
"koriym/query-locator": "^1.4",
"ray/aop": "^2.10.3",
"ray/aura-sql-module": "^1.10.0",
"ray/di": "^2.11"
"ray/di": "^2.11",
"nikic/php-parser": "^v4.13"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand Down
2 changes: 1 addition & 1 deletion src/QueryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
interface QueryInterface
{
/**
* @param array<string, mixed> $query
* @param array<string, mixed> ...$query
*
* @return mixed
*/
Expand Down
2 changes: 1 addition & 1 deletion src/RowInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
interface RowInterface extends QueryInterface
{
/**
* @param array<string, mixed> $query
* @param array<string, mixed> ...$query
*
* @return iterable<mixed>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/RowListInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
interface RowListInterface extends QueryInterface
{
/**
* @param array<string, mixed> $query
* @param array<string, mixed> ...$query
*
* @return iterable<mixed>
*/
Expand Down
3 changes: 1 addition & 2 deletions src/SqlQueryRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ public function __construct(ExtendedPdoInterface $pdo, string $sql)
}

/**
* @param array<string, mixed> $queries
* @param array<string, mixed> ...$queries
*/
public function __invoke(array ...$queries): iterable
{
/** @var array<string, mixed> $query */
$query = $queries[0];
$item = $this->pdo->fetchAssoc($this->sql, $query);
if (! count($item)) {
Expand Down
3 changes: 1 addition & 2 deletions src/SqlQueryRowList.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(ExtendedPdoInterface $pdo, string $sql)
}

/**
* @param array<string, mixed> $queries
* @param array<string, mixed> ...$queries
*/
public function __invoke(array ...$queries): iterable
{
Expand All @@ -49,7 +49,6 @@ public function __invoke(array ...$queries): iterable
$result = null;
for ($i = 0; $i < $numQueris; $i++) {
$sql = $sqls[$i];
/** @var array<string, mixed> $query */
$query = $queries[$i];
$result = $this->pdo->perform($sql, $query);
}
Expand Down
3 changes: 1 addition & 2 deletions src/WebQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ public function __construct(ClientInterface $client, string $method, string $uri
}

/**
* @param array<string, mixed> $queries
* @param array<string, mixed> ...$queries
*/
public function __invoke(array ...$queries): iterable
{
/** @var array<string, mixed> $query */
$query = $queries[0];
try {
$response = $this->client->request($this->method, $this->uri, ['query' => $query]);
Expand Down
Loading

0 comments on commit 511342e

Please sign in to comment.