for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* PHP Deal framework
*
* @copyright Copyright 2014, Lisachenko Alexander <[email protected]>
* This source file is subject to the license that is bundled
* with this source code in the file LICENSE.
*/
namespace PhpDeal\Contract\Fetcher;
use Go\Aop\Intercept\MethodInvocation;
class MethodArgument
{
* Returns an associative list of arguments for the method invocation
* @param MethodInvocation $invocation
* @return array
public function fetch(MethodInvocation $invocation)
$parameters = $invocation->getMethod()->getParameters();
$argumentNames = array_map(function (\ReflectionParameter $parameter) {
return $parameter->name;
}, $parameters);
$parameters = array_combine($argumentNames, $invocation->getArguments());
return $parameters;
}