Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add InspectSymbols command #619

Merged
merged 12 commits into from
Feb 5, 2022

Conversation

theofidry
Copy link
Member

@theofidry theofidry commented Feb 5, 2022

New command:

$ bin/php-scoper inspect-symbol --help
Description:
  Checks the given symbol for a given configuration. Helpful to have an insight on how PHP-Scoper will interpret this symbol

Usage:
  inspect-symbol [options] [--] <symbol> [<type>]

Arguments:
  symbol                         The symbol to inspect.
  type                           The symbol type inspect ("class", "function", "constant", "any"). [default: "any"]

Options:
  -d, --working-dir=WORKING-DIR  If specified, use the given directory as working directory.
  -c, --config=CONFIG            Configuration file. Will use "scoper.inc.php" if found by default.
      --no-config                Do not look for a configuration file.
  -h, --help                     Display help for the given command. When no command is given display help for the list command
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi|--no-ansi           Force (or disable --no-ansi) ANSI output
  -n, --no-interaction           Do not ask any interactive question
  -v|vv|vvv, --verbose           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Examples:

$ bin/php-scoper inspect-symbol GRAPHEME_EXTR_MAXCHARS constant

Internal (configured via the `excluded-*` settings are treated as PHP native symbols, i.e. will remain untouched.
Exposed symbols will be prefixed but aliased to its original symbol.
If a symbol is neither internal or exposed, it will be prefixed and not aliased

For more information, see:
 * Doc link for excluded symbols
 * Doc link for exposed symbols

Inspecting the symbol GRAPHEME_EXTR_MAXCHARS for type constant:

 * Internal: true
 * Exposed:  true

Another example:

$ bin/php-scoper inspect-symbol GRAPHEME_EXTR_MAXCHARS

Internal (configured via the `excluded-*` settings are treated as PHP native symbols, i.e. will remain untouched.
Exposed symbols will be prefixed but aliased to its original symbol.
If a symbol is neither internal or exposed, it will be prefixed and not aliased

For more information, see:
 * Doc link for excluded symbols
 * Doc link for exposed symbols

Inspecting the symbol GRAPHEME_EXTR_MAXCHARS for all types.

As a class:
 * Internal: false
 * Exposed:  false

As a function:
 * Internal: false
 * Exposed:  false

As a constant:
 * Internal: true
 * Exposed:  true

@theofidry theofidry changed the title Draft the InspectSymbols command Add InspectSymbols command Feb 5, 2022
@theofidry theofidry merged commit d6cda55 into humbug:master Feb 5, 2022
@theofidry theofidry deleted the feature/internal-symbols branch February 5, 2022 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant