Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions 5 src/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
*
* In other words, this function represents the inverse function of {@see Component::parse()}.
*
* @param mixed $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param mixed $component the component to be built
*/
public static function build($component, array $options = []): string;
public static function build($component): string;
}
5 changes: 2 additions & 3 deletions 5 src/Components/AlterOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param AlterOperation $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param AlterOperation $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
// Specific case of RENAME COLUMN that insert the field between 2 options.
$afterFieldsOptions = new OptionsArray();
Expand Down
5 changes: 2 additions & 3 deletions 5 src/Components/Array2d.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param ArrayObj[] $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param ArrayObj[] $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
return ArrayObj::build($component);
}
Expand Down
5 changes: 2 additions & 3 deletions 5 src/Components/ArrayObj.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param ArrayObj|ArrayObj[] $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param ArrayObj|ArrayObj[] $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if (is_array($component)) {
return implode(', ', $component);
Expand Down
5 changes: 2 additions & 3 deletions 5 src/Components/CaseExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param CaseExpression $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param CaseExpression $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
$ret = 'CASE ';
if (isset($component->value)) {
Expand Down
5 changes: 2 additions & 3 deletions 5 src/Components/Condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param Condition[] $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param Condition[] $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if (is_array($component)) {
return implode(' ', $component);
Expand Down
9 changes: 3 additions & 6 deletions 9 src/Components/CreateDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,8 @@ public static function parse(Parser $parser, TokensList $list, array $options =

/**
* @param CreateDefinition|CreateDefinition[] $component the component to be built
* @param array<string, mixed> $options parameters for building
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if (is_array($component)) {
return "(\n " . implode(",\n ", $component) . "\n)";
Expand All @@ -338,10 +337,8 @@ public static function build($component, array $options = []): string
}

if (! empty($component->type)) {
$tmp .= DataType::build(
$component->type,
['lowercase' => true]
) . ' ';
$component->type->lowercase = true;
$tmp .= DataType::build($component->type) . ' ';
}

if (! empty($component->key)) {
Expand Down
10 changes: 5 additions & 5 deletions 10 src/Components/DataType.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ final class DataType implements Component
*/
public $options;

public bool $lowercase = false;

/**
* @param string $name the name of this data type
* @param int[]|string[] $parameters the parameters (size or possible values)
Expand Down Expand Up @@ -153,13 +155,11 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param DataType $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param DataType $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
$name = empty($options['lowercase']) ?
$component->name : strtolower($component->name);
$name = $component->lowercase ? strtolower($component->name) : $component->name;

$parameters = '';
if ($component->parameters !== []) {
Expand Down
3 changes: 1 addition & 2 deletions 3 src/Components/Expression.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,8 @@ public static function parse(Parser $parser, TokensList $list, array $options =

/**
* @param Expression|Expression[] $component the component to be built
* @param array<string, mixed> $options parameters for building
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if (is_array($component)) {
return implode(', ', $component);
Expand Down
5 changes: 2 additions & 3 deletions 5 src/Components/ExpressionArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param Expression[] $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param Expression[] $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
$ret = [];
foreach ($component as $frag) {
Expand Down
5 changes: 2 additions & 3 deletions 5 src/Components/FunctionCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param FunctionCall $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param FunctionCall $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
return $component->name . $component->parameters;
}
Expand Down
3 changes: 1 addition & 2 deletions 3 src/Components/GroupKeyword.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ public static function parse(Parser $parser, TokensList $list, array $options =

/**
* @param GroupKeyword|GroupKeyword[] $component the component to be built
* @param array<string, mixed> $options parameters for building
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if (is_array($component)) {
return implode(', ', $component);
Expand Down
3 changes: 1 addition & 2 deletions 3 src/Components/IndexHint.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,8 @@ public static function parse(Parser $parser, TokensList $list, array $options =

/**
* @param IndexHint|IndexHint[] $component the component to be built
* @param array<string, mixed> $options parameters for building
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if (is_array($component)) {
return implode(' ', $component);
Expand Down
7 changes: 3 additions & 4 deletions 7 src/Components/IntoKeyword.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,9 @@ public function parseFileOptions(Parser $parser, TokensList $list, $keyword = 'F
}

/**
* @param IntoKeyword $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param IntoKeyword $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if ($component->dest instanceof Expression) {
$columns = ! empty($component->columns) ? '(`' . implode('`, `', $component->columns) . '`)' : '';
Expand All @@ -282,7 +281,7 @@ public static function build($component, array $options = []): string
$ret .= ' ' . $fieldsOptionsString;
}

$linesOptionsString = OptionsArray::build($component->linesOptions, ['expr' => true]);
$linesOptionsString = OptionsArray::build($component->linesOptions);
if (trim($linesOptionsString) !== '') {
$ret .= ' LINES ' . $linesOptionsString;
}
Expand Down
5 changes: 2 additions & 3 deletions 5 src/Components/JoinKeyword.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param JoinKeyword[] $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param JoinKeyword[] $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
$ret = [];
foreach ($component as $c) {
Expand Down
5 changes: 2 additions & 3 deletions 5 src/Components/Key.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param Key $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param Key $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
$ret = $component->type . ' ';
if (! empty($component->name)) {
Expand Down
5 changes: 2 additions & 3 deletions 5 src/Components/Limit.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param Limit $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param Limit $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
return $component->offset . ', ' . $component->rowCount;
}
Expand Down
3 changes: 1 addition & 2 deletions 3 src/Components/LockExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ public static function parse(Parser $parser, TokensList $list, array $options =

/**
* @param LockExpression|LockExpression[] $component the component to be built
* @param array<string, mixed> $options parameters for building
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if (is_array($component)) {
return implode(', ', $component);
Expand Down
5 changes: 2 additions & 3 deletions 5 src/Components/OptionsArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param OptionsArray $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param OptionsArray $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if (empty($component->options)) {
return '';
Expand Down
3 changes: 1 addition & 2 deletions 3 src/Components/OrderKeyword.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,8 @@ public static function parse(Parser $parser, TokensList $list, array $options =

/**
* @param OrderKeyword|OrderKeyword[] $component the component to be built
* @param array<string, mixed> $options parameters for building
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if (is_array($component)) {
return implode(', ', $component);
Expand Down
3 changes: 1 addition & 2 deletions 3 src/Components/ParameterDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,8 @@ public static function parse(Parser $parser, TokensList $list, array $options =

/**
* @param ParameterDefinition[] $component the component to be built
* @param array<string, mixed> $options parameters for building
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if (is_array($component)) {
return '(' . implode(', ', $component) . ')';
Expand Down
3 changes: 1 addition & 2 deletions 3 src/Components/PartitionDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,8 @@ public static function parse(Parser $parser, TokensList $list, array $options =

/**
* @param PartitionDefinition|PartitionDefinition[] $component the component to be built
* @param array<string, mixed> $options parameters for building
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if (is_array($component)) {
return "(\n" . implode(",\n", $component) . "\n)";
Expand Down
5 changes: 2 additions & 3 deletions 5 src/Components/Reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param Reference $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param Reference $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
return trim(
$component->table
Expand Down
5 changes: 2 additions & 3 deletions 5 src/Components/RenameOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param RenameOperation $component the component to be built
* @param array<string, mixed> $options parameters for building
* @param RenameOperation $component the component to be built
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if (is_array($component)) {
return implode(', ', $component);
Expand Down
3 changes: 1 addition & 2 deletions 3 src/Components/SetOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,8 @@ public static function parse(Parser $parser, TokensList $list, array $options =

/**
* @param SetOperation|SetOperation[] $component the component to be built
* @param array<string, mixed> $options parameters for building
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if (is_array($component)) {
return implode(', ', $component);
Expand Down
3 changes: 1 addition & 2 deletions 3 src/Components/UnionKeyword.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ public static function parse(Parser $parser, TokensList $list, array $options =

/**
* @param array<UnionKeyword[]> $component the component to be built
* @param array<string, mixed> $options parameters for building
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
$tmp = [];
foreach ($component as $componentPart) {
Expand Down
5 changes: 2 additions & 3 deletions 5 src/Components/WithKeyword.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
}

/**
* @param WithKeyword $component
* @param array<string, mixed> $options
* @param WithKeyword $component
*/
public static function build($component, array $options = []): string
public static function build($component): string
{
if (! $component instanceof WithKeyword) {
throw new RuntimeException('Can not build a component that is not a WithKeyword');
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.