From 8dd0a8303854740f3e39d55f9f32d47fe75ca292 Mon Sep 17 00:00:00 2001 From: Taka Oyama Date: Fri, 26 Jan 2024 14:59:27 +0900 Subject: [PATCH] chore: remove deprecated methods --- src/Concerns/ManagesDataDefinitions.php | 22 --------- src/Concerns/ManagesStaleReads.php | 64 ------------------------- src/Connection.php | 1 - src/Schema/Blueprint.php | 4 +- src/Schema/IndexDefinition.php | 4 +- 5 files changed, 4 insertions(+), 91 deletions(-) delete mode 100644 src/Concerns/ManagesStaleReads.php diff --git a/src/Concerns/ManagesDataDefinitions.php b/src/Concerns/ManagesDataDefinitions.php index 7efd8f76..871598ab 100644 --- a/src/Concerns/ManagesDataDefinitions.php +++ b/src/Concerns/ManagesDataDefinitions.php @@ -30,28 +30,6 @@ trait ManagesDataDefinitions */ abstract public function getSpannerDatabase(): Database; - /** - * @deprecated use runDdlBatch() instead - * @param string $ddl - * @return LongRunningOperation - */ - public function runDdl(string $ddl): LongRunningOperation - { - trigger_deprecation('colopl/laravel-spanner', '5.2', 'runDdl() is deprecated. Use runDdlBatch() instead.'); - return $this->getSpannerDatabase()->updateDdl($ddl); - } - - /** - * @deprecated use runDdlBatch() instead - * @param string[] $ddls - * @return LongRunningOperation - */ - public function runDdls(array $ddls): LongRunningOperation - { - trigger_deprecation('colopl/laravel-spanner', '5.2', 'runDdls() is deprecated. Use runDdlBatch() instead.'); - return $this->getSpannerDatabase()->updateDdlBatch($ddls); - } - /** * @param list $statements * @return mixed diff --git a/src/Concerns/ManagesStaleReads.php b/src/Concerns/ManagesStaleReads.php deleted file mode 100644 index 0ac0d076..00000000 --- a/src/Concerns/ManagesStaleReads.php +++ /dev/null @@ -1,64 +0,0 @@ - $bindings - * @param TimestampBoundInterface|null $timestampBound - * @return Generator> - */ - public function cursorWithTimestampBound($query, $bindings = [], TimestampBoundInterface $timestampBound = null): Generator - { - return $this->cursorWithOptions($query, $bindings, $timestampBound?->transactionOptions() ?? []); - } - - /** - * @deprecated use selectWithOptions() instead. This method will be removed in v7. - * @param string $query - * @param array $bindings - * @param TimestampBoundInterface|null $timestampBound - * @return list|null> - */ - public function selectWithTimestampBound($query, $bindings = [], TimestampBoundInterface $timestampBound = null): array - { - return $this->selectWithOptions($query, $bindings, $timestampBound?->transactionOptions() ?? []); - } - - /** - * @deprecated use selectWithOptions() instead. This method will be removed in v7. - * @param string $query - * @param array $bindings - * @param TimestampBoundInterface|null $timestampBound - * @return array|null - */ - public function selectOneWithTimestampBound($query, $bindings = [], TimestampBoundInterface $timestampBound = null): ?array - { - return $this->selectWithTimestampBound($query, $bindings, $timestampBound)[0] ?? null; - } -} - diff --git a/src/Connection.php b/src/Connection.php index ce4f370d..da576eae 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -52,7 +52,6 @@ class Connection extends BaseConnection Concerns\ManagesPartitionedDml, Concerns\ManagesSessionPool, Concerns\ManagesTransactions, - Concerns\ManagesStaleReads, Concerns\MarksAsNotSupported; /** diff --git a/src/Schema/Blueprint.php b/src/Schema/Blueprint.php index f286568c..a0d47236 100644 --- a/src/Schema/Blueprint.php +++ b/src/Schema/Blueprint.php @@ -21,6 +21,7 @@ use Illuminate\Database\Schema\Blueprint as BaseBlueprint; use Illuminate\Database\Schema\ColumnDefinition; use Illuminate\Support\Fluent; +use LogicException; /** * @method IndexDefinition index(string|string[] $columns, string|null $name = null) @@ -219,8 +220,7 @@ public function timestampArray($column) */ public function interleave(string $parentTableName) { - trigger_deprecation('colopl/laravel-spanner', '5.2', 'Blueprint::interleave() is deprecated. Use interleaveInParent() instead. This method will be removed in v7.'); - return $this->interleaveInParent($parentTableName); + throw new LogicException('This method is not longer valid. Use interleaveInParent() instead.'); } /** diff --git a/src/Schema/IndexDefinition.php b/src/Schema/IndexDefinition.php index 84a552b7..2b4af71e 100755 --- a/src/Schema/IndexDefinition.php +++ b/src/Schema/IndexDefinition.php @@ -3,6 +3,7 @@ namespace Colopl\Spanner\Schema; use Illuminate\Support\Fluent; +use LogicException; /** * @method $this interleaveIn(string $table) @@ -19,7 +20,6 @@ class IndexDefinition extends Fluent */ public function interleave(string $table) { - trigger_deprecation('colopl/laravel-spanner', '5.2', 'Blueprint::interleave() is deprecated. Use interleaveIn() instead. This method will be removed in v7.'); - return $this->interleaveIn($table); + throw new LogicException('This method is not longer valid. Use interleaveIn() instead.'); } }