[
  {
    "path": ".gitattributes",
    "content": "/.gitattributes         export-ignore\n/.gitignore             export-ignore\n/.github                export-ignore\n/.phive                 export-ignore\n/build                  export-ignore\n/.php-cs-fixer.dist.php export-ignore\n/build.xml              export-ignore\n/phpstan.neon           export-ignore\n/phpunit.xml            export-ignore\n/tests                  export-ignore\n/tools                  export-ignore\n/tools/*                binary\n\n*.php diff=php\n"
  },
  {
    "path": ".github/CODE_OF_CONDUCT.md",
    "content": "# Contributor Code of Conduct\n\nAs contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.\n\nWe are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.\n\nExamples of unacceptable behavior by participants include:\n\n* The use of sexualized language or imagery\n* Personal attacks\n* Trolling or insulting/derogatory comments\n* Public or private harassment\n* Publishing other's private information, such as physical or electronic\n  addresses, without explicit permission\n* Other unethical or unprofessional conduct\n\nProject maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.\n\nBy adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.\n\nThis Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project maintainer at sebastian@phpunit.de. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident.\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.3.0, available at [https://contributor-covenant.org/version/1/3/0/][version]\n\n[homepage]: https://contributor-covenant.org\n[version]: https://contributor-covenant.org/version/1/3/0/\n"
  },
  {
    "path": ".github/CONTRIBUTING.md",
    "content": "# Contributing to `sebastian/code-unit-reverse-lookup`\n\n## Welcome!\n\nWe look forward to your contributions! Here are some examples how you can contribute:\n\n* [Report a bug](https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues/new)\n* [Send a pull request to fix a bug](https://github.com/sebastianbergmann/code-unit-reverse-lookup/pulls)\n\n\n## We have a Code of Conduct\n\nPlease note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.\n\n\n## Any contributions you make will be under the BSD-3-Clause License\n\nWhen you submit code changes, your submissions are understood to be under the same [BSD-3-Clause License](https://github.com/sebastianbergmann/code-unit-reverse-lookup/blob/main/LICENSE) that covers the project. By contributing to this project, you agree that your contributions will be licensed under its BSD-3-Clause License.\n\n\n### Do Not Violate Copyright\n\nOnly submit a pull request with your own original code. Do NOT submit a pull request containing code which you have largely copied from\nanother project, unless you wrote the respective code yourself.\n\nOpen Source does not mean that copyright does not apply. Copyright infringements will not be tolerated and can lead to you being banned from this project and repository.\n\n\n### Do Not Submit AI-Generated Pull Requests\n\nThe same goes for (largely) AI-generated pull requests. These are not welcome as they will be based on copyrighted code from others\nwithout accreditation and without taking the license of the original code into account, let alone getting permission\nfor the use of the code or for re-licensing.\n\nAside from that, the experience is that AI-generated pull requests will be incorrect 100% of the time and cost reviewers too much time.\nSubmitting a (largely) AI-generated pull request will lead to you being banned from this project and repository.\n\n\n## Write bug reports with detail, background, and sample code\n\n[This is an example](https://github.com/sebastianbergmann/phpunit/issues/4376) of a bug report I wrote, and I think it's not too bad.\n\nIn your bug report, please provide the following:\n\n* A quick summary and/or background\n* Steps to reproduce\n    * Be specific!\n    * Give sample code if you can.\n* What you expected would happen\n* What actually happens\n* Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)\n\nPlease do not report a bug for a version of this library that is no longer supported. Please do not report a bug if you are using a version of PHP that is not supported by the version of this library you are using.\n\nThe library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. Support for this library follows the [support for the version of PHPUnit that uses a specific version of this library](https://phpunit.de/supported-versions.html).\n\nPlease post code and output as text ([using proper markup](https://guides.github.com/features/mastering-markdown/)). Do not post screenshots of code or output.\n\n\n## Workflow for Pull Requests\n\n1. Fork the repository.\n2. Create your branch from `main` if you plan to implement new functionality or change existing code significantly; create your branch from the oldest branch that is affected by the bug if you plan to fix a bug.\n3. Implement your change and add tests for it.\n4. Ensure the test suite passes.\n5. Ensure the code complies with our coding guidelines (see below).\n6. Send that pull request!\n\nPlease make sure you have [set up your username and email address](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup) for use with Git. Strings such as `silly nick name <root@localhost>` look really stupid in the commit history of a project.\n\nWe encourage you to [sign your Git commits with your GPG key](https://docs.github.com/en/github/authenticating-to-github/signing-commits).\n\nPull requests for bug fixes must be made for the oldest branch that is supported (see above). Pull requests for new features must be based on the `main` branch.\n\nWe are trying to keep backwards compatibility breaks to an absolute minimum. Please take this into account when proposing changes.\n\nDue to time constraints, we are not always able to respond as quickly as we would like. Please do not take delays personal and feel free to remind us if you feel that we forgot to respond.\n\n\n## Development\n\nThis project uses [PHPUnit](https://phpunit.de/) for testing:\n\n```shell\n./vendor/bin/phpunit\n```\n\nThis project uses [PHPStan](https://phpstan.org/) for static analysis:\n\n```shell\n./tools/phpstan\n```\n\nThis project uses [PHP-CS-Fixer](https://cs.symfony.com/) to enforce coding guidelines:\n\n```shell\n./tools/php-cs-fixer fix\n```\n\nThe commands shown above require an autoloader script at `vendor/autoload.php`. This can be generated like so:\n\n```shell\n./tools/composer dump-autoload\n```\n\nPlease understand that we will not accept a pull request when its changes violate this project's coding guidelines or break the test suite.\n\n\n## Low Maintenance Project\n\nThis library was developed specifically as a dependency for [PHPUnit](https://github.com/sebastianbergmann/phpunit).\nStarting with PHPUnit 12, PHPUnit no longer depends on this library.\n\nThis library is now a low maintenance project.\nBugs that have an impact on [versions of PHPUnit that still receive bug fixes](https://phpunit.de/supported-versions.html) and still depend on this library will be fixed in this library.\n\nAside from the above, no further development of this library is planned.\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "github: sebastianbergmann\nliberapay: sebastianbergmann\nthanks_dev: u/gh/sebastianbergmann\ntidelift: \"packagist/sebastian/code-unit-reverse-lookup\"\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "# https://help.github.com/en/categories/automating-your-workflow-with-github-actions\n\non:\n  - pull_request\n  - push\n\nname: CI\n\nenv:\n  COMPOSER_ROOT_VERSION: 4.0.x-dev\n\npermissions:\n  contents: read\n\njobs:\n  coding-guidelines:\n    name: Coding Guidelines\n\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n\n      - name: Install PHP\n        uses: shivammathur/setup-php@v2\n        with:\n          php-version: 8.3\n          coverage: none\n\n      - name: Run PHP-CS-Fixer\n        run: ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose\n\n  static-analysis:\n    name: Static Analysis\n\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n\n      - name: Install PHP\n        uses: shivammathur/setup-php@v2\n        with:\n          php-version: 8.3\n          coverage: none\n\n      - name: Install dependencies with Composer\n        run: ./tools/composer update --no-interaction --no-ansi --no-progress\n\n      - name: Run PHPStan\n        run: ./tools/phpstan analyse --no-progress --error-format=github\n\n  tests:\n    name: Tests\n\n    runs-on: ubuntu-latest\n\n    strategy:\n      fail-fast: false\n      matrix:\n        php-version:\n          - 8.2\n          - 8.3\n          - 8.4\n          - 8.5\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n\n      - name: Install PHP with extensions\n        uses: shivammathur/setup-php@v2\n        with:\n          php-version: ${{ matrix.php-version }}\n          coverage: xdebug\n\n      - name: Install dependencies with Composer\n        run: ./tools/composer update --no-ansi --no-interaction --no-progress\n\n      - name: Run tests with PHPUnit\n        run: ./vendor/bin/phpunit --log-junit test-results.xml --coverage-clover=code-coverage.xml\n\n      - name: Upload test results to Codecov.io\n        if: ${{ !cancelled() }}\n        uses: codecov/test-results-action@v1\n        with:\n          token: ${{ secrets.CODECOV_TOKEN }}\n          disable_search: true\n          files: ./test-results.xml\n\n      - name: Upload code coverage data to Codecov.io\n        uses: codecov/codecov-action@v4\n        with:\n          token: ${{ secrets.CODECOV_TOKEN }}\n          disable_search: true\n          files: ./code-coverage.xml\n"
  },
  {
    "path": ".github/workflows/release.yaml",
    "content": "# https://docs.github.com/en/actions\n\non:\n  push:\n    tags:\n      - \"**\"\n\nname: Release\n\njobs:\n  release:\n    name: Release\n\n    runs-on: ubuntu-latest\n\n    permissions:\n      contents: write\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n\n      - name: Install PHP with extensions\n        uses: shivammathur/setup-php@v2\n        with:\n          php-version: 8.3\n          coverage: none\n          extensions: none\n          tools: none\n\n      - name: Determine tag\n        run: echo \"RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV\n\n      - name: Parse ChangeLog\n        run: build/scripts/extract-release-notes.php ${{ env.RELEASE_TAG }} > release-notes.md\n\n      - name: Create release\n        uses: ncipollo/release-action@v1\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          tag: ${{ env.RELEASE_TAG }}\n          name: sebastian/code-unit-reverse-lookup ${{ env.RELEASE_TAG }}\n          bodyFile: release-notes.md\n"
  },
  {
    "path": ".gitignore",
    "content": "/.idea\n/.php-cs-fixer.php\n/.php-cs-fixer.cache\n/.phpunit.cache\n/composer.lock\n/vendor\n"
  },
  {
    "path": ".phive/phars.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phive xmlns=\"https://phar.io/phive\">\n  <phar name=\"php-cs-fixer\" version=\"^3.64\" installed=\"3.64.0\" location=\"./tools/php-cs-fixer\" copy=\"true\"/>\n  <phar name=\"composer\" version=\"^2.8\" installed=\"2.8.2\" location=\"./tools/composer\" copy=\"true\"/>\n  <phar name=\"phpstan\" version=\"^2.0\" installed=\"2.0.1\" location=\"./tools/phpstan\" copy=\"true\"/>\n</phive>\n"
  },
  {
    "path": ".php-cs-fixer.dist.php",
    "content": "<?php declare(strict_types=1);\n$header = <<<'EOF'\nThis file is part of sebastian/code-unit-reverse-lookup.\n\n(c) Sebastian Bergmann <sebastian@phpunit.de>\n\nFor the full copyright and license information, please view the LICENSE\nfile that was distributed with this source code.\nEOF;\n\n$finder = PhpCsFixer\\Finder::create()\n    ->files()\n    ->in(__DIR__ . '/src')\n    ->in(__DIR__ . '/tests')\n;\n\n$config = new PhpCsFixer\\Config;\n$config->setFinder($finder)\n    ->setRiskyAllowed(true)\n    ->setRules([\n        'align_multiline_comment' => true,\n        'array_indentation' => true,\n        'array_push' => true,\n        'array_syntax' => ['syntax' => 'short'],\n        'backtick_to_shell_exec' => true,\n        'binary_operator_spaces' => [\n            'operators' => [\n                '*=' => 'align_single_space_minimal',\n                '+=' => 'align_single_space_minimal',\n                '-=' => 'align_single_space_minimal',\n                '/=' => 'align_single_space_minimal',\n                '=' => 'align_single_space_minimal',\n                '=>' => 'align_single_space_minimal',\n            ],\n        ],\n        'blank_line_after_namespace' => true,\n        'blank_line_before_statement' => [\n            'statements' => [\n                'break',\n                'case',\n                'continue',\n                'declare',\n                'default',\n                'do',\n                'exit',\n                'for',\n                'foreach',\n                'goto',\n                'if',\n                'include',\n                'include_once',\n                'phpdoc',\n                'require',\n                'require_once',\n                'return',\n                'switch',\n                'throw',\n                'try',\n                'while',\n                'yield',\n                'yield_from',\n            ],\n        ],\n        'blank_lines_before_namespace' => [\n            'max_line_breaks' => 1,\n            'min_line_breaks' => 0,\n        ],\n        'braces_position' => [\n            'anonymous_classes_opening_brace' => 'next_line_unless_newline_at_signature_end',\n            'anonymous_functions_opening_brace' => 'next_line_unless_newline_at_signature_end',\n        ],\n        'cast_spaces' => true,\n        'class_attributes_separation' => [\n            'elements' => [\n                'const' => 'none',\n                'method' => 'one',\n                'property' => 'only_if_meta'\n            ]\n        ],\n        'class_definition' => true,\n        'clean_namespace' => true,\n        'combine_consecutive_issets' => true,\n        'combine_consecutive_unsets' => true,\n        'combine_nested_dirname' => true,\n        'compact_nullable_type_declaration' => true,\n        'concat_space' => ['spacing' => 'one'],\n        'constant_case' => true,\n        'control_structure_braces' => true,\n        'control_structure_continuation_position' => true,\n        'declare_equal_normalize' => ['space' => 'none'],\n        'declare_parentheses' => true,\n        'declare_strict_types' => true,\n        'dir_constant' => true,\n        'echo_tag_syntax' => true,\n        'elseif' => true,\n        'encoding' => true,\n        'ereg_to_preg' => true,\n        'explicit_indirect_variable' => true,\n        'explicit_string_variable' => true,\n        'fopen_flag_order' => true,\n        'full_opening_tag' => true,\n        'fully_qualified_strict_types' => ['import_symbols' => true],\n        'function_declaration' => true,\n        'function_to_constant' => true,\n        'get_class_to_class_keyword' => true,\n        'global_namespace_import' => [\n            'import_classes' => true,\n            'import_constants' => true,\n            'import_functions' => true,\n        ],\n        'header_comment' => ['header' => $header, 'separate' => 'none'],\n        'heredoc_to_nowdoc' => true,\n        'implode_call' => true,\n        'include' => true,\n        'increment_style' => [\n            'style' => 'post',\n        ],\n        'indentation_type' => true,\n        'integer_literal_case' => true,\n        'is_null' => true,\n        'lambda_not_used_import' => true,\n        'line_ending' => true,\n        'list_syntax' => ['syntax' => 'short'],\n        'logical_operators' => true,\n        'lowercase_cast' => true,\n        'lowercase_keywords' => true,\n        'lowercase_static_reference' => true,\n        'magic_constant_casing' => true,\n        'magic_method_casing' => true,\n        'method_argument_space' => [\n            'on_multiline' => 'ensure_fully_multiline',\n        ],\n        'method_chaining_indentation' => true,\n        'modernize_strpos' => true,\n        'modernize_types_casting' => true,\n        'multiline_comment_opening_closing' => true,\n        'multiline_whitespace_before_semicolons' => true,\n        'native_constant_invocation' => true,\n        'native_function_casing' => false,\n        'native_function_invocation' => [\n            'include' => [\n                '@internal',\n            ],\n        ],\n        'native_type_declaration_casing' => true,\n        'new_with_parentheses' => [\n            'anonymous_class' => false,\n            'named_class' => false,\n        ],\n        'no_alias_functions' => true,\n        'no_alias_language_construct_call' => true,\n        'no_alternative_syntax' => true,\n        'no_binary_string' => true,\n        'no_blank_lines_after_class_opening' => true,\n        'no_blank_lines_after_phpdoc' => true,\n        'no_break_comment' => true,\n        'no_closing_tag' => true,\n        'no_empty_comment' => true,\n        'no_empty_phpdoc' => true,\n        'no_empty_statement' => true,\n        'no_extra_blank_lines' => [\n            'tokens' => [\n                'attribute',\n                'break',\n                'case',\n                'continue',\n                'curly_brace_block',\n                'default',\n                'extra',\n                'parenthesis_brace_block',\n                'return',\n                'square_brace_block',\n                'switch',\n                'throw',\n                'use',\n            ],\n        ],\n        'no_homoglyph_names' => true,\n        'no_leading_import_slash' => true,\n        'no_leading_namespace_whitespace' => true,\n        'no_mixed_echo_print' => ['use' => 'print'],\n        'no_multiline_whitespace_around_double_arrow' => true,\n        'no_multiple_statements_per_line' => true,\n        'no_null_property_initialization' => true,\n        'no_php4_constructor' => true,\n        'no_short_bool_cast' => true,\n        'no_singleline_whitespace_before_semicolons' => true,\n        'no_space_around_double_colon' => true,\n        'no_spaces_after_function_name' => true,\n        'no_spaces_around_offset' => true,\n        'no_superfluous_elseif' => true,\n        'no_superfluous_phpdoc_tags' => [\n            'allow_mixed' => true,\n        ],\n        'no_trailing_comma_in_singleline' => true,\n        'no_trailing_whitespace' => true,\n        'no_trailing_whitespace_in_comment' => true,\n        'no_trailing_whitespace_in_string' => true,\n        'no_unneeded_braces' => true,\n        'no_unneeded_control_parentheses' => true,\n        'no_unneeded_final_method' => true,\n        'no_unneeded_import_alias' => true,\n        'no_unreachable_default_argument_value' => true,\n        'no_unset_cast' => true,\n        'no_unset_on_property' => true,\n        'no_unused_imports' => true,\n        'no_useless_concat_operator' => true,\n        'no_useless_else' => true,\n        'no_useless_nullsafe_operator' => true,\n        'no_useless_return' => true,\n        'no_useless_sprintf' => true,\n        'no_whitespace_before_comma_in_array' => true,\n        'no_whitespace_in_blank_line' => true,\n        'non_printable_character' => true,\n        'normalize_index_brace' => true,\n        'nullable_type_declaration_for_default_null_value' => true,\n        'object_operator_without_whitespace' => true,\n        'octal_notation' => true,\n        'operator_linebreak' => [\n            'only_booleans' => true,\n            'position' => 'end',\n        ],\n        'ordered_class_elements' => [\n            'order' => [\n                'use_trait',\n                'constant_public',\n                'constant_protected',\n                'constant_private',\n                'property_public_static',\n                'property_protected_static',\n                'property_private_static',\n                'property_public',\n                'property_protected',\n                'property_private',\n                'method_public_static',\n                'construct',\n                'destruct',\n                'magic',\n                'phpunit',\n                'method_public',\n                'method_protected',\n                'method_private',\n                'method_protected_static',\n                'method_private_static',\n            ],\n        ],\n        'ordered_imports' => [\n            'imports_order' => [\n                'const',\n                'function',\n                'class',\n            ]\n        ],\n        'ordered_interfaces' => [\n            'direction' => 'ascend',\n            'order' => 'alpha',\n        ],\n        'ordered_traits' => true,\n        'ordered_types' => true,\n        'php_unit_set_up_tear_down_visibility' => true,\n        'php_unit_test_case_static_method_calls' => [\n            'call_type' => 'this',\n        ],\n        'phpdoc_add_missing_param_annotation' => false,\n        'phpdoc_align' => true,\n        'phpdoc_annotation_without_dot' => true,\n        'phpdoc_indent' => true,\n        'phpdoc_inline_tag_normalizer' => true,\n        'phpdoc_no_access' => true,\n        'phpdoc_no_alias_tag' => true,\n        'phpdoc_no_empty_return' => true,\n        'phpdoc_no_package' => true,\n        'phpdoc_no_useless_inheritdoc' => true,\n        'phpdoc_order' => true,\n        'phpdoc_order_by_value' => [\n            'annotations' => [\n                'covers',\n                'dataProvider',\n                'throws',\n                'uses',\n            ],\n        ],\n        'phpdoc_param_order' => true,\n        'phpdoc_return_self_reference' => true,\n        'phpdoc_scalar' => true,\n        'phpdoc_separation' => true,\n        'phpdoc_single_line_var_spacing' => true,\n        'phpdoc_summary' => true,\n        'phpdoc_tag_casing' => true,\n        'phpdoc_tag_type' => true,\n        'phpdoc_to_comment' => false,\n        'phpdoc_trim' => true,\n        'phpdoc_trim_consecutive_blank_line_separation' => true,\n        'phpdoc_types' => ['groups' => ['simple', 'meta']],\n        'phpdoc_types_order' => true,\n        'phpdoc_var_annotation_correct_order' => true,\n        'phpdoc_var_without_name' => true,\n        'pow_to_exponentiation' => true,\n        'protected_to_private' => true,\n        'return_assignment' => true,\n        'return_type_declaration' => ['space_before' => 'none'],\n        'self_accessor' => true,\n        'self_static_accessor' => true,\n        'semicolon_after_instruction' => true,\n        'set_type_to_cast' => true,\n        'short_scalar_cast' => true,\n        'simple_to_complex_string_variable' => true,\n        'simplified_null_return' => false,\n        'single_blank_line_at_eof' => true,\n        'single_class_element_per_statement' => true,\n        'single_import_per_statement' => true,\n        'single_line_after_imports' => true,\n        'single_line_comment_spacing' => true,\n        'single_quote' => true,\n        'single_space_around_construct' => true,\n        'single_trait_insert_per_statement' => true,\n        'space_after_semicolon' => true,\n        'spaces_inside_parentheses' => [\n            'space' => 'none',\n        ],\n        'standardize_increment' => true,\n        'standardize_not_equals' => true,\n        'statement_indentation' => true,\n        'static_lambda' => true,\n        'strict_param' => true,\n        'string_length_to_empty'=> true,\n        'string_line_ending' => true,\n        'switch_case_semicolon_to_colon' => true,\n        'switch_case_space' => true,\n        'switch_continue_to_break' => true,\n        'ternary_operator_spaces' => true,\n        'ternary_to_elvis_operator' => true,\n        'ternary_to_null_coalescing' => true,\n        'trailing_comma_in_multiline' => [\n            'elements' => [\n                'arguments',\n                'arrays',\n                'match',\n            ]\n        ],\n        'trim_array_spaces' => true,\n        'type_declaration_spaces' => [\n            'elements' => [\n                'function',\n            ],\n        ],\n        'types_spaces' => true,\n        'unary_operator_spaces' => true,\n        'visibility_required' => [\n            'elements' => [\n                'const',\n                'method',\n                'property',\n            ],\n        ],\n        'void_return' => true,\n        'whitespace_after_comma_in_array' => true,\n    ]);\n\n$config->setCacheFile(__DIR__ . '/.php-cs-fixer.cache/' . json_decode((string) @file_get_contents('composer.json'), true)[\"extra\"][\"branch-alias\"][\"dev-main\"] ?? 'unknown');\n\n$config->setParallelConfig(\\PhpCsFixer\\Runner\\Parallel\\ParallelConfigFactory::detect());\n\nreturn $config;\n"
  },
  {
    "path": "ChangeLog.md",
    "content": "# Change Log\n\nAll notable changes to `sebastianbergmann/code-unit-reverse-lookup` are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.\n\n## [4.0.1] - 2024-07-03\n\n### Changed\n\n* This project now uses PHPStan instead of Psalm for static analysis\n\n## [4.0.0] - 2024-02-02\n\n### Removed\n\n* This component is no longer supported on PHP 8.1\n\n## [3.0.0] - 2023-02-03\n\n### Removed\n\n* This component is no longer supported on PHP 7.3, PHP 7.4, and PHP 8.0\n\n## [2.0.3] - 2020-09-28\n\n### Changed\n\n* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3`\n\n## [2.0.2] - 2020-06-26\n\n### Added\n\n* This component is now supported on PHP 8\n\n## [2.0.1] - 2020-06-15\n\n### Changed\n\n* Tests etc. are now ignored for archive exports\n\n## 2.0.0 - 2020-02-07\n\n### Removed\n\n* This component is no longer supported on PHP 5.6, PHP 7.0, PHP 7.1, and PHP 7.2\n\n## 1.0.0 - 2016-02-13\n\n### Added\n\n* Initial release\n\n[4.0.1]: https://github.com/sebastianbergmann/code-unit-reverse-lookup/compare/4.0.0...4.0.1\n[4.0.0]: https://github.com/sebastianbergmann/code-unit-reverse-lookup/compare/3.0...4.0.0\n[3.0.0]: https://github.com/sebastianbergmann/code-unit-reverse-lookup/compare/2.0.3...3.0.0\n[2.0.3]: https://github.com/sebastianbergmann/code-unit-reverse-lookup/compare/2.0.2...2.0.3\n[2.0.2]: https://github.com/sebastianbergmann/code-unit-reverse-lookup/compare/2.0.1...2.0.2\n[2.0.1]: https://github.com/sebastianbergmann/code-unit-reverse-lookup/compare/2.0.0...2.0.1\n[2.0.0]: https://github.com/sebastianbergmann/code-unit-reverse-lookup/compare/1.0.0...2.0.0\n"
  },
  {
    "path": "LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2016-2025, Sebastian Bergmann\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "README.md",
    "content": "[![No Maintenance Intended](https://unmaintained.tech/badge.svg)](https://unmaintained.tech/)\n[![Latest Stable Version](https://poser.pugx.org/sebastian/code-unit-reverse-lookup/v)](https://packagist.org/packages/sebastian/code-unit-reverse-lookup)\n[![CI Status](https://github.com/sebastianbergmann/code-unit-reverse-lookup/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/code-unit-reverse-lookup/actions)\n[![codecov](https://codecov.io/gh/sebastianbergmann/code-unit-reverse-lookup/branch/main/graph/badge.svg)](https://codecov.io/gh/sebastianbergmann/code-unit-reverse-lookup)\n\n# sebastian/code-unit-reverse-lookup\n\nLooks up which function or method a line of code belongs to.\n\n## Installation\n\nYou can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):\n\n```\ncomposer require sebastian/code-unit-reverse-lookup\n```\n\nIf you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:\n\n```\ncomposer require --dev sebastian/code-unit-reverse-lookup\n```\n\nPlease note that this is now a [low maintenance project](https://github.com/sebastianbergmann/code-unit-reverse-lookup/blob/main/.github/CONTRIBUTING.md#low-maintenance-project).\n"
  },
  {
    "path": "SECURITY.md",
    "content": "# Security Policy\n\nIf you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure.\n\n**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.**\n\nInstead, please email `sebastian@phpunit.de`.\n\nPlease include as much of the information listed below as you can to help us better understand and resolve the issue:\n\n* The type of issue\n* Full paths of source file(s) related to the manifestation of the issue\n* The location of the affected source code (tag/branch/commit or direct URL)\n* Any special configuration required to reproduce the issue\n* Step-by-step instructions to reproduce the issue\n* Proof-of-concept or exploit code (if possible)\n* Impact of the issue, including how an attacker might exploit the issue\n\nThis information will help us triage your report more quickly.\n\n## Web Context\n\nThe library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit.\n\nThe library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes.\n\nIf the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context.\n\nVulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes.\n\n"
  },
  {
    "path": "build/scripts/extract-release-notes.php",
    "content": "#!/usr/bin/env php\n<?php declare(strict_types=1);\nif ($argc !== 2) {\n    print $argv[0] . ' <tag>' . PHP_EOL;\n\n    exit(1);\n}\n\n$version = $argv[1];\n\n$file = __DIR__ . '/../../ChangeLog.md';\n\nif (!is_file($file) || !is_readable($file)) {\n    print $file . ' cannot be read' . PHP_EOL;\n\n    exit(1);\n}\n\n$buffer = '';\n$append = false;\n\nforeach (file($file) as $line) {\n    if (str_starts_with($line, '## [' . $version . ']')) {\n        $append = true;\n\n        continue;\n    }\n\n    if ($append && (str_starts_with($line, '## ') || str_starts_with($line, '['))) {\n        break;\n    }\n\n    if ($append) {\n        $buffer .= $line;\n    }\n}\n\n$buffer = trim($buffer);\n\nif ($buffer === '') {\n    print 'Unable to extract release notes' . PHP_EOL;\n\n    exit(1);\n}\n\nprint $buffer . PHP_EOL;\n"
  },
  {
    "path": "build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"code-unit-reverse-lookup\" default=\"setup\">\n    <target name=\"setup\" depends=\"clean,install-dependencies\"/>\n\n    <target name=\"clean\" description=\"Cleanup build artifacts\">\n        <delete dir=\"${basedir}/vendor\"/>\n        <delete file=\"${basedir}/composer.lock\"/>\n    </target>\n\n    <target name=\"install-dependencies\" depends=\"clean\" description=\"Install dependencies with Composer\">\n        <exec executable=\"${basedir}/tools/composer\" taskname=\"composer\">\n            <arg value=\"update\"/>\n            <arg value=\"--no-interaction\"/>\n            <arg value=\"--no-progress\"/>\n            <arg value=\"--no-ansi\"/>\n        </exec>\n    </target>\n\n    <target name=\"update-tools\">\n        <exec executable=\"phive\" taskname=\"phive\">\n            <arg value=\"--no-progress\"/>\n            <arg value=\"update\"/>\n            <arg value=\"--force-accept-unsigned\"/>\n        </exec>\n    </target>\n</project>\n\n"
  },
  {
    "path": "composer.json",
    "content": "{\n    \"name\": \"sebastian/code-unit-reverse-lookup\",\n    \"description\": \"Looks up which function or method a line of code belongs to\",\n    \"homepage\": \"https://github.com/sebastianbergmann/code-unit-reverse-lookup/\",\n    \"license\": \"BSD-3-Clause\",\n    \"authors\": [\n        {\n            \"name\": \"Sebastian Bergmann\",\n            \"email\": \"sebastian@phpunit.de\"\n        }\n    ],\n    \"support\": {\n        \"issues\": \"https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues\",\n        \"security\": \"https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy\"\n    },\n    \"config\": {\n        \"platform\": {\n            \"php\": \"8.2.0\"\n        },\n        \"optimize-autoloader\": true,\n        \"sort-packages\": true\n    },\n    \"prefer-stable\": true,\n    \"require\": {\n        \"php\": \">=8.2\"\n    },\n    \"require-dev\": {\n        \"phpunit/phpunit\": \"^11.3\"\n    },\n    \"autoload\": {\n        \"classmap\": [\n            \"src/\"\n        ]\n    },\n    \"extra\": {\n        \"branch-alias\": {\n            \"dev-main\": \"4.0-dev\"\n        }\n    }\n}\n"
  },
  {
    "path": "phpstan.neon",
    "content": "parameters:\n    level: 10\n    paths:\n        - src\n        - tests\n"
  },
  {
    "path": "phpunit.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:noNamespaceSchemaLocation=\"vendor/phpunit/phpunit/phpunit.xsd\"\n         bootstrap=\"vendor/autoload.php\"\n         cacheDirectory=\".phpunit.cache\"\n         executionOrder=\"depends,defects\"\n         shortenArraysForExportThreshold=\"10\"\n         requireCoverageMetadata=\"true\"\n         beStrictAboutCoverageMetadata=\"true\"\n         beStrictAboutOutputDuringTests=\"true\"\n         displayDetailsOnPhpunitDeprecations=\"true\"\n         failOnPhpunitDeprecation=\"true\"\n         failOnRisky=\"true\"\n         failOnWarning=\"true\"\n         colors=\"true\">\n    <testsuites>\n        <testsuite name=\"default\">\n            <directory>tests</directory>\n        </testsuite>\n    </testsuites>\n\n    <source ignoreIndirectDeprecations=\"true\" restrictNotices=\"true\" restrictWarnings=\"true\">\n        <include>\n            <directory>src</directory>\n        </include>\n    </source>\n</phpunit>\n"
  },
  {
    "path": "src/Wizard.php",
    "content": "<?php declare(strict_types=1);\n/*\n * This file is part of sebastian/code-unit-reverse-lookup.\n *\n * (c) Sebastian Bergmann <sebastian@phpunit.de>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nnamespace SebastianBergmann\\CodeUnitReverseLookup;\n\nuse function array_merge;\nuse function assert;\nuse function class_exists;\nuse function get_declared_classes;\nuse function get_declared_traits;\nuse function get_defined_functions;\nuse function is_int;\nuse function is_string;\nuse function range;\nuse function trait_exists;\nuse ReflectionClass;\nuse ReflectionFunction;\nuse ReflectionMethod;\n\nfinal class Wizard\n{\n    /**\n     * @var array<string, array<int, string>>\n     */\n    private array $lookupTable = [];\n\n    /**\n     * @var array<class-string, true>\n     */\n    private array $processedClasses = [];\n\n    /**\n     * @var array<string, true>\n     */\n    private array $processedFunctions = [];\n\n    public function lookup(string $filename, int $lineNumber): string\n    {\n        if (!isset($this->lookupTable[$filename][$lineNumber])) {\n            $this->updateLookupTable();\n        }\n\n        if (isset($this->lookupTable[$filename][$lineNumber])) {\n            return $this->lookupTable[$filename][$lineNumber];\n        }\n\n        return $filename . ':' . $lineNumber;\n    }\n\n    private function updateLookupTable(): void\n    {\n        $this->processClassesAndTraits();\n        $this->processFunctions();\n    }\n\n    private function processClassesAndTraits(): void\n    {\n        $classes = get_declared_classes();\n        $traits  = get_declared_traits();\n\n        foreach (array_merge($classes, $traits) as $classOrTrait) {\n            assert(class_exists($classOrTrait) || trait_exists($classOrTrait));\n\n            if (isset($this->processedClasses[$classOrTrait])) {\n                continue;\n            }\n\n            foreach ((new ReflectionClass($classOrTrait))->getMethods() as $method) {\n                $this->processFunctionOrMethod($method);\n            }\n\n            $this->processedClasses[$classOrTrait] = true;\n        }\n    }\n\n    private function processFunctions(): void\n    {\n        foreach (get_defined_functions()['user'] as $function) {\n            if (isset($this->processedFunctions[$function])) {\n                continue;\n            }\n\n            $this->processFunctionOrMethod(new ReflectionFunction($function));\n\n            $this->processedFunctions[$function] = true;\n        }\n    }\n\n    private function processFunctionOrMethod(ReflectionFunction|ReflectionMethod $functionOrMethod): void\n    {\n        if ($functionOrMethod->isInternal()) {\n            return;\n        }\n\n        $name = $functionOrMethod->getName();\n\n        if ($functionOrMethod instanceof ReflectionMethod) {\n            $name = $functionOrMethod->getDeclaringClass()->getName() . '::' . $name;\n        }\n\n        $fileName = $functionOrMethod->getFileName();\n\n        assert(is_string($fileName));\n\n        if (!isset($this->lookupTable[$fileName])) {\n            $this->lookupTable[$fileName] = [];\n        }\n\n        $startLine = $functionOrMethod->getStartLine();\n        $endLine   = $functionOrMethod->getEndLine();\n\n        assert(is_int($startLine));\n        assert(is_int($endLine));\n        assert($endLine >= $startLine);\n\n        foreach (range($startLine, $endLine) as $line) {\n            $this->lookupTable[$fileName][$line] = $name;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/WizardTest.php",
    "content": "<?php declare(strict_types=1);\n/*\n * This file is part of sebastian/code-unit-reverse-lookup.\n *\n * (c) Sebastian Bergmann <sebastian@phpunit.de>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nnamespace SebastianBergmann\\CodeUnitReverseLookup;\n\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\Depends;\nuse PHPUnit\\Framework\\TestCase;\n\n#[CoversClass(Wizard::class)]\nfinal class WizardTest extends TestCase\n{\n    private Wizard $wizard;\n\n    protected function setUp(): void\n    {\n        $this->wizard = new Wizard;\n    }\n\n    public function testMethodCanBeLookedUp(): Wizard\n    {\n        require __DIR__ . '/_fixture/Foo.php';\n\n        $this->assertEquals(\n            'Foo::method',\n            $this->wizard->lookup(\n                __DIR__ . '/_fixture/Foo.php',\n                12,\n            ),\n        );\n\n        return $this->wizard;\n    }\n\n    #[Depends('testMethodCanBeLookedUp')]\n    public function testMethodCanBeLookedUp2(Wizard $wizard): void\n    {\n        require __DIR__ . '/_fixture/Bar.php';\n\n        $this->assertEquals(\n            'Bar::method',\n            $wizard->lookup(\n                __DIR__ . '/_fixture/Bar.php',\n                12,\n            ),\n        );\n    }\n\n    public function testReturnsFilenameAndLineNumberAsStringWhenNotInCodeUnit(): void\n    {\n        $this->assertEquals(\n            'file.php:1',\n            $this->wizard->lookup('file.php', 1),\n        );\n    }\n}\n"
  },
  {
    "path": "tests/_fixture/Bar.php",
    "content": "<?php declare(strict_types=1);\n/*\n * This file is part of sebastian/code-unit-reverse-lookup.\n *\n * (c) Sebastian Bergmann <sebastian@phpunit.de>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nclass Bar\n{\n    public function method(): void\n    {\n        // ...\n    }\n}\n"
  },
  {
    "path": "tests/_fixture/Foo.php",
    "content": "<?php declare(strict_types=1);\n/*\n * This file is part of sebastian/code-unit-reverse-lookup.\n *\n * (c) Sebastian Bergmann <sebastian@phpunit.de>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nclass Foo\n{\n    public function method(): void\n    {\n        // ...\n    }\n}\n"
  }
]