mirror of
https://github.com/itflow-org/itflow
synced 2026-06-13 21:31:06 +00:00
Revert "Add new optional beta email parser thats based on ImapEngine instead of Webklex"
This reverts commit 9cb1ff7330.
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Invoker\ParameterResolver;
|
||||
|
||||
use ReflectionFunctionAbstract;
|
||||
|
||||
/**
|
||||
* Tries to map an associative array (string-indexed) to the parameter names.
|
||||
*
|
||||
* E.g. `->call($callable, ['foo' => 'bar'])` will inject the string `'bar'`
|
||||
* in the parameter named `$foo`.
|
||||
*
|
||||
* Parameters that are not indexed by a string are ignored.
|
||||
*/
|
||||
class AssociativeArrayResolver implements ParameterResolver
|
||||
{
|
||||
public function getParameters(
|
||||
ReflectionFunctionAbstract $reflection,
|
||||
array $providedParameters,
|
||||
array $resolvedParameters
|
||||
): array {
|
||||
$parameters = $reflection->getParameters();
|
||||
|
||||
// Skip parameters already resolved
|
||||
if (! empty($resolvedParameters)) {
|
||||
$parameters = array_diff_key($parameters, $resolvedParameters);
|
||||
}
|
||||
|
||||
foreach ($parameters as $index => $parameter) {
|
||||
if (array_key_exists($parameter->name, $providedParameters)) {
|
||||
$resolvedParameters[$index] = $providedParameters[$parameter->name];
|
||||
}
|
||||
}
|
||||
|
||||
return $resolvedParameters;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user