Automattic / Automattic/phpcs-neutron-standard

Static analysis reveals few errors

Open
#76 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
PHP
Stars
93
Forks
9
PR merge metrics
No merged PRs in 30d

Description

```
------ -----------------------------------------------------------------------------------------------------------
Line SniffHelpers.php
------ -----------------------------------------------------------------------------------------------------------
49 Parameter #1 $types of method PHP_CodeSniffer\Files\File::findPrevious() expects array|int, string given.
53 Parameter #3 $end of method PHP_CodeSniffer\Files\File::findPrevious() expects int|null, int|true given.
67 Parameter #1 $types of method PHP_CodeSniffer\Files\File::findNext() expects array|int, string given.
75 Parameter #1 $types of method PHP_CodeSniffer\Files\File::findNext() expects array|int, string given.
83 Parameter #1 $types of method PHP_CodeSniffer\Files\File::findNext() expects array|int, string given.
90 Parameter #1 $types of method PHP_CodeSniffer\Files\File::findNext() expects array|int, string given.
101 Parameter #1 $types of method PHP_CodeSniffer\Files\File::findNext() expects array|int, string given.
------ -----------------------------------------------------------------------------------------------------------

------ ----------------------------------------------------------------------------------------------------------------------------------
Line Sniffs/Conditions/DisallowConditionAssignWithoutConditionalSniff.php
------ ----------------------------------------------------------------------------------------------------------------------------------
10 Method NeutronStandard\Sniffs\Conditions\DisallowConditionAssignWithoutConditionalSniff::register() should return array but
returns array.
22 Parameter #1 $types of method PHP_CodeSniffer\Files\File::findNext() expects array|int, string given.
------ ----------------------------------------------------------------------------------------------------------------------------------

------ --------------------------------------------------------------------------------------------------------------------------------
Line Sniffs/Functions/TypeHintSniff.php
------ --------------------------------------------------------------------------------------------------------------------------------
11 Method NeutronStandard\Sniffs\Functions\TypeHintSniff::register() should return array but returns array.
------ --------------------------------------------------------------------------------------------------------------------------------

------ -------------------------------------------------------------------------------------------------------------------------------------
Line Sniffs/Whitespace/RequireParenthesisSpacingSniff.php
------ -------------------------------------------------------------------------------------------------------------------------------------
11 Method NeutronStandard\Sniffs\Whitespace\RequireParenthesisSpacingSniff::register() should return array but returns array.
------ -------------------------------------------------------------------------------------------------------------------------------------
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reported lines in SniffHelpers.php, then inspect register() in the three listed sniff files and the PHP_CodeSniffer File::findNext()/findPrevious() calls. Run the static-analysis check to reproduce the report; done means these reported type errors are resolved and the check passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.