Passed
Push — master ( fe8da9...4bb742 )
by Saulius
02:35
created

strtr()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 2
dl 0
loc 7
ccs 3
cts 3
cp 1
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the sauls/helpers package.
4
 *
5
 * @author    Saulius Vaičeliūnas <[email protected]>
6
 * @link      http://saulius.vaiceliunas.lt
7
 * @copyright 2018
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Sauls\Component\Helper;
14
15
use Sauls\Component\Helper\Operation\Factory\OperationFactory;
16
use Sauls\Component\Helper\Operation\StringOperation;
17
18
/**
19
 * @throws \Exception
20
 */
21
function string_camelize(string $value): string
22
{
23 5
    return OperationFactory::create(StringOperation\Camelize::class)->execute($value);
0 ignored issues
show
Bug introduced by
The method execute() does not exist on Sauls\Component\Helper\Operation\Operation. Since it exists in all sub-types, consider adding an abstract or default implementation to Sauls\Component\Helper\Operation\Operation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
    return OperationFactory::create(StringOperation\Camelize::class)->/** @scrutinizer ignore-call */ execute($value);
Loading history...
24
}
25
26
/**
27
 * @throws \Exception
28
 */
29
function string_snakeify(string $value): string
30
{
31 3
    return OperationFactory::create(StringOperation\Snakeify::class)->execute($value);
32
}
33
34
/**
35
 * @throws \Exception
36
 */
37
function explode_using_multi_delimiters(array $delimiters = ['.'], string $value): array
38
{
39 1
    return OperationFactory::create(StringOperation\ExplodeWithMultiDelimiters::class)->execute($delimiters, $value);
40
}
41
42
/**
43
 * @throws \Exception
44
 */
45
function base64_url_encode(string $value): string
46
{
47 1
    return OperationFactory::create(StringOperation\Base64UrlEncode::class)->execute($value);
48
}
49
50
/**
51
 * @throws \Exception
52
 */
53
function base64_url_decode(string $value): string
54
{
55 1
    return OperationFactory::create(StringOperation\Base64Decode::class)->execute($value);
56
}
57
58
59