hyva-themes / hyva-coding-standard

A set of Hyvä specific PHP CodeSniffer rules extending the Magento Coding Standard
BSD 3-Clause "New" or "Revised" License
26 stars 1 forks source link

Missing doc block error - undefined array key of -1 #1

Open rakibabu opened 2 years ago

rakibabu commented 2 years ago

Magento version: 2.4.5-p1 Hyva version: 1.2.0-beta2 Hyva coding standard version: 1.0.1

When running the php code standards, the sniffer is giving an error. If I add doc blocks to my interface the error is gone.

FILE: /Api/Actions/Orders/CreateOrderActionInterface.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | An error occurred during processing; checking has been aborted. The error message was: Undefined array key
   |       | -1 in /vendor/squizlabs/php_codesniffer/src/Files/File.php on line
   |       | 2183

I think a better error message would help more people to fix these issues faster.

Kind regards,

Rakibabu

Vinai commented 1 year ago

Can you run the Magento coding standard on your interface without error?