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

BooleanTransformer::canTransform()   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 BooleanTransformer implements Transformer
6
{
7
    public function canTransform($value): bool
8
    {
9
        return is_bool($value);
10
    }
11
12
    /**
13
     * @param bool $value
14
     *
15
     * @return string
16
     */
17
    public function transform($value)
18
    {
19
        return $value ? 'true' : 'false';
20
    }
21
}
22