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

Action   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 9
ccs 3
cts 3
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A text() 0 5 2
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