for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* For licensing information, please see the LICENSE file accompanied with this file.
*
* @author Gerard van Helden <[email protected]>
* @copyright 2012 Gerard van Helden <http://melp.nl>
*/
namespace Zicht\Tool\Configuration;
use Symfony\Component\Config\FileLocator;
* A FileLocator implementation that uses an environment PATH variable, and defaults to other paths if that
* environment variable does not exist
class PathDefaultFileLocator extends FileLocator
{
* Expand all path elements with globbing.
* @param string $paths
* @return array
private static function expand($paths)
return array_filter(array_reduce(array_map('glob', $paths), 'array_merge', []));
}
* Construct the locator based on the passed environment variable.
* @param string $envName
* @param array $defaultPaths
public function __construct($envName, $defaultPaths = array())
parent::__construct(self::expand(getenv($envName) ? explode(PATH_SEPARATOR, getenv($envName)) : $defaultPaths));
getenv($envName) ? explo...vName)) : $defaultPaths
array
string
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: