Test Setup Failed
Push — master ( c6c066...1fbdb5 )
by Steve
02:02 queued 11s
created

CanSingularize::singularize()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
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