function printInfo($str, $append_new_line = true) { echo \Slim3MvcTools\Functions\Str\color_4_console($str, "green", "black"); if ($append_new_line) { echo PHP_EOL; } }
/** * * * * @param string $str * @param boolean $append_new_line * * @return void * * @throws \InvalidArgumentException */ function printInfo($str, $append_new_line = true) { if (!is_string($str)) { $msg = 'The expected value for the first argument to ' . '`' . __FUNCTION__ . '($str, $append_new_line = true)` should be a String value.' . ' `' . ucfirst(gettype($str)) . '` with the value below was supplied:' . PHP_EOL . var_export($str, true) . PHP_EOL; throw new \InvalidArgumentException($msg); } echo \Slim3MvcTools\Functions\Str\color_4_console($str, "green", "black"); if ((bool) $append_new_line) { echo PHP_EOL; } }