Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Bug #19764 Instead of for traits throws uppercase constant name errors
Submitted: 2013-01-01 19:17 UTC
From: hinikato Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version SVN)
PHP Version: 5.4.7 OS: Windows 7
Roadmaps: (Not assigned)    
Subscription  


 [2013-01-01 19:17 UTC] hinikato (Hinikato Dubrai)
Description: ------------ This use case don't recognized right. Also the PSR-2 don't contain recommendations (descriptions) about use statements for traits, so the following code must be right too: use TProperties, TReflected; // it is a valid code Test script: --------------- <?php namespace Myak\Base; class Object implements IObject { use TProperties; use TReflected { TReflected::reflect insteadof TProperties; } public function __toString() { return $this->getHash(); } public function getHash() { return spl_object_hash($this); } } Expected result: ---------------- File is valid. Actual result: -------------- FILE: I:\project\myak\framework\src\lib\Myak\Base\Object.php -------------------------------------------------------------------------------- FOUND 4 ERROR(S) AFFECTING 3 LINE(S) -------------------------------------------------------------------------------- 8 | ERROR | There must be one blank line after the last USE statement; 0 | | found; 9 | ERROR | Constants must be uppercase; expected REFLECT but found reflect 9 | ERROR | Constants must be uppercase; expected TPROPERTIES but found | | TProperties --------------------------------------------------------------------------------

Comments

 [2013-01-07 03:51 UTC] squiz (Greg Sherwood)
-Summary: Instead of for traits don't recognized right. +Summary: Instead of for traits throws uppercase constant name errors -Assigned To: +Assigned To: squiz
 [2013-01-07 03:54 UTC] squiz (Greg Sherwood)
-Status: Assigned +Status: Closed
Fix committed to github repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/cc0c8bfdeb47c692485254635cc 1ff1265660e7e