Skip to content

Undefined array key "parenthesis_closer" #1423

Description

@LukeWCS

Describe the bug

--------------------------------------------------------------------------------
 1 | ERROR | An error occurred during processing; checking has been aborted.
   |       | The error message was: Undefined array key "parenthesis_closer" in
   |       | /vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php
   |       | on line 75
   |       | The error originated in the
   |       | Generic.Functions.OpeningFunctionBraceBsdAllman sniff on line 75.
--------------------------------------------------------------------------------

Code sample

Line 101 in acp_controller.php (see attachment)

	public function display_options(string): array

codesniffer#1423.zip

Variant 2

		public function add_page_header_link

To reproduce

Steps to reproduce the behavior:

  1. Create a file called test.php with the code sample above...
  2. Run phpcs test.php ...
  3. See error message displayed
PHPCS output here

Expected behavior

No program error. ^^

Versions (please complete the following information)

Operating System Windows 10/Linux
PHP version 8.5
PHP_CodeSniffer version 4.0.1 (0525c73)
Standard Generic
Install type Composer

Additional context

Hi Juliette

While sporadically reviewing the reports from my test suite "phpBB Ext Check," I noticed this error in one of the reports. Since all files are deleted from the server after the check, I can't post the code causing the error here. However, if the information provided here isn't sufficient to locate the problem, I would contact the developer to request the ZIP file that contains the error.

Please confirm

  • I have searched the issue list and am not opening a duplicate issue.
  • I have read the Contribution Guidelines and this is not a support question.
  • I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
  • I have verified the issue still exists in the 4.x branch of PHP_CodeSniffer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions