Properly create missing wp cli config file when needed. by mrsdizzie · Pull Request #6062 · wp-cli/wp-cli

Our default config file includes a path that also might not exist. Touch
can't create paths, so this silently fails in the one situation you want
it to work (when the user hasn't already created the folder).

Instead we check if the directory exists first and if not create it.
Then we use the build in touch rather than running an external command.
The DocBlock for this function says this should return sring or false
but find_file_upward actually returns null when no file is found. This
was causing a problem later on because you can't give Spyc::YAMLLoad() a
null variable.

```
PHP  15. Mustangostang\Spyc::YAMLLoad($input = NULL)
/Users/isla/source/wp-cli-dev/wp-cli/php/commands/src/CLI_Alias_Command.php:358
PHP  16. Mustangostang\Spyc->_load($input = NULL)
/Users/isla/source/wp-cli-dev/spyc/src/Spyc.php:118
PHP  17. Mustangostang\Spyc->loadFromSource($input = NULL)
/Users/isla/source/wp-cli-dev/spyc/src/Spyc.php:440
PHP  18. Mustangostang\Spyc->loadFromString($input = NULL)
/Users/isla/source/wp-cli-dev/spyc/src/Spyc.php:512
PHP  19. explode($separator = '\n', $string = NULL)
/Users/isla/source/wp-cli-dev/spyc/src/Spyc.php:516

Deprecated: explode(): Passing null to parameter #2 ($string) of type
string is deprecated in /Users/isla/source/wp-cli-dev/spyc/src/Spyc.php
on line 516
```

@mrsdizzie

@mrsdizzie

Need to add an extra debug statement when creating a config file because
the existing debug details get overwritten and it only prints the last
one
To see if this solves current CI problems

swissspidy