Conditions | 1 |
Paths | 1 |
Total Lines | 246 |
Code Lines | 244 |
Lines | 0 |
Ratio | 0 % |
Changes | 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 |
||
14 | protected function defaults(): array |
||
15 | { |
||
16 | return [ |
||
17 | 'AccountingService', |
||
18 | 'AdultEntertainment', |
||
19 | 'Airline', |
||
20 | 'AmpStory', |
||
21 | 'AmusementPark', |
||
22 | 'AnimalShelter', |
||
23 | 'ArchiveOrganization', |
||
24 | 'ArtGallery', |
||
25 | 'Attorney', |
||
26 | 'Audiobook', |
||
27 | 'AudioObject', |
||
28 | 'AudioObjectSnapshot', |
||
29 | 'AutoBodyShop', |
||
30 | 'AutoDealer', |
||
31 | 'AutomatedTeller', |
||
32 | 'AutomotiveBusiness', |
||
33 | 'AutoPartsStore', |
||
34 | 'AutoRental', |
||
35 | 'AutoRepair', |
||
36 | 'AutoWash', |
||
37 | 'Bakery', |
||
38 | 'BankOrCreditUnion', |
||
39 | 'Barcode', |
||
40 | 'BarOrPub', |
||
41 | 'BeautySalon', |
||
42 | 'BedAndBreakfast', |
||
43 | 'BikeStore', |
||
44 | 'Book', |
||
45 | 'BookSeries', |
||
46 | 'BookStore', |
||
47 | 'BowlingAlley', |
||
48 | 'Brewery', |
||
49 | 'BroadcastEvent', |
||
50 | 'BusinessEvent', |
||
51 | 'BusOrCoach', |
||
52 | 'CafeOrCoffeeShop', |
||
53 | 'Campground', |
||
54 | 'Car', |
||
55 | 'Casino', |
||
56 | 'ChildCare', |
||
57 | 'ChildrensEvent', |
||
58 | 'ClothingStore', |
||
59 | 'CollegeOrUniversity', |
||
60 | 'ComedyClub', |
||
61 | 'ComedyEvent', |
||
62 | 'ComicSeries', |
||
63 | 'ComputerStore', |
||
64 | 'Consortium', |
||
65 | 'ConvenienceStore', |
||
66 | 'Corporation', |
||
67 | 'Course', |
||
68 | 'CourseInstance', |
||
69 | 'CovidTestingFacility', |
||
70 | 'CreativeWorkSeason', |
||
71 | 'CreativeWorkSeries', |
||
72 | 'DanceEvent', |
||
73 | 'DanceGroup', |
||
74 | 'DataDownload', |
||
75 | 'DaySpa', |
||
76 | 'DeliveryEvent', |
||
77 | 'Dentist', |
||
78 | 'DepartmentStore', |
||
79 | 'DiagnosticLab', |
||
80 | 'DietarySupplement', |
||
81 | 'Distillery', |
||
82 | 'Drug', |
||
83 | 'DryCleaningOrLaundry', |
||
84 | 'EducationalOrganization', |
||
85 | 'EducationEvent', |
||
86 | 'Electrician', |
||
87 | 'ElectronicsStore', |
||
88 | 'ElementarySchool', |
||
89 | 'EmergencyService', |
||
90 | 'EmploymentAgency', |
||
91 | 'EntertainmentBusiness', |
||
92 | 'Episode', |
||
93 | 'Event', |
||
94 | 'EventSeries', |
||
95 | 'ExerciseGym', |
||
96 | 'ExhibitionEvent', |
||
97 | 'FastFoodRestaurant', |
||
98 | 'Festival', |
||
99 | 'FinancialService', |
||
100 | 'FireStation', |
||
101 | 'Florist', |
||
102 | 'FoodEstablishment', |
||
103 | 'FoodEvent', |
||
104 | 'FundingAgency', |
||
105 | 'FundingScheme', |
||
106 | 'FurnitureStore', |
||
107 | 'Game', |
||
108 | 'GardenStore', |
||
109 | 'GasStation', |
||
110 | 'GeneralContractor', |
||
111 | 'GolfCourse', |
||
112 | 'GovernmentOffice', |
||
113 | 'GovernmentOrganization', |
||
114 | 'GroceryStore', |
||
115 | 'Hackathon', |
||
116 | 'HairSalon', |
||
117 | 'HardwareStore', |
||
118 | 'HealthAndBeautyBusiness', |
||
119 | 'HealthClub', |
||
120 | 'HighSchool', |
||
121 | 'HobbyShop', |
||
122 | 'HomeAndConstructionBusiness', |
||
123 | 'HomeGoodsStore', |
||
124 | 'Hospital', |
||
125 | 'Hostel', |
||
126 | 'Hotel', |
||
127 | 'HousePainter', |
||
128 | 'HowTo', |
||
129 | 'HVACBusiness', |
||
130 | 'IceCreamShop', |
||
131 | 'ImageObject', |
||
132 | 'ImageObjectSnapshot', |
||
133 | 'IndividualProduct', |
||
134 | 'InsuranceAgency', |
||
135 | 'InternetCafe', |
||
136 | 'JewelryStore', |
||
137 | 'LegalService', |
||
138 | 'LegislationObject', |
||
139 | 'Library', |
||
140 | 'LibrarySystem', |
||
141 | 'LiquorStore', |
||
142 | 'LiteraryEvent', |
||
143 | 'LocalBusiness', |
||
144 | 'Locksmith', |
||
145 | 'LodgingBusiness', |
||
146 | 'MediaObject', |
||
147 | 'MedicalBusiness', |
||
148 | 'MedicalClinic', |
||
149 | 'MedicalOrganization', |
||
150 | 'MensClothingStore', |
||
151 | 'MiddleSchool', |
||
152 | 'MobileApplication', |
||
153 | 'MobilePhoneStore', |
||
154 | 'Motel', |
||
155 | 'Motorcycle', |
||
156 | 'MotorcycleDealer', |
||
157 | 'MotorcycleRepair', |
||
158 | 'MotorizedBicycle', |
||
159 | 'Movie', |
||
160 | 'MovieRentalStore', |
||
161 | 'MovieSeries', |
||
162 | 'MovieTheater', |
||
163 | 'MovingCompany', |
||
164 | 'MusicAlbum', |
||
165 | 'MusicEvent', |
||
166 | 'MusicGroup', |
||
167 | 'MusicPlaylist', |
||
168 | 'MusicRecording', |
||
169 | 'MusicRelease', |
||
170 | 'MusicStore', |
||
171 | 'MusicVideoObject', |
||
172 | 'NailSalon', |
||
173 | 'NewsMediaOrganization', |
||
174 | 'Newspaper', |
||
175 | 'NGO', |
||
176 | 'NightClub', |
||
177 | 'Notary', |
||
178 | 'OfficeEquipmentStore', |
||
179 | 'OnDemandEvent', |
||
180 | 'OnlineBusiness', |
||
181 | 'OnlineStore', |
||
182 | 'Optician', |
||
183 | 'Organization', |
||
184 | 'OutletStore', |
||
185 | 'PawnShop', |
||
186 | 'PerformingGroup', |
||
187 | 'Periodical', |
||
188 | 'PetStore', |
||
189 | 'Pharmacy', |
||
190 | 'Physician', |
||
191 | 'Plumber', |
||
192 | 'PodcastEpisode', |
||
193 | 'PodcastSeason', |
||
194 | 'PodcastSeries', |
||
195 | 'PoliceStation', |
||
196 | 'PostOffice', |
||
197 | 'Preschool', |
||
198 | 'Product', |
||
199 | 'ProductCollection', |
||
200 | 'ProductGroup', |
||
201 | 'ProductModel', |
||
202 | 'ProfessionalService', |
||
203 | 'Project', |
||
204 | 'PublicationEvent', |
||
205 | 'PublicSwimmingPool', |
||
206 | 'RadioEpisode', |
||
207 | 'RadioSeason', |
||
208 | 'RadioSeries', |
||
209 | 'RadioStation', |
||
210 | 'RealEstateAgent', |
||
211 | 'Recipe', |
||
212 | 'RecyclingCenter', |
||
213 | 'ResearchOrganization', |
||
214 | 'ResearchProject', |
||
215 | 'Resort', |
||
216 | 'Restaurant', |
||
217 | 'RoofingContractor', |
||
218 | 'SaleEvent', |
||
219 | 'School', |
||
220 | 'ScreeningEvent', |
||
221 | 'SearchRescueOrganization', |
||
222 | 'SelfStorage', |
||
223 | 'ShoeStore', |
||
224 | 'ShoppingCenter', |
||
225 | 'SkiResort', |
||
226 | 'SocialEvent', |
||
227 | 'SoftwareApplication', |
||
228 | 'SportingGoodsStore', |
||
229 | 'SportsActivityLocation', |
||
230 | 'SportsClub', |
||
231 | 'SportsEvent', |
||
232 | 'SportsOrganization', |
||
233 | 'SportsTeam', |
||
234 | 'StadiumOrArena', |
||
235 | 'Store', |
||
236 | 'TattooParlor', |
||
237 | 'TelevisionStation', |
||
238 | 'TennisComplex', |
||
239 | 'TheaterEvent', |
||
240 | 'TheaterGroup', |
||
241 | 'ThreeDimensionalModel', |
||
242 | 'TireShop', |
||
243 | 'TouristInformationCenter', |
||
244 | 'ToyStore', |
||
245 | 'TravelAgency', |
||
246 | 'TVEpisode', |
||
247 | 'TVSeason', |
||
248 | 'TVSeries', |
||
249 | 'Vehicle', |
||
250 | 'VeterinaryCare', |
||
251 | 'VideoGame', |
||
252 | 'VideoGameSeries', |
||
253 | 'VideoObject', |
||
254 | 'VideoObjectSnapshot', |
||
255 | 'VisualArtsEvent', |
||
256 | 'WebApplication', |
||
257 | 'WholesaleStore', |
||
258 | 'Winery', |
||
259 | 'WorkersUnion', |
||
260 | ]; |
||
263 |