FormatAsCamel   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 2
c 1
b 0
f 0
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A accessor_format() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of the ICanBoogie package.
5
 *
6
 * (c) Olivier Laviale <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ICanBoogie\Accessor;
13
14
use function ucfirst;
15
16
/**
17
 * Formats accessor method using CamelCase.
18
 */
19
trait FormatAsCamel
20
{
21
    public static function accessor_format(
22
        string $property,
23
        string $type,
24
        string $lazy = HasAccessor::ACCESSOR_IS_NOT_LAZY
25
    ): string {
26
        $format = $type . ucfirst($property);
27
28
        return $lazy ? $lazy . ucfirst($format) : $format;
29
    }
30
}
31