Closed
Description
Preconditions
Steps to reproduce
- Try processing a class that has typed properties. Here's a sample:
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\TestFramework\Store;
class StoreManager
{
/**
* @var \Magento\Store\Model\StoreManager
*/
private \Magento\Store\Model\StoreManager $decoratedStoreManager;
/**
* Constructor
*
* @param \Magento\Store\Model\StoreManager $decoratedStoreManager
*/
public function __construct(
\Magento\Store\Model\StoreManager $decoratedStoreManager
) {
$this->decoratedStoreManager = $decoratedStoreManager;
}
/**
* Test
*
* @return null
*/
public function test() {
return null;
}
}
Expected result
- The class can be processed
Actual result
- Processing fails with the following error:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | An error occurred during processing; checking has been aborted. The error message was: Undefined index: comment_opener in /home/bgorski/devilbox/data/www/github-magento2-ce/htdocs/vendor/magento/magento-coding-standard/Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php on
| | line 71
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This prevents phpcs from processing the class any further.
That's the token wrongly interpreted as a comment closing:
array(8) {
["code"]=>
int(393)
["type"]=>
string(14) "T_NS_SEPARATOR"
["content"]=>
string(1) "\"
["line"]=>
int(13)
["column"]=>
int(33)
["length"]=>
int(1)
["level"]=>
int(1)
["conditions"]=>
array(1) {
[26]=>
int(364)
}
}