FormatAsSnake   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
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 8
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A accessor_format() 0 6 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
/**
15
 * Formats accessor method using snake case.
16
 */
17
trait FormatAsSnake
18
{
19
    public static function accessor_format(
20
        string $property,
21
        string $type,
22
        string $lazy = HasAccessor::ACCESSOR_IS_NOT_LAZY
23
    ): string {
24
        return ($lazy ? $lazy . '_' : '') . $type . '_' . $property;
25
    }
26
}
27