| Conditions | 1 |
| Paths | 1 |
| Total Lines | 105 |
| Code Lines | 74 |
| 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 |
||
| 57 | private function getPropertyData(): array |
||
| 58 | { |
||
| 59 | return [ |
||
| 60 | /* |
||
| 61 | $propertyData = [$author, $dealType, $category, $bedrooms, $guests, $city, |
||
| 62 | $district $neighborhood, $metro, $title, $address, |
||
| 63 | $latitude, $longitude, $price, $priceType]; |
||
| 64 | */ |
||
| 65 | [ |
||
| 66 | $this->getReference('admin'), |
||
| 67 | $this->getReference('Sale'), |
||
| 68 | $this->getReference('Villa'), |
||
| 69 | 5, |
||
| 70 | null, |
||
| 71 | $this->getReference('Tampa'), |
||
| 72 | $this->getReference('South Tampa'), |
||
| 73 | $this->getReference('Culbreath Isles'), |
||
| 74 | null, |
||
| 75 | 'Beautiful villa for sale in Tampa', |
||
| 76 | '4935 New Providence Ave, Tampa, FL', |
||
| 77 | '27.932255', '-82.533187', 1600, 'sq. foot', |
||
| 78 | ], |
||
| 79 | [ |
||
| 80 | $this->getReference('admin'), |
||
| 81 | $this->getReference('Rent'), |
||
| 82 | $this->getReference('Penthouse'), |
||
| 83 | 2, |
||
| 84 | 5, |
||
| 85 | $this->getReference('Palm Beach'), |
||
| 86 | null, |
||
| 87 | null, |
||
| 88 | null, |
||
| 89 | 'Stylish two-level penthouse in Palm Beach', |
||
| 90 | '101 Worth Ave, Palm Beach, FL 33480', |
||
| 91 | '26.701320', '-80.033688', 2000, 'mo', |
||
| 92 | ], |
||
| 93 | [ |
||
| 94 | $this->getReference('admin'), |
||
| 95 | $this->getReference('Rent'), |
||
| 96 | $this->getReference('Apartment'), |
||
| 97 | null, |
||
| 98 | 4, |
||
| 99 | $this->getReference('Miami'), |
||
| 100 | null, |
||
| 101 | $this->getReference('South Beach'), |
||
| 102 | null, |
||
| 103 | 'Bright and Cheerful alcove studio', |
||
| 104 | '1451 Ocean Dr, Miami Beach, FL 33139', |
||
| 105 | '25.785107', '-80.129460', 200, 'day', |
||
| 106 | ], |
||
| 107 | [ |
||
| 108 | $this->getReference('admin'), |
||
| 109 | $this->getReference('Rent'), |
||
| 110 | $this->getReference('Apartment'), |
||
| 111 | 1, |
||
| 112 | 2, |
||
| 113 | $this->getReference('Miami'), |
||
| 114 | null, |
||
| 115 | $this->getReference('South Beach'), |
||
| 116 | null, |
||
| 117 | 'Modern one-bedroom apartment in Miami', |
||
| 118 | '1451 Ocean Dr, Miami Beach, FL 33139', |
||
| 119 | '25.785107', '-80.129460', 250, 'day', |
||
| 120 | ], |
||
| 121 | [ |
||
| 122 | $this->getReference('admin'), |
||
| 123 | $this->getReference('Rent'), |
||
| 124 | $this->getReference('Apartment'), |
||
| 125 | 1, |
||
| 126 | 3, |
||
| 127 | $this->getReference('Palm Beach'), |
||
| 128 | null, |
||
| 129 | null, |
||
| 130 | null, |
||
| 131 | 'Bright fully furnished 1-bedroom flat on the 2nd floor', |
||
| 132 | '300 S Ocean Blvd, Palm Beach, FL', |
||
| 133 | '26.705007', '-80.033574', 180, 'day', |
||
| 134 | ], |
||
| 135 | [ |
||
| 136 | $this->getReference('user'), |
||
| 137 | $this->getReference('Sale'), |
||
| 138 | $this->getReference('Apartment'), |
||
| 139 | 2, |
||
| 140 | null, |
||
| 141 | $this->getReference('Miami'), |
||
| 142 | null, |
||
| 143 | $this->getReference('Downtown'), |
||
| 144 | $this->getReference('Government Center'), |
||
| 145 | 'Interesting two-bedroom apartment for sale', |
||
| 146 | '111 NE 2nd Ave, Miami, FL 33132', |
||
| 147 | '25.775565', '-80.190125', 190000, '', |
||
| 148 | ], |
||
| 149 | [ |
||
| 150 | $this->getReference('user'), |
||
| 151 | $this->getReference('Rent'), |
||
| 152 | $this->getReference('Apartment'), |
||
| 153 | 2, |
||
| 154 | 6, |
||
| 155 | $this->getReference('Tampa'), |
||
| 156 | null, |
||
| 157 | $this->getReference('Ballast Point'), |
||
| 158 | null, |
||
| 159 | 'Furnished renovated 2-bedroom 2-bathroom flat', |
||
| 160 | '5411 Bayshore Blvd, Tampa, FL 33611', |
||
| 161 | '27.885095', '-82.486153', 2200, 'mo', |
||
| 162 | ], |
||
| 204 |