Clean Code Cookbook by Maximiliano Contieri

Clean Code Cookbook by Maximiliano Contieri

Author:Maximiliano Contieri [Maximiliano Contieri]
Language: eng
Format: epub
ISBN: 9781098144722
Publisher: O'Reilly Media, Inc.
Published: 2023-12-25T00:00:00+00:00


In this example, you can receive several different and non-polymorphic arguments:

function parseArguments($arguments) { $arguments = $arguments ?: null; // Always the billion-dollar mistake (null) if (is_empty($arguments)) { $this->arguments = http_build_query($_REQUEST); // Global coupling and side effects } elseif (is_array($arguments)) { $this->arguments = http_build_query($arguments); } elseif (!$arguments) { // null unmasked $this->arguments = null; } else { $this->arguments = (string)$arguments; } }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.