1. Go to this page and download the library: Download timacdonald/callable-fake library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
timacdonald / callable-fake example snippets
interface DependencyRepository
{
public function each(callable $callback): void;
}
$callable = CallableFake::withReturnResolver(function (Dependency $dependency): bool {
if ($dependency->version === '*') {
return '🤠';
}
return '😀';
});
// You would not generally be calling this yourself, this is simply to demonstate
// what will happen under the hood...
$emoji = $callable(new Dependecy(['version' => '*']));
// $emoji === '🤠';
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.