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

Request #19863 Sniff to detect php_sapi_name() instead of PHP_SAPI
Submitted: 2013-03-20 17:09 UTC
From: hashar Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version SVN)
PHP Version: Irrelevant OS: Mac
Roadmaps: (Not assigned)    
Subscription  


 [2013-03-20 17:09 UTC] hashar (Antoine Musso)
Description: ------------ MediaWiki used php_sapi_name() and we switched to use the constant PHP_SAPI ( https://bugzilla.wikimedia.org/show_bug.cgi?id=37957 ) The constant has been made available in PHP 4.2.0, it is more concise and has less overhead than a function call. Would you mind creating a Sniff that detects php_sapi_name() usage and suggest to use PHP_SAPI constant instead? Thanks!

Comments

 [2013-03-20 17:10 UTC] hashar (Antoine Musso)
 [2013-03-26 03:42 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Feedback -Assigned To: +Assigned To: squiz
I can't do all sniff requests, but this was a fairly easy one. I've committed it here: https://github.com/squizlabs/PHP_CodeSniffer/commit/9ed379422f81fa378fcf2af5f9f8 eddf39d07cc5 And it will be in the 1.4.5 release, which should be out within a couple of weeks. Can you please check this sniff to ensure it does what you are after.
 [2013-05-08 04:13 UTC] krinkle (Timo Tijhof)
Thanks, works as expected.
 [2013-09-25 06:43 UTC] squiz (Greg Sherwood)
-Status: Feedback +Status: Closed