| Conditions | 1 |
| Paths | 1 |
| Total Lines | 101 |
| Code Lines | 80 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| 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 |
||
| 13 | public function run() |
||
| 14 | { |
||
| 15 | // Test Customers |
||
| 16 | Customers::create([ |
||
| 17 | 'cust_id' => '2365', |
||
| 18 | 'name' => 'Office of Chiropractors', |
||
| 19 | 'dba_name' => '', |
||
| 20 | 'address' => '1113 Lindale Ave', |
||
| 21 | 'city' => 'Fremont', |
||
| 22 | 'state' => 'CA', |
||
| 23 | 'zip' => '94536' |
||
| 24 | ]); |
||
| 25 | |||
| 26 | Customers::create([ |
||
| 27 | 'cust_id' => '2387', |
||
| 28 | 'name' => 'Computer Training', |
||
| 29 | 'dba_name' => 'CTI', |
||
| 30 | 'address' => '4375 Riverwood Dr', |
||
| 31 | 'city' => 'Sacramento', |
||
| 32 | 'state' => 'CA', |
||
| 33 | 'zip' => '95814' |
||
| 34 | ]); |
||
| 35 | |||
| 36 | Customers::create([ |
||
| 37 | 'cust_id' => '8548', |
||
| 38 | 'name' => 'Ship and Boat Building', |
||
| 39 | 'dba_name' => '', |
||
| 40 | 'address' => '449 Francis Mine', |
||
| 41 | 'city' => 'Chico', |
||
| 42 | 'state' => 'CA', |
||
| 43 | 'zip' => '95926' |
||
| 44 | ]); |
||
| 45 | |||
| 46 | Customers::create([ |
||
| 47 | 'cust_id' => '6325', |
||
| 48 | 'name' => 'Abrasive Product Manufacturing', |
||
| 49 | 'dba_name' => 'APM', |
||
| 50 | 'address' => '2064 Koontz Ln', |
||
| 51 | 'city' => 'Northridge', |
||
| 52 | 'state' => 'CA', |
||
| 53 | 'zip' => '91324' |
||
| 54 | ]); |
||
| 55 | |||
| 56 | Customers::create([ |
||
| 57 | 'cust_id' => '7822', |
||
| 58 | 'name' => 'All Other Foods Manufacturing', |
||
| 59 | 'dba_name' => '', |
||
| 60 | 'address' => '4701 Park Ave', |
||
| 61 | 'city' => 'Sacramento', |
||
| 62 | 'state' => 'CA', |
||
| 63 | 'zip' => '95814' |
||
| 64 | ]); |
||
| 65 | |||
| 66 | Customers::create([ |
||
| 67 | 'cust_id' => '6598', |
||
| 68 | 'name' => 'Sew Apparel Manufacturing', |
||
| 69 | 'dba_name' => '', |
||
| 70 | 'address' => '4148 Creekside Lane', |
||
| 71 | 'city' => 'Ventura', |
||
| 72 | 'state' => 'CA', |
||
| 73 | 'zip' => '93001' |
||
| 74 | ]); |
||
| 75 | |||
| 76 | Customers::create([ |
||
| 77 | 'cust_id' => '4128', |
||
| 78 | 'name' => 'Financial Investment Activities', |
||
| 79 | 'dba_name' => '', |
||
| 80 | 'address' => '1900 Park St', |
||
| 81 | 'city' => 'Oakland', |
||
| 82 | 'state' => 'CA', |
||
| 83 | 'zip' => '94612' |
||
| 84 | ]); |
||
| 85 | |||
| 86 | Customers::create([ |
||
| 87 | 'cust_id' => '7821', |
||
| 88 | 'name' => 'Meat Markets', |
||
| 89 | 'dba_name' => 'MM Industries', |
||
| 90 | 'address' => '3929 Paradise Lane', |
||
| 91 | 'city' => 'Riverside', |
||
| 92 | 'state' => 'CA', |
||
| 93 | 'zip' => '92501' |
||
| 94 | ]); |
||
| 95 | |||
| 96 | Customers::create([ |
||
| 97 | 'cust_id' => '6970', |
||
| 98 | 'name' => 'Theater Companies and Dinner Theaters', |
||
| 99 | 'dba_name' => '', |
||
| 100 | 'address' => '1985 Ford St', |
||
| 101 | 'city' => 'San Jose', |
||
| 102 | 'state' => 'CA', |
||
| 103 | 'zip' => '95131' |
||
| 104 | ]); |
||
| 105 | |||
| 106 | Customers::create([ |
||
| 107 | 'cust_id' => '1593', |
||
| 108 | 'name' => 'Emergency Relief Services', |
||
| 109 | 'dba_name' => 'ERS International', |
||
| 110 | 'address' => '4114 Hamill Ave', |
||
| 111 | 'city' => 'San Diego', |
||
| 112 | 'state' => 'CA', |
||
| 113 | 'zip' => '92111' |
||
| 114 | ]); |
||
| 117 |