Conditions | 1 |
Paths | 1 |
Total Lines | 61 |
Code Lines | 30 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
11 | public function test_fires_make_service_command(): void |
||
12 | { |
||
13 | $this->artisan('make:service SampleService')->assertSuccessful(); |
||
14 | |||
15 | $this->artisan('make:service SampleService -f')->assertSuccessful(); |
||
16 | |||
17 | $this->artisan('make:request SampleRequest')->assertSuccessful(); |
||
18 | |||
19 | $this->artisan('make:service SampleService --request=SampleRequest -f')->assertSuccessful(); |
||
20 | |||
21 | $this->artisan('make:service SampleService --request=SampleRequest -e')->assertSuccessful(); |
||
22 | |||
23 | $this->artisan('make:service SampleService --request=SampleRequest -e -f')->assertSuccessful(); |
||
24 | |||
25 | $this->artisan('make:traitclass SampleTrait')->assertSuccessful(); |
||
26 | |||
27 | $this->artisan('make:traitclass SampleTrait -f')->assertSuccessful(); |
||
28 | |||
29 | $this->artisan('make:enumclass Sample')->assertSuccessful(); |
||
30 | |||
31 | $this->artisan('make:enumclass Sample -f')->assertSuccessful(); |
||
32 | |||
33 | $this->artisan('make:action Sample')->assertSuccessful(); |
||
34 | |||
35 | $this->artisan('make:action Sample -f')->assertSuccessful(); |
||
36 | |||
37 | $this->artisan('make:interfaceclass SampleInterface')->assertSuccessful(); |
||
38 | |||
39 | $this->artisan('make:interfaceclass SampleInterface -f')->assertSuccessful(); |
||
40 | |||
41 | $this->artisan('make:interfaceclass UserRepositoryInterface --model=User')->assertSuccessful(); |
||
42 | |||
43 | $this->artisan('make:interfaceclass UserRepositoryInterface --model=User -f')->assertSuccessful(); |
||
44 | |||
45 | $this->artisan('make:interfaceclass UserRepositoryInterface --model=User --user')->assertSuccessful(); |
||
46 | |||
47 | $this->artisan('make:interfaceclass UserRepositoryInterface --model=User --user -f')->assertSuccessful(); |
||
48 | |||
49 | $this->artisan('make:repository UserRepository --interface=UserRepositoryInterface --model=User')->assertSuccessful(); |
||
50 | |||
51 | $this->artisan('make:repository UserRepository --interface=UserRepositoryInterface --model=User -f')->assertSuccessful(); |
||
52 | |||
53 | $this->artisan('make:repository UserRepository --interface=UserRepositoryInterface --model=User --user')->assertSuccessful(); |
||
54 | |||
55 | $this->artisan('make:repository UserRepository --interface=UserRepositoryInterface --model=User --user -f')->assertSuccessful(); |
||
56 | |||
57 | $this->artisan('make:repository UserRepository --model=User -c')->assertSuccessful(); |
||
58 | |||
59 | $this->artisan('make:repository UserRepository --model=User -c -f')->assertSuccessful(); |
||
60 | |||
61 | $this->artisan('make:repository UserRepository --model=User --user -c')->assertSuccessful(); |
||
62 | |||
63 | $this->artisan('make:repository UserRepository --model=User --user -c -f')->assertSuccessful(); |
||
64 | |||
65 | $this->artisan('make:facade Sample')->assertSuccessful(); |
||
66 | |||
67 | $this->artisan('make:facade Sample -f')->assertSuccessful(); |
||
68 | |||
69 | $this->artisan('make:facade User --contract=UserRepositoryInterface')->assertSuccessful(); |
||
70 | |||
71 | $this->artisan('make:facade User --contract=UserRepositoryInterface -f')->assertSuccessful(); |
||
72 | } |
||
74 |