for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Composer plugin for config assembling
*
* @link https://github.com/hiqdev/composer-config-plugin
* @package composer-config-plugin
* @license BSD-3-Clause
* @copyright Copyright (c) 2016-2018, HiQDev (http://hiqdev.com/)
*/
namespace hiqdev\composer\config;
use Closure;
use Riimu\Kit\PHPEncoder\Encoder\Encoder;
use Opis\Closure\ReflectionClosure;
* Closure encoder for Riimu Kit-PHPEncoder.
* @author Andrii Vasyliev <[email protected]>
class ClosureEncoder implements Encoder
{
* {@inheritdoc}
public function getDefaultOptions()
return [];
}
public function supports($value)
return $value instanceof Closure;
public function encode($value, $depth, array $options, callable $encode)
return (new ReflectionClosure($value))->getCode();