Oragnize project files like in following structure:
/src
- Foundation
- Client.ts
- Services
- LoginService.ts
- AppClient.ts
<?php | |
abstract class FunctionType { | |
public static function fn(callable $callable) { | |
$type = static::class; | |
$signature = self::getMethodSignature(static::class, "__invoke"); | |
$code = "return new class (\$callable) extends $type { | |
private \$callable; | |
public function __construct(\$callable) { | |
\$this->callable = new \ReflectionFunction(\$callable); |