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

ArrayTransformer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 17
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A canTransform() 0 4 1
A transform() 0 4 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