Skip to content

Commit

Permalink
Readme: mention ignoreUnknownFunctions (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal committed Apr 17, 2024
1 parent f4001af commit 06ab7c6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 06ab7c6

Please sign in to comment.