Complex classes like LocalBusiness often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use LocalBusiness, and based on these observations, apply Extract Interface, too.
| 1 | <?php | ||
| 10 | class LocalBusiness extends AbstractModel implements \BOTK\ModelInterface | ||
| 11 | { | ||
| 12 | |||
| 13 | protected static $DEFAULT_OPTIONS = array ( | ||
| 14 | 'businessType' => array( | ||
| 15 | // additional types as extension of schema:LocalBusiness | ||
| 16 | 'filter' => FILTER_DEFAULT, | ||
| 17 | 'flags' => FILTER_FORCE_ARRAY | ||
| 18 | ), | ||
| 19 | 'taxID' => array( | ||
| 20 | 'filter' => FILTER_CALLBACK, | ||
| 21 | 'options' => '\BOTK\Filters::FILTER_SANITIZE_TOKEN', | ||
| 22 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 23 | ), | ||
| 24 | 'vatID' => array( // italian rules | ||
| 25 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 26 | 			'options' 	=> array('regexp'=>'/^[0-9]{11}$/'), | ||
| 27 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 28 | ), | ||
| 29 | 'legalName' => array( | ||
| 30 | 'filter' => FILTER_CALLBACK, | ||
| 31 | 'options' => '\BOTK\Filters::FILTER_SANITIZE_ADDRESS', | ||
| 32 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 33 | ), | ||
| 34 | 'businessName' => array( | ||
| 35 | // a schema:alternateName for schema:PostalAddress | ||
| 36 | 'filter' => FILTER_DEFAULT, | ||
| 37 | 'flags' => FILTER_FORCE_ARRAY | ||
| 38 | ), | ||
| 39 | 'addressDescription'=> array( // | ||
| 40 | 'filter' => FILTER_CALLBACK, | ||
| 41 | 'options' => '\BOTK\Filters::FILTER_SANITIZE_ADDRESS', | ||
| 42 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 43 | ), | ||
| 44 | 'addressCountry' => array( | ||
| 45 | 'default' => 'IT', | ||
| 46 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 47 | 			'options' 	=> array('regexp'=>'/^[A-Z]{2}$/'), | ||
| 48 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 49 | ), | ||
| 50 | 'addressLocality' => array( | ||
| 51 | 'filter' => FILTER_CALLBACK, | ||
| 52 | 'options' => '\BOTK\Filters::FILTER_SANITIZE_ADDRESS', | ||
| 53 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 54 | ), | ||
| 55 | 'addressRegion' => array( | ||
| 56 | 'filter' => FILTER_CALLBACK, | ||
| 57 | 'options' => '\BOTK\Filters::FILTER_SANITIZE_ADDRESS', | ||
| 58 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 59 | ), | ||
| 60 | 'streetAddress' => array( | ||
| 61 | 'filter' => FILTER_CALLBACK, | ||
| 62 | 'options' => '\BOTK\Filters::FILTER_SANITIZE_ADDRESS', | ||
| 63 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 64 | ), | ||
| 65 | 'postalCode' => array( // italian rules | ||
| 66 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 67 | 			'options' 	=> array('regexp'=>'/^[0-9]{5}$/'), | ||
| 68 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 69 | ), | ||
| 70 | 'telephone' => array( | ||
| 71 | 'filter' => FILTER_CALLBACK, | ||
| 72 | 'options' => '\BOTK\Filters::FILTER_SANITIZE_TELEPHONE', | ||
| 73 | 'flags' => FILTER_FORCE_ARRAY | ||
| 74 | ), | ||
| 75 | 'faxNumber' => array( | ||
| 76 | 'filter' => FILTER_CALLBACK, | ||
| 77 | 'options' => '\BOTK\Filters::FILTER_SANITIZE_TELEPHONE', | ||
| 78 | 'flags' => FILTER_FORCE_ARRAY | ||
| 79 | ), | ||
| 80 | 'email' => array( | ||
| 81 | 'filter' => FILTER_CALLBACK, | ||
| 82 | 'options' => '\BOTK\Filters::FILTER_SANITIZE_EMAIL', | ||
| 83 | 'flags' => FILTER_FORCE_ARRAY | ||
| 84 | ), | ||
| 85 | 'lat' => array( | ||
| 86 | 'filter' => FILTER_CALLBACK, | ||
| 87 | 'options' => '\BOTK\Filters::FILTER_SANITIZE_GEO' | ||
| 88 | ), | ||
| 89 | 'long' => array( | ||
| 90 | 'filter' => FILTER_CALLBACK, | ||
| 91 | 'options' => '\BOTK\Filters::FILTER_SANITIZE_GEO' | ||
| 92 | ), | ||
| 93 | 'similarStreet' => array( | ||
| 94 | 'filter' => FILTER_CALLBACK, | ||
| 95 | 'options' => '\BOTK\Filters::FILTER_VALIDATE_URI', | ||
| 96 | 'flags' => FILTER_FORCE_ARRAY | ||
| 97 | ), | ||
| 98 | 'hasMap' => array( | ||
| 99 | 'filter' => FILTER_CALLBACK, | ||
| 100 | 'options' => '\BOTK\Filters::FILTER_SANITIZE_HTTP_URL', | ||
| 101 | 'flags' => FILTER_FORCE_ARRAY | ||
| 102 | ), | ||
| 103 | 'aggregateRatingValue' => array( | ||
| 104 | 'filter' => FILTER_VALIDATE_FLOAT, | ||
| 105 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 106 | ), | ||
| 107 | 'openingHours' => array( | ||
| 108 | 'filter' => FILTER_DEFAULT, | ||
| 109 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 110 | ), | ||
| 111 | 'near' => array( | ||
| 112 | 'filter' => FILTER_CALLBACK, | ||
| 113 | 'options' => '\BOTK\Filters::FILTER_VALIDATE_URI', | ||
| 114 | 'flags' => FILTER_FORCE_ARRAY | ||
| 115 | ), | ||
| 116 | 'similarName' => array( | ||
| 117 | 'filter' => FILTER_CALLBACK, | ||
| 118 | 'options' => '\BOTK\Filters::FILTER_VALIDATE_URI', | ||
| 119 | 'flags' => FILTER_FORCE_ARRAY | ||
| 120 | ), | ||
| 121 | 'numberOfEmployees' => array( | ||
| 122 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 123 | 			'options' 	=> array('regexp'=>'/^[0-9]+\s*-?\s*[0-9]*$/'), | ||
| 124 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 125 | ), | ||
| 126 | 'annualTurnover' => array( | ||
| 127 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 128 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 129 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 130 | ), | ||
| 131 | 'ateco2007' => array( | ||
| 132 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 133 | 			'options' 	=> array('regexp'=>'/^[0-9]{6}$/'), | ||
| 134 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 135 | ), | ||
| 136 | 'ebitda' => array( | ||
| 137 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 138 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 139 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 140 | ), | ||
| 141 | 'netProfit' => array( | ||
| 142 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 143 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 144 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 145 | ), | ||
| 146 | |||
| 147 | 'naceV2' => array( | ||
| 148 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 149 | 			'options' 	=> array('regexp'=>'/^[0-9]{2}[.]?[0-9]{2}[.]?[0-9]{2}$/'), | ||
| 150 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 151 | ), | ||
| 152 | /*==========================================6.3.0==========================================*/ | ||
| 153 | 'isicV4' => array( | ||
| 154 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 155 | 			'options' 	=> array('regexp'=>'/^[0-9]{4}$/'), | ||
| 156 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 157 | ), | ||
| 158 | 'hasTotDevelopers' => array( | ||
| 159 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 160 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 161 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 162 | ), | ||
| 163 | 'parentOrganization' => array( | ||
| 164 | 'filter' => FILTER_CALLBACK, | ||
| 165 | 'options' => '\BOTK\Filters::FILTER_SANITIZE_ID', | ||
| 166 | 'flags' => FILTER_REQUIRE_SCALAR, | ||
| 167 | ), | ||
| 168 | /*==========================================6.3.0 range==========================================*/ | ||
| 169 | 'hasITEmployees' => array( | ||
| 170 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 171 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 172 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 173 | ), | ||
| 174 | 'hasNumberOfPCs' => array( | ||
| 175 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 176 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 177 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 178 | ), | ||
| 179 | 'hasITBudget' => array( | ||
| 180 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 181 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 182 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 183 | ), | ||
| 184 | 'hasTablets' => array( | ||
| 185 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 186 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 187 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 188 | ), | ||
| 189 | 'hasWorkstations' => array( | ||
| 190 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 191 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 192 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 193 | ), | ||
| 194 | 'hasStorageBudget' => array( | ||
| 195 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 196 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 197 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 198 | ), | ||
| 199 | 'hasServerBudget' => array( | ||
| 200 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 201 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 202 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 203 | ), | ||
| 204 | 'hasServers' => array( | ||
| 205 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 206 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 207 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 208 | ), | ||
| 209 | 'hasDesktop' => array( | ||
| 210 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 211 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 212 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 213 | ), | ||
| 214 | 'hasLaptops' => array( | ||
| 215 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 216 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 217 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 218 | ), | ||
| 219 | 'hasPrinters' => array( | ||
| 220 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 221 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 222 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 223 | ), | ||
| 224 | 'hasMultifunctionPrinters' => array( | ||
| 225 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 226 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 227 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 228 | ), | ||
| 229 | 'hasColorPrinter' => array( | ||
| 230 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 231 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 232 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 233 | ), | ||
| 234 | 'hasInternetUsers' => array( | ||
| 235 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 236 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 237 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 238 | ), | ||
| 239 | 'hasWirelessUsers' => array( | ||
| 240 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 241 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 242 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 243 | ), | ||
| 244 | 'hasNetworkLines' => array( | ||
| 245 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 246 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 247 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 248 | ), | ||
| 249 | 'hasRouters' => array( | ||
| 250 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 251 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 252 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 253 | ), | ||
| 254 | 'hasStorageCapacity' => array( | ||
| 255 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 256 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 257 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 258 | ), | ||
| 259 | 'hasExtensions' => array( | ||
| 260 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 261 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 262 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 263 | ), | ||
| 264 | 'hasTotCallCenterCallers' => array( | ||
| 265 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 266 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 267 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 268 | ), | ||
| 269 | 'hasThinPC' => array( | ||
| 270 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 271 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 272 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 273 | ), | ||
| 274 | 'hasSalesforce' => array( | ||
| 275 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 276 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 277 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 278 | ), | ||
| 279 | 'hasRevenue' => array( | ||
| 280 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 281 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 282 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 283 | ), | ||
| 284 | 'hasCommercialBudget' => array( | ||
| 285 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 286 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 287 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 288 | ), | ||
| 289 | 'hasHardwareBudget' => array( | ||
| 290 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 291 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 292 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 293 | ), | ||
| 294 | 'hasSoftwareBudget' => array( | ||
| 295 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 296 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 297 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 298 | ), | ||
| 299 | 'hasOutsrcingBudget' => array( | ||
| 300 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 301 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 302 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 303 | ), | ||
| 304 | 'hasOtherHardwareBudget' => array( | ||
| 305 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 306 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 307 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 308 | ), | ||
| 309 | 'hasPCBudget' => array( | ||
| 310 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 311 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 312 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 313 | ), | ||
| 314 | 'hasPrinterBudget' => array( | ||
| 315 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 316 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 317 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 318 | ), | ||
| 319 | 'hasTerminalBudget' => array( | ||
| 320 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 321 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 322 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 323 | ), | ||
| 324 | 'hasPeripheralBudget' => array( | ||
| 325 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 326 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 327 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 328 | ), | ||
| 329 | 'hasDesktopPrinters' => array( | ||
| 330 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 331 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 332 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 333 | ), | ||
| 334 | 'hasNetworkPrinters' => array( | ||
| 335 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 336 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 337 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 338 | ), | ||
| 339 | 'hasSmartphoneUsers' => array( | ||
| 340 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 341 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 342 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 343 | ), | ||
| 344 | 'hasEnterpriseSmartphoneUsers' => array( | ||
| 345 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 346 | 			'options' 	=> array('regexp'=>'/^-?[0-9]+\s*-?\s*-?[0-9]*$/'), | ||
| 347 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 348 | ), | ||
| 349 | /*=======================================6.3.0 string=======================================*/ | ||
| 350 | 'hasServerManufacturer' => array( | ||
| 351 | 'filter' => FILTER_DEFAULT, | ||
| 352 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 353 | ), | ||
| 354 | 'hasServerVirtualizationManufacturer' => array( | ||
| 355 | 'filter' => FILTER_DEFAULT, | ||
| 356 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 357 | ), | ||
| 358 | 'hasDASManufacturer' => array( | ||
| 359 | 'filter' => FILTER_DEFAULT, | ||
| 360 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 361 | ), | ||
| 362 | 'hasNASManufacturer' => array( | ||
| 363 | 'filter' => FILTER_DEFAULT, | ||
| 364 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 365 | ), | ||
| 366 | 'hasSANManufacturer' => array( | ||
| 367 | 'filter' => FILTER_DEFAULT, | ||
| 368 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 369 | ), | ||
| 370 | 'hasTapeLibraryManufacturer' => array( | ||
| 371 | 'filter' => FILTER_DEFAULT, | ||
| 372 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 373 | ), | ||
| 374 | 'hasStorageVirtualizationManufacturer' => array( | ||
| 375 | 'filter' => FILTER_DEFAULT, | ||
| 376 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 377 | ), | ||
| 378 | 'naics' => array( | ||
| 379 | 'filter' => FILTER_DEFAULT, | ||
| 380 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 381 | ), | ||
| 382 | 'hasNAFCode' => array( | ||
| 383 | 'filter' => FILTER_DEFAULT, | ||
| 384 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 385 | ), | ||
| 386 | 'hasServerSeries' => array( | ||
| 387 | 'filter' => FILTER_DEFAULT, | ||
| 388 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 389 | ), | ||
| 390 | 'hasDesktopManufacturer' => array( | ||
| 391 | 'filter' => FILTER_DEFAULT, | ||
| 392 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 393 | ), | ||
| 394 | 'hasLaptopManufacturer' => array( | ||
| 395 | 'filter' => FILTER_DEFAULT, | ||
| 396 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 397 | ), | ||
| 398 | 'hasDesktopVirtualizationManufacturer' => array( | ||
| 399 | 'filter' => FILTER_DEFAULT, | ||
| 400 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 401 | ), | ||
| 402 | 'hasWorkstationManufacturer' => array( | ||
| 403 | 'filter' => FILTER_DEFAULT, | ||
| 404 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 405 | ), | ||
| 406 | 'hasNetworkPrinterManufacturer' => array( | ||
| 407 | 'filter' => FILTER_DEFAULT, | ||
| 408 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 409 | ), | ||
| 410 | 'hasHighVolumePrinterManufacturer' => array( | ||
| 411 | 'filter' => FILTER_DEFAULT, | ||
| 412 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 413 | ), | ||
| 414 | 'hasCopierManufacturer' => array( | ||
| 415 | 'filter' => FILTER_DEFAULT, | ||
| 416 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 417 | ), | ||
| 418 | 'hasUPSManufacturer' => array( | ||
| 419 | 'filter' => FILTER_DEFAULT, | ||
| 420 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 421 | ), | ||
| 422 | 'hasERPSuiteVendor' => array( | ||
| 423 | 'filter' => FILTER_DEFAULT, | ||
| 424 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 425 | ), | ||
| 426 | 'hasERPSoftwareasaServiceManufacturer' => array( | ||
| 427 | 'filter' => FILTER_DEFAULT, | ||
| 428 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 429 | ), | ||
| 430 | 'hasAppServerSoftwareVendor' => array( | ||
| 431 | 'filter' => FILTER_DEFAULT, | ||
| 432 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 433 | ), | ||
| 434 | 'hasBusIntellSoftwareVendor' => array( | ||
| 435 | 'filter' => FILTER_DEFAULT, | ||
| 436 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 437 | ), | ||
| 438 | 'hasCollaborativeSoftwareVendor' => array( | ||
| 439 | 'filter' => FILTER_DEFAULT, | ||
| 440 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 441 | ), | ||
| 442 | 'hasCRMSoftwareVendor' => array( | ||
| 443 | 'filter' => FILTER_DEFAULT, | ||
| 444 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 445 | ), | ||
| 446 | 'hasCRMSoftwareasaServiceManufacturer' => array( | ||
| 447 | 'filter' => FILTER_DEFAULT, | ||
| 448 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 449 | ), | ||
| 450 | 'hasDocumentMgmtSoftwareVendor' => array( | ||
| 451 | 'filter' => FILTER_DEFAULT, | ||
| 452 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 453 | ), | ||
| 454 | 'hasAppConsolidationSoftwareVendor' => array( | ||
| 455 | 'filter' => FILTER_DEFAULT, | ||
| 456 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 457 | ), | ||
| 458 | 'hasHumanResourceSoftwareVendor' => array( | ||
| 459 | 'filter' => FILTER_DEFAULT, | ||
| 460 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 461 | ), | ||
| 462 | 'hasSupplyChainSoftwareVendor' => array( | ||
| 463 | 'filter' => FILTER_DEFAULT, | ||
| 464 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 465 | ), | ||
| 466 | 'hasWebServiceSoftwareVendor' => array( | ||
| 467 | 'filter' => FILTER_DEFAULT, | ||
| 468 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 469 | ), | ||
| 470 | 'hasDatawarehouseSoftwareVendor' => array( | ||
| 471 | 'filter' => FILTER_DEFAULT, | ||
| 472 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 473 | ), | ||
| 474 | 'hasSaaSVendor' => array( | ||
| 475 | 'filter' => FILTER_DEFAULT, | ||
| 476 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 477 | ), | ||
| 478 | 'hasEmailMessagingVendor' => array( | ||
| 479 | 'filter' => FILTER_DEFAULT, | ||
| 480 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 481 | ), | ||
| 482 | 'hasEmailSaaSManufacturer' => array( | ||
| 483 | 'filter' => FILTER_DEFAULT, | ||
| 484 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 485 | ), | ||
| 486 | 'hasOSVendor' => array( | ||
| 487 | 'filter' => FILTER_DEFAULT, | ||
| 488 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 489 | ), | ||
| 490 | 'hasOSModel' => array( | ||
| 491 | 'filter' => FILTER_DEFAULT, | ||
| 492 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 493 | ), | ||
| 494 | 'hasDBMSVendor' => array( | ||
| 495 | 'filter' => FILTER_DEFAULT, | ||
| 496 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 497 | ), | ||
| 498 | 'hasAcctingVendor' => array( | ||
| 499 | 'filter' => FILTER_DEFAULT, | ||
| 500 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 501 | ), | ||
| 502 | 'hasAntiVirusVendor' => array( | ||
| 503 | 'filter' => FILTER_DEFAULT, | ||
| 504 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 505 | ), | ||
| 506 | 'hasAssetManagementSoftwareVendor' => array( | ||
| 507 | 'filter' => FILTER_DEFAULT, | ||
| 508 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 509 | ), | ||
| 510 | 'hasEnterpriseManagementSoftwareVendor' => array( | ||
| 511 | 'filter' => FILTER_DEFAULT, | ||
| 512 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 513 | ), | ||
| 514 | 'hasIDAccessSoftwareVendor' => array( | ||
| 515 | 'filter' => FILTER_DEFAULT, | ||
| 516 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 517 | ), | ||
| 518 | 'hasStorageManagementSoftwareVendor' => array( | ||
| 519 | 'filter' => FILTER_DEFAULT, | ||
| 520 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 521 | ), | ||
| 522 | 'hasStorageSaaSManufacturer' => array( | ||
| 523 | 'filter' => FILTER_DEFAULT, | ||
| 524 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 525 | ), | ||
| 526 | 'hasEthernetTechnology' => array( | ||
| 527 | 'filter' => FILTER_DEFAULT, | ||
| 528 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 529 | ), | ||
| 530 | 'haseCommerceType' => array( | ||
| 531 | 'filter' => FILTER_DEFAULT, | ||
| 532 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 533 | ), | ||
| 534 | 'hasHostorRemoteStatus' => array( | ||
| 535 | 'filter' => FILTER_DEFAULT, | ||
| 536 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 537 | ), | ||
| 538 | 'hasNetworkLineCarrier' => array( | ||
| 539 | 'filter' => FILTER_DEFAULT, | ||
| 540 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 541 | ), | ||
| 542 | 'hasVideoConfServicesProvider' => array( | ||
| 543 | 'filter' => FILTER_DEFAULT, | ||
| 544 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 545 | ), | ||
| 546 | 'hasUnifiedCommSvcProvider' => array( | ||
| 547 | 'filter' => FILTER_DEFAULT, | ||
| 548 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 549 | ), | ||
| 550 | 'hasRouterManufacturer' => array( | ||
| 551 | 'filter' => FILTER_DEFAULT, | ||
| 552 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 553 | ), | ||
| 554 | 'hasSwitchManufacturer' => array( | ||
| 555 | 'filter' => FILTER_DEFAULT, | ||
| 556 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 557 | ), | ||
| 558 | 'hasVPNManufacturer' => array( | ||
| 559 | 'filter' => FILTER_DEFAULT, | ||
| 560 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 561 | ), | ||
| 562 | 'hasISP' => array( | ||
| 563 | 'filter' => FILTER_DEFAULT, | ||
| 564 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 565 | ), | ||
| 566 | 'hasNetworkServiceProvider' => array( | ||
| 567 | 'filter' => FILTER_DEFAULT, | ||
| 568 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 569 | ), | ||
| 570 | 'hasPhoneSystemManufacturer' => array( | ||
| 571 | 'filter' => FILTER_DEFAULT, | ||
| 572 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 573 | ), | ||
| 574 | 'hasVoIPManufacturer' => array( | ||
| 575 | 'filter' => FILTER_DEFAULT, | ||
| 576 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 577 | ), | ||
| 578 | 'hasVoIPHosting' => array( | ||
| 579 | 'filter' => FILTER_DEFAULT, | ||
| 580 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 581 | ), | ||
| 582 | 'hasLongDistanceCarrier' => array( | ||
| 583 | 'filter' => FILTER_DEFAULT, | ||
| 584 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 585 | ), | ||
| 586 | 'hasWirelessProvider' => array( | ||
| 587 | 'filter' => FILTER_DEFAULT, | ||
| 588 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 589 | ), | ||
| 590 | 'hasPhoneSystemMaintenanceProvider' => array( | ||
| 591 | 'filter' => FILTER_DEFAULT, | ||
| 592 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 593 | ), | ||
| 594 | 'hasSmartphoneManufacturer' => array( | ||
| 595 | 'filter' => FILTER_DEFAULT, | ||
| 596 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 597 | ), | ||
| 598 | 'hasSmartphoneOS' => array( | ||
| 599 | 'filter' => FILTER_DEFAULT, | ||
| 600 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 601 | ), | ||
| 602 | 'hasFYE' => array( | ||
| 603 | 'filter' => FILTER_VALIDATE_REGEXP, | ||
| 604 | 			'options' 	=> array('regexp'=>'/^[A-Z]{3}$/'), | ||
| 605 | 'flags' => FILTER_REQUIRE_SCALAR | ||
| 606 | ) | ||
| 607 | ); | ||
| 608 | |||
| 609 | /** | ||
| 610 | * Redefine protected constructor to add address description as dynamic property | ||
| 611 | */ | ||
| 612 | 13 | protected function __construct(array $data = array(), array $customOptions = array()) | |
| 617 | |||
| 618 | |||
| 619 | /** | ||
| 620 | * If not existing, create an address description as a normalized address from following data properties: | ||
| 621 | * 'addressLocality', | ||
| 622 | * 'addressRegion', | ||
| 623 | * 'streetAddress', | ||
| 624 | * 'postalCode', | ||
| 625 | */ | ||
| 626 | 13 | private function addAddressDescription() | |
| 647 | |||
| 648 | |||
| 649 | 4 | public function asTurtleFragment() | |
| 868 | |||
| 869 | } | 
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.