$finder =
new Finder();
$finder->
files() ->
in([__DIR__ . '/../../../../', __DIR__ . '/../../../../../tests'
]) // exclude js files including node_modules for performance reasons, filtering with `notPath`, etc. has no performance impact
// note that excluded paths need to be relative to platform/src and that no wildcards are supported
->
exclude([ 'Administration/Resources',
'Storefront/Resources',
'Recovery',
]) ->
path($example->
getFilePath()) ->
ignoreUnreadableDirs();
$files =
iterator_to_array($finder);
if (\
count($files) === 0
) { throw new \
RuntimeException(sprintf( 'Cannot find configured example file in `@example` annotation for method "%s()" in class "%s". File with pattern "%s" can not be found.',
$method->
getName(),
$method->
getDeclaringClass()->
getName(),
$example->
getFilePath() ));
}