public function getProduct($productId, $store, $identifierType = null) {$loadByIdOnFalse = false;if ($identifierType == null) {if (is_string($productId) && !preg_match("/^[+-]?[1-9][0-9]*$|^0$/", $productId)) {$identifierType = 'sku';$loadByIdOnFalse = true;} else {$identifierType = 'id';}}
...
Okay. Once and for all: If you have to have parameters go through a regex to find out what type they are, you're definitely doing something wrong. Even with PHP, this is a smell. Not even a code smell. It's the smell of a public toilet that hasn't been cleaned in like 50 years or so. It's code puke.
Agreed !
AntwortenLöschen