kedniko/php-parser-closure

There is no license information available for the latest version (v0.0.1) of this package.

v0.0.1 2023-03-31 15:29 UTC

This package is auto-updated.

Last update: 2024-04-27 18:25:09 UTC


README

Quick Start

$parser = new \Kedniko\PhpParserClosure\PhpParserClosure();

$closure = function (int $number) {
  return $number * 2;
};

$parser->parse($closure);
$code = $parser->getCode();

echo $code;
// "function (int $number) {
//   return $number * 2;
// }"

Under the hood this library uses nikic/php-parser.