Completed
Branch master (1fbdb5)
by Steve
01:52
created

CanSingularize   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A singularize() 0 8 2
1
<?php
2
3
namespace StoutLogic\AcfBuilder\Traits;
4
5
trait CanSingularize
6
{
7
    /**
8
     * Return a singularized string.
9
     * @param  string $value
10
     * @return string
11
     */
12
    protected function singularize($value)
13
    {
14
        if (class_exists('\Doctrine\Inflector\InflectorFactory')) {
15
            return \Doctrine\Inflector\InflectorFactory::create()->build()->singularize($value);
16
        }
17
18
        return \Doctrine\Common\Inflector\Inflector::singularize($value);
19
    }
20
}
21