Passed
Push — main ( 55f929...127e84 )
by Andrey
161:41 queued 158:10
created

Action::text()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 2
rs 10
1
<?php
2
3
namespace Helldar\LaravelLangPublisher\Support\Actions;
4
5
use Helldar\LaravelLangPublisher\Concerns\Logger;
6
use Helldar\LaravelLangPublisher\Contracts\Actionable;
7
use Helldar\Support\Facades\Helpers\Str;
8
9
abstract class Action implements Actionable
10
{
11
    use Logger;
0 ignored issues
show
Bug introduced by
The trait Helldar\LaravelLangPublisher\Concerns\Logger requires the property $output which is not provided by Helldar\LaravelLangPubli...\Support\Actions\Action.
Loading history...
12
13 13
    protected function text(string $value, bool $as_title = false): string
14
    {
15 13
        $this->log('Convert text to TitleCase: ' . $value . '.');
16
17 13
        return $as_title ? Str::title($value) : $value;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $as_title ? Helld...:title($value) : $value could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
18
    }
19
}
20