// This can happen with YAML files
if (\
is_array($exclude) && \
in_array(null,
$exclude, true
)) { throw new InvalidArgumentException('The exclude list must not contain a "null" value.'
);
} // This can happen with XML files
if (\
is_array($exclude) && \
in_array('',
$exclude, true
)) { throw new InvalidArgumentException('The exclude list must not contain an empty value.'
);
} $source = \
func_num_args() > 4 ?
func_get_arg(4
) : null;
$autoconfigureAttributes =
new RegisterAutoconfigureAttributesPass();
$autoconfigureAttributes =
$autoconfigureAttributes->
accept($prototype) ?
$autoconfigureAttributes : null;
$classes =
$this->
findClasses($namespace,
$resource,
(array) $exclude,
$autoconfigureAttributes,
$source);
$getPrototype =
static fn () =>
clone $prototype;
$serialized =
serialize($prototype);
// avoid deep cloning if no definitions are nested
if (strpos($serialized, 'O:48:"Symfony\Component\DependencyInjection\Definition"', 55
) ||
strpos($serialized, 'O:53:"Symfony\Component\DependencyInjection\ChildDefinition"', 55
) ) { // prepare for deep cloning
foreach (['Arguments', 'Properties', 'MethodCalls', 'Configurator', 'Factory', 'Bindings'
] as $key) {