mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-20 16:15:31 +01:00
20 lines
535 B
PHP
20 lines
535 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);
|
|
}
|
|
}
|