Skip to content

Commit

Permalink
Chnage all statement return types to static
Browse files Browse the repository at this point in the history
  • Loading branch information
kwhat committed Aug 11, 2022
1 parent d1de9b4 commit 6313caf
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions src/AdvancedStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ protected function renderOrderBy(): string
/**
* @param LimitInterface $limit
*
* @return self
* @return static
*/
public function limit(LimitInterface $limit): self
public function limit(LimitInterface $limit)
{
$this->limit = $limit;

Expand Down
2 changes: 1 addition & 1 deletion src/AdvancedStatementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function orderBy(string $column, string $direction = '');
/**
* @param LimitInterface $limit
*
* @return self
* @return static
*/
public function limit(LimitInterface $limit);
}
4 changes: 2 additions & 2 deletions src/Statement/Call.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public function __construct(Database $dbh, ?MethodInterface $procedure = null)
/**
* @param MethodInterface $procedure
*
* @return self
* @return static
*/
public function method(MethodInterface $procedure): self
public function method(MethodInterface $procedure)
{
$this->method = $procedure;

Expand Down
2 changes: 1 addition & 1 deletion src/Statement/CallInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface CallInterface extends StatementInterface
/**
* @param MethodInterface $procedure
*
* @return self
* @return static
*/
public function method(MethodInterface $procedure);
}
4 changes: 2 additions & 2 deletions src/Statement/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public function __construct(Database $dbh, $table = null)
/**
* @param string|array<string, string> $table
*
* @return self
* @return static
*/
public function from($table): self
public function from($table)
{
$this->table = $table;

Expand Down
2 changes: 1 addition & 1 deletion src/Statement/DeleteInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface DeleteInterface extends StatementInterface
/**
* @param string|array<string, string> $table
*
* @return self
* @return static
*/
public function from($table);
}
24 changes: 12 additions & 12 deletions src/Statement/Insert.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ public function __construct(Database $dbh, array $columns = [])
/**
* @param string $level
*
* @return self
* @return static
*/
public function priority(string $level): self
public function priority(string $level)
{
$this->priority = strtoupper(trim($level));

Expand Down Expand Up @@ -84,9 +84,9 @@ protected function renderPriority(): string
}

/**
* @return self
* @return static
*/
public function ignore(): self
public function ignore()
{
$this->ignore = true;

Expand All @@ -110,9 +110,9 @@ protected function renderIgnore(): string
/**
* @param string $table
*
* @return self
* @return static
*/
public function into(string $table): self
public function into(string $table)
{
$this->table = $table;

Expand All @@ -134,9 +134,9 @@ protected function renderInto(): string
/**
* @param string ...$columns
*
* @return self
* @return static
*/
public function columns(string ...$columns): self
public function columns(string ...$columns)
{
$this->columns = $columns;

Expand All @@ -160,9 +160,9 @@ protected function renderColumns(): string
* @param float|int|string|RawInterface|SelectInterface $value
* @param float|int|string|RawInterface ...$values
*
* @return self
* @return static
*/
public function values($value, ...$values): self
public function values($value, ...$values)
{
array_unshift($values, $value);
$this->values[] = $values;
Expand Down Expand Up @@ -236,9 +236,9 @@ protected function renderValues(): string
/**
* @param array<string, float|int|string|RawInterface> $paris
*
* @return self
* @return static
*/
public function onDuplicateUpdate(array $paris = []): self
public function onDuplicateUpdate(array $paris = [])
{
$this->update = $paris;

Expand Down
12 changes: 6 additions & 6 deletions src/Statement/InsertInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,41 @@ interface InsertInterface extends StatementInterface
/**
* @param string $level
*
* @return self
* @return static
*/
public function priority(string $level);

/**
* @return self
* @return static
*/
public function ignore();

/**
* @param string $table
*
* @return self
* @return static
*/
public function into(string $table);

/**
* @param string ...$columns
*
* @return self
* @return static
*/
public function columns(string ...$columns);

/**
* @param float|int|string|RawInterface|SelectInterface $value
* @param float|int|string|RawInterface ...$values
*
* @return self
* @return static
*/
public function values($value, ...$values);

/**
* @param array<string, float|int|string|RawInterface> $paris
*
* @return self
* @return static
*/
public function onDuplicateUpdate(array $paris = []);
}
28 changes: 14 additions & 14 deletions src/Statement/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public function __construct(Database $dbh, array $columns = ['*'])
}

/**
* @return self
* @return static
*/
public function distinct(): self
public function distinct()
{
$this->distinct = true;

Expand All @@ -73,9 +73,9 @@ protected function renderDistinct(): string
/**
* @param array<int|string, string|SelectInterface> $columns
*
* @return self
* @return static
*/
public function columns(array $columns = ['*']): self
public function columns(array $columns = ['*'])
{
if (empty($columns)) {
$this->columns = ['*'];
Expand Down Expand Up @@ -114,9 +114,9 @@ protected function renderColumns(): string
/**
* @param string|array<string, string|SelectInterface> $table
*
* @return self
* @return static
*/
public function from($table): self
public function from($table)
{
$this->table = $table;

Expand Down Expand Up @@ -152,9 +152,9 @@ protected function renderFrom(): string
/**
* @param SelectInterface $query
*
* @return self
* @return static
*/
public function union(SelectInterface $query): self
public function union(SelectInterface $query)
{
$this->union[$this->getUnionCount()] = $query;

Expand All @@ -164,9 +164,9 @@ public function union(SelectInterface $query): self
/**
* @param SelectInterface $query
*
* @return self
* @return static
*/
public function unionAll(SelectInterface $query): self
public function unionAll(SelectInterface $query)
{
$this->unionAll[$this->getUnionCount()] = $query;

Expand Down Expand Up @@ -206,9 +206,9 @@ protected function renderUnion(): string
/**
* @param string ...$columns
*
* @return self
* @return static
*/
public function groupBy(string ...$columns): self
public function groupBy(string ...$columns)
{
$this->groupBy = array_merge($this->groupBy, $columns);

Expand All @@ -231,9 +231,9 @@ protected function renderGroupBy(): string
/**
* @param ConditionalInterface $clause
*
* @return self
* @return static
*/
public function having(ConditionalInterface $clause): self
public function having(ConditionalInterface $clause)
{
$this->having = $clause;

Expand Down
14 changes: 7 additions & 7 deletions src/Statement/SelectInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,49 +13,49 @@
interface SelectInterface extends AdvancedStatementInterface
{
/**
* @return self
* @return static
*/
public function distinct();

/**
* @param array<int|string, string|SelectInterface> $columns
*
* @return self
* @return static
*/
public function columns(array $columns = ['*']);

/**
* @param string|array<string, string|SelectInterface> $table
*
* @return self
* @return static
*/
public function from($table);

/**
* @param SelectInterface $query
*
* @return self
* @return static
*/
public function union(SelectInterface $query);

/**
* @param SelectInterface $query
*
* @return self
* @return static
*/
public function unionAll(SelectInterface $query);

/**
* @param string ...$columns
*
* @return self
* @return static
*/
public function groupBy(string ...$columns);

/**
* @param ConditionalInterface $clause
*
* @return self
* @return static
*/
public function having(ConditionalInterface $clause);
}
12 changes: 6 additions & 6 deletions src/Statement/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public function __construct(Database $dbh, array $pairs = [])
/**
* @param string $table
*
* @return self
* @return static
*/
public function table(string $table): self
public function table(string $table)
{
$this->table = $table;

Expand All @@ -60,9 +60,9 @@ protected function renderTable(): string
* @param string $column
* @param float|int|string|RawInterface|SelectInterface $value
*
* @return self
* @return static
*/
public function set(string $column, $value): self
public function set(string $column, $value)
{
$this->pairs[$column] = $value;

Expand All @@ -72,9 +72,9 @@ public function set(string $column, $value): self
/**
* @param array<string, float|int|string|RawInterface|SelectInterface> $pairs
*
* @return self
* @return static
*/
public function pairs(array $pairs): self
public function pairs(array $pairs)
{
$this->pairs = array_merge($this->pairs, $pairs);

Expand Down
6 changes: 3 additions & 3 deletions src/Statement/UpdateInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ interface UpdateInterface extends AdvancedStatementInterface
/**
* @param string $table
*
* @return self
* @return static
*/
public function table(string $table);

/**
* @param string $column
* @param float|int|string|RawInterface|SelectInterface $value
*
* @return self
* @return static
*/
public function set(string $column, $value);

/**
* @param array<string, float|int|string|RawInterface|SelectInterface> $pairs
*
* @return self
* @return static
*/
public function pairs(array $pairs);
}

0 comments on commit 6313caf

Please sign in to comment.