diff --git a/README.md b/README.md index 13eef03..eed10cb 100644 --- a/README.md +++ b/README.md @@ -148,13 +148,14 @@ return $config // for multiple, use ignoreErrorsOnPackagesAndPaths() or ignoreErrorsOnPackageAndPaths() ->ignoreErrorsOnPackageAndPath('symfony/console', __DIR__ . '/src/OptionalCommand.php', [ErrorType::SHADOW_DEPENDENCY]) - // allow using classes not present in composer's autoloader + // allow using non-autoloadable classes // e.g. a library may conditionally support some feature only when Memcached is available ->ignoreUnknownClasses(['Memcached']) + ->ignoreUnknownClassesRegex('~^DDTrace~') - // allow using classes not present in composer's autoloader by regex - // e.g. when you want to ignore whole namespace of classes - ->ignoreUnknownClassesRegex('~^PHPStan\\.*?~') + // allow using functions not defined during runtime + ->ignoreUnknownFunctions(['opcache_invalidate']) + ->ignoreUnknownFunctionsRegex('~^opcache_~') // force certain classes to be treated as used // handy when dealing with dependencies in non-php files (e.g. DIC config), see example below