Passed
Push — next ( 9b6e37...94fdcd )
by Bas
06:54 queued 03:33
created

InteractsWithDatabase::assertSoftDeleted()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 25
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 17
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 13
c 1
b 0
f 0
nc 2
nop 4
dl 0
loc 25
ccs 17
cts 17
cp 1
crap 3
rs 9.8333
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LaravelFreelancerNL\Aranguent\Testing\Concerns;
6
7
use Illuminate\Support\Facades\DB;
8
9
trait InteractsWithDatabase
10
{
11
    /**
12
     * Cast a JSON string to a database compatible type.
13
     * Supported for backwards compatibility in existing projects.
14
     * No cast is necessary as json is a first class citizen in ArangoDB.
15
     *
16
     * @param  array<mixed>|object|string  $value
17
     * @return \Illuminate\Contracts\Database\Query\Expression
18
     */
19 1
    public function castAsJson($value)
20
    {
21 1
        return DB::raw($value);
22
    }
23
}
24