Code Duplication    Length = 7-8 lines in 5 locations

source/Spiral/Database/Drivers/Postgres/PostgresDriver.php 1 location

@@ 133-139 (lines=7) @@
130
     *
131
     * Postgres uses custom insert query builder in order to return value of inserted row.
132
     */
133
    public function insertBuilder(string $prefix, array $parameters = []): InsertQuery
134
    {
135
        return $this->factory->make(
136
            InsertQuery::class,
137
            ['driver' => $this, 'compiler' => $this->queryCompiler($prefix),] + $parameters
138
        );
139
    }
140
141
    /**
142
     * {@inheritdoc}

source/Spiral/Database/Entities/Driver.php 4 locations

@@ 197-203 (lines=7) @@
194
     *
195
     * @return InsertQuery
196
     */
197
    public function insertBuilder(string $prefix, array $parameters = []): InsertQuery
198
    {
199
        return $this->factory->make(
200
            InsertQuery::class,
201
            ['driver' => $this, 'compiler' => $this->queryCompiler($prefix)] + $parameters
202
        );
203
    }
204
205
    /**
206
     * Get SelectQuery builder with driver specific query compiler.
@@ 214-220 (lines=7) @@
211
     *
212
     * @return SelectQuery
213
     */
214
    public function selectBuilder(string $prefix, array $parameters = []): SelectQuery
215
    {
216
        return $this->factory->make(
217
            SelectQuery::class,
218
            ['driver' => $this, 'compiler' => $this->queryCompiler($prefix)] + $parameters
219
        );
220
    }
221
222
    /**
223
     * Get DeleteQuery builder with driver specific query compiler.
@@ 231-238 (lines=8) @@
228
     *
229
     * @return DeleteQuery
230
     */
231
    public function deleteBuilder(string $prefix, array $parameters = []): DeleteQuery
232
    {
233
234
        return $this->factory->make(
235
            DeleteQuery::class,
236
            ['driver' => $this, 'compiler' => $this->queryCompiler($prefix)] + $parameters
237
        );
238
    }
239
240
    /**
241
     * Get UpdateQuery builder with driver specific query compiler.
@@ 249-255 (lines=7) @@
246
     *
247
     * @return UpdateQuery
248
     */
249
    public function updateBuilder(string $prefix, array $parameters = []): UpdateQuery
250
    {
251
        return $this->factory->make(
252
            UpdateQuery::class,
253
            ['driver' => $this, 'compiler' => $this->queryCompiler($prefix)] + $parameters
254
        );
255
    }
256
}
257