Skip to content
Snippets Groups Projects
Commit 162c80a3 authored by Jan Kuchař's avatar Jan Kuchař
Browse files

INITIAL COMMIT

parents
Branches
Tags
No related merge requests found
/composer.phar
/vendor
/.idea
/composer.lock
{
"name": "jkuchar/assert-function",
"description": "Assert function/closure signature type.",
"minimum-stability": "stable",
"license": "New BSD",
"authors": [
{
"name": "Jan Kuchař",
"email": "honza.kuchar@grifart.cz"
}
],
"require-dev": {
"nette/tester": "~1.7.1"
},
"autoload": {
"psr-4": {
"Grifart\\AssertFunction\\": "src"
},
"files": [
"src/functions.php"
]
},
"autoload-dev": {
"psr-4": {
"Grifart\\AssertFunction\\": "tests"
}
}
}
<?php declare(strict_types=1);
/**
* Used to load functions.
*/
namespace Grifart\AssertFunction;
function parameters(string ...$params): array
{
return $params;
}
function optional(string $classType): string
{
return '?' . $classType;
}
function assertFunction(callable $fn, array $parameters, string $returnType): void
{
}
<?php declare(strict_types=1);
require __DIR__ . '/../vendor/autoload.php';
\Tester\Environment::setup();
<?php declare(strict_types=1);
namespace MyTestNamespace;
require __DIR__ . '/bootstrap.php';
use function Grifart\AssertFunction\optional;
use Tester\Assert;
class TestClass {};
Assert::equal('?MyTestNamespace\TestClass', optional(TestClass::class));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment