Passed
Push — master ( 1f7f34...948e88 )
by Thomas
04:12 queued 02:03
created

BackpackCrudRequestService::call()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 12
ccs 0
cts 9
cp 0
crap 2
rs 9.8666
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A BackpackCrudRequestService::buildFileContent() 0 6 1
A BackpackCrudRequestService::replaceValidationRules() 0 4 1
1
<?php
2
3
namespace Webfactor\Laravel\Generators\Services;
4
5
use Webfactor\Laravel\Generators\Contracts\SchemaFieldAbstract;
6
use Webfactor\Laravel\Generators\Contracts\ServiceAbstract;
7
use Webfactor\Laravel\Generators\Contracts\ServiceInterface;
8
use Webfactor\Laravel\Generators\Helper\ShortSyntaxArray;
9
use Webfactor\Laravel\Generators\Traits\CanGenerateFile;
10
11
class BackpackCrudRequestService extends ServiceAbstract implements ServiceInterface
12
{
13
    use CanGenerateFile;
14
15
    protected $key = 'crudRequest';
16
17
    protected function buildFileContent()
18
    {
19
        $this->replaceClassNamespace();
20
        $this->replaceClassName();
21
        $this->replaceValidationRules();
22
    }
23
24
    protected function replaceValidationRules()
25
    {
26
        $this->fileContent = str_replace('__rules__', ShortSyntaxArray::parse($this->command->schema->getValidationRules()->toArray()), $this->fileContent);
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 156 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
27
    }
28
}
29