Completed
Push — master ( 8c67c8...0fdee2 )
by Freek
01:59
created

ArrayTransformer::transform()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Spatie\BladeJavaScript\Transformers;
4
5
class ArrayTransformer  implements Transformer
0 ignored issues
show
Coding Style introduced by
Expected 1 space after class name; 2 found
Loading history...
Coding Style introduced by
Expected 1 space before implements keyword; 2 found
Loading history...
6
{
7
    public function canTransform($value): bool
8
    {
9
        return is_array($value);
10
    }
11
12
    /**
13
     * @param $value
14
     *
15
     * @return string
16
     */
17
    public function transform($value): string
18
    {
19
        return json_encode($value);
20
    }
21
}
22