From 1c74d7fe595df223279de55dffc7ae6fc8ac9ca6 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 30 Jan 2019 08:55:29 -0600 Subject: [PATCH] formatting --- src/Illuminate/Database/Schema/Blueprint.php | 24 +++++++++--------- .../Database/Schema/Grammars/Grammar.php | 25 ++++++++++--------- .../Database/Schema/Grammars/MySqlGrammar.php | 5 ++-- .../Schema/Grammars/SqlServerGrammar.php | 2 +- 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php index 355c1cea1d68..8831715477c3 100755 --- a/src/Illuminate/Database/Schema/Blueprint.php +++ b/src/Illuminate/Database/Schema/Blueprint.php @@ -822,18 +822,6 @@ public function unsignedDecimal($column, $total = 8, $places = 2) ]); } - /** - * Create a new generated computed column on the table. - * - * @param string $column - * @param string $expression - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function computed($column, $expression) - { - return $this->addColumn('computed', $column, compact('expression')); - } - /** * Create a new boolean column on the table. * @@ -1169,6 +1157,18 @@ public function multiPolygon($column) return $this->addColumn('multipolygon', $column); } + /** + * Create a new generated, computed column on the table. + * + * @param string $column + * @param string $expression + * @return \Illuminate\Database\Schema\ColumnDefinition + */ + public function computed($column, $expression) + { + return $this->addColumn('computed', $column, compact('expression')); + } + /** * Add the proper columns for a polymorphic table. * diff --git a/src/Illuminate/Database/Schema/Grammars/Grammar.php b/src/Illuminate/Database/Schema/Grammars/Grammar.php index f163c999de2f..0f81731b36a6 100755 --- a/src/Illuminate/Database/Schema/Grammars/Grammar.php +++ b/src/Illuminate/Database/Schema/Grammars/Grammar.php @@ -128,6 +128,19 @@ protected function getType(Fluent $column) return $this->{'type'.ucfirst($column->type)}($column); } + /** + * Create the column definition for a generated, computed column type. + * + * @param \Illuminate\Support\Fluent $column + * @return void + * + * @throws \RuntimeException + */ + protected function typeComputed(Fluent $column) + { + throw new RuntimeException('This database driver does not support the computed type.'); + } + /** * Add the column modifiers to the definition. * @@ -191,18 +204,6 @@ public function prefixArray($prefix, array $values) }, $values); } - /** - * Create the column definition for a generated computed column type. - * - * @param \Illuminate\Support\Fluent $column - * - * @throws \RuntimeException - */ - protected function typeComputed(Fluent $column) - { - throw new RuntimeException('The database driver in use does not support the computed type.'); - } - /** * Wrap a table in keyword identifiers. * diff --git a/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php b/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php index 482281c87d69..b7dedf62aa68 100755 --- a/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php @@ -835,15 +835,16 @@ public function typeMultiPolygon(Fluent $column) } /** - * Create the column definition for a generated computed column type. + * Create the column definition for a generated, computed column type. * * @param \Illuminate\Support\Fluent $column + * @return void * * @throws \RuntimeException */ protected function typeComputed(Fluent $column) { - throw new RuntimeException('The database driver in use requires a type, see virtualAs/storedAs modifiers.'); + throw new RuntimeException('This database driver requires a type, see the virtualAs / storedAs modifiers.'); } /** diff --git a/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php b/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php index 27d8773db329..dfcc52fa4ee3 100755 --- a/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php @@ -734,7 +734,7 @@ public function typeMultiPolygon(Fluent $column) } /** - * Create the column definition for a generated computed column type. + * Create the column definition for a generated, computed column type. * * @param \Illuminate\Support\Fluent $column * @return string|null