Passed
Push — main ( 9ad958...bccbba )
by Andrey
72:16 queued 69:33
created

Action::loggableMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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 15
    protected function text(string $value, bool $as_title = false): string
14
    {
15 15
        $this->log($this->loggableMessage(), __FUNCTION__, $as_title);
16
17 15
        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 15
    protected function loggableMessage(): string
21
    {
22 15
        return 'Convert text to TitleCase for';
23
    }
24
}
25