Skip to content

Commit 06ab7c6

Browse files
authored
Readme: mention ignoreUnknownFunctions (#126)
1 parent f4001af commit 06ab7c6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,14 @@ return $config
148148
// for multiple, use ignoreErrorsOnPackagesAndPaths() or ignoreErrorsOnPackageAndPaths()
149149
->ignoreErrorsOnPackageAndPath('symfony/console', __DIR__ . '/src/OptionalCommand.php', [ErrorType::SHADOW_DEPENDENCY])
150150

151-
// allow using classes not present in composer's autoloader
151+
// allow using non-autoloadable classes
152152
// e.g. a library may conditionally support some feature only when Memcached is available
153153
->ignoreUnknownClasses(['Memcached'])
154+
->ignoreUnknownClassesRegex('~^DDTrace~')
154155

155-
// allow using classes not present in composer's autoloader by regex
156-
// e.g. when you want to ignore whole namespace of classes
157-
->ignoreUnknownClassesRegex('~^PHPStan\\.*?~')
156+
// allow using functions not defined during runtime
157+
->ignoreUnknownFunctions(['opcache_invalidate'])
158+
->ignoreUnknownFunctionsRegex('~^opcache_~')
158159

159160
// force certain classes to be treated as used
160161
// handy when dealing with dependencies in non-php files (e.g. DIC config), see example below

0 commit comments

Comments
 (0)