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

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


 [2013-03-20 13: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 13:10 UTC] hashar (Antoine Musso)
 [2013-03-25 23: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-07 23:13 UTC] krinkle (Timo Tijhof)
Thanks, works as expected.
 [2013-09-25 01:43 UTC] squiz (Greg Sherwood)
-Status: Feedback +Status: Closed