diff --git a/src/PersistenceStrategy/PostgresAggregateStreamStrategy.php b/src/PersistenceStrategy/PostgresAggregateStreamStrategy.php index f222edad..c8482ceb 100644 --- a/src/PersistenceStrategy/PostgresAggregateStreamStrategy.php +++ b/src/PersistenceStrategy/PostgresAggregateStreamStrategy.php @@ -57,7 +57,7 @@ public function createSchema(string $tableName): array ); EOT; - return array_merge($this->getSchemaCreationSchema($tableName), [ + return \array_merge($this->getSchemaCreationSchema($tableName), [ $statement, "CREATE UNIQUE INDEX on $tableName ((metadata->>'_aggregate_version'));", ]); @@ -109,13 +109,13 @@ public function generateTableName(StreamName $streamName): string return $table; } - private function getSchemaCreationSchema(string $tableName) : array + private function getSchemaCreationSchema(string $tableName): array { - if (!$schemaName = $this->extractSchema($tableName)) { + if (! $schemaName = $this->extractSchema($tableName)) { return []; } - return [sprintf( + return [\sprintf( 'CREATE SCHEMA IF NOT EXISTS %s', $schemaName )]; diff --git a/src/PersistenceStrategy/PostgresSimpleStreamStrategy.php b/src/PersistenceStrategy/PostgresSimpleStreamStrategy.php index 071be2fb..cacc6eb2 100644 --- a/src/PersistenceStrategy/PostgresSimpleStreamStrategy.php +++ b/src/PersistenceStrategy/PostgresSimpleStreamStrategy.php @@ -56,7 +56,7 @@ public function createSchema(string $tableName): array ); EOT; - return array_merge($this->getSchemaCreationSchema($tableName), [ + return \array_merge($this->getSchemaCreationSchema($tableName), [ $statement, ]); } @@ -101,13 +101,13 @@ public function generateTableName(StreamName $streamName): string return $table; } - private function getSchemaCreationSchema(string $tableName) : array + private function getSchemaCreationSchema(string $tableName): array { - if (!$schemaName = $this->extractSchema($tableName)) { + if (! $schemaName = $this->extractSchema($tableName)) { return []; } - return [sprintf( + return [\sprintf( 'CREATE SCHEMA IF NOT EXISTS %s', $schemaName )]; diff --git a/src/PersistenceStrategy/PostgresSingleStreamStrategy.php b/src/PersistenceStrategy/PostgresSingleStreamStrategy.php index 227edae4..51790f52 100644 --- a/src/PersistenceStrategy/PostgresSingleStreamStrategy.php +++ b/src/PersistenceStrategy/PostgresSingleStreamStrategy.php @@ -69,7 +69,7 @@ public function createSchema(string $tableName): array ((metadata->>'_aggregate_type'), (metadata->>'_aggregate_id'), no); EOT; - return array_merge($this->getSchemaCreationSchema($tableName), [ + return \array_merge($this->getSchemaCreationSchema($tableName), [ $statement, $index1, $index2, @@ -116,13 +116,13 @@ public function generateTableName(StreamName $streamName): string return $table; } - private function getSchemaCreationSchema(string $tableName) : array + private function getSchemaCreationSchema(string $tableName): array { - if (!$schemaName = $this->extractSchema($tableName)) { + if (! $schemaName = $this->extractSchema($tableName)) { return []; } - return [sprintf( + return [\sprintf( 'CREATE SCHEMA IF NOT EXISTS %s', $schemaName )];