2626use function date_create_immutable ;
2727use function getenv ;
2828use function htmlentities ;
29- use function join ;
29+ use function implode ;
3030use function ord ;
3131use function preg_replace ;
3232use function preg_split ;
@@ -78,16 +78,16 @@ function value(...$values): Data
7878}
7979
8080/**
81- * Do something with an object or array inside the callable,
82- * and return that value.
81+ * Do something with the $value ( an object, array)
82+ * inside the callable, and return that value.
8383 *
8484 * @param mixed $value The value that is tapped into the callback
8585 * @param callable|null $callable Callback that can modify the value
8686 * @return mixed The tapped value
8787 */
88- function tap (mixed $ value , callable $ callable = null ): mixed
88+ function tap (mixed $ value , callable | null $ callable = null ): mixed
8989{
90- if (false === is_null ( $ callable) ) {
90+ if ($ callable ) {
9191 $ callable ($ value );
9292 return $ value ;
9393 }
@@ -103,7 +103,7 @@ public function __call($method, $arguments) {
103103}
104104
105105/**
106- * Transforms simple CamelCaseName into camel_case_name (lower case underscored).
106+ * Transforms CamelCaseName string into camel_case_name (lower case, underscored).
107107 *
108108 * @param string $string CamelCase string to be underscored
109109 * @return string Transformed string (for weird strings, you get what you deserve)
@@ -129,8 +129,8 @@ function error_log(string $func, string $message, mixed $data): void
129129/**
130130 * Gets or sets environment variables.
131131 *
132- * @param string|null $name
133- * @param string [optional] $name The name of the env variable
132+ * @param string|null $name The name of the env variable
133+ * @param string|null $default The default value (NULL if not provided)
134134 * @param array|null $initialState
135135 * @return mixed The value for the env variable,
136136 * or all variables if $name is not provided
@@ -291,7 +291,7 @@ function snake_to_camel_case(string $string): string
291291function to_delimited_string (string $ string , int $ delimiter ): string
292292{
293293 $ str = preg_split ('~[^\p{L}\p{N} \']+~u ' , trim ($ string ));
294- return join (chr ($ delimiter ), $ str );
294+ return implode (chr ($ delimiter ), $ str );
295295}
296296
297297/**
@@ -320,7 +320,7 @@ function xml_serialize(string $root, iterable $data): string
320320/**
321321 * Unserialize an XML document into PHP array.
322322 * This function does not deal with magical conversions
323- * of complicated XML structures .
323+ * of complicated XML documents .
324324 *
325325 * @param string $xml The XML document to be decoded into array
326326 * @return array Decoded version of the XML string,
0 commit comments