mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-10 18:51:20 +01:00
18 lines
540 B
PHP
18 lines
540 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\Autodiscovery\FileLocation;
|
|
|
|
final class ExpectedFileLocationResolver
|
|
{
|
|
/**
|
|
* Resolves if is suffix in the same category, e.g. "Exception/SomeException.php"
|
|
*/
|
|
public function resolve(string $escapedGroupName, string $suffixPattern) : string
|
|
{
|
|
$escapedGroupName = \preg_quote($escapedGroupName, '#');
|
|
$escapedSuffixPattern = \preg_quote($suffixPattern, '#');
|
|
return \sprintf('#\\/%s\\/.+%s#', $escapedGroupName, $escapedSuffixPattern);
|
|
}
|
|
}
|