for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Bonfim\Tpl\Tag;
class Condition extends Tag
{
public function __construct()
$this->if();
$this->elseif();
$this->else();
$this->endif();
}
public function if()
self::match('/\s*@\s*if\s*\((.*?)\)\s*$/m', function($cond) {
Bonfim\Tpl\Tag\Tag::match()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
self::/** @scrutinizer ignore-call */
match('/\s*@\s*if\s*\((.*?)\)\s*$/m', function($cond) {
self::replace("<?php if ($cond) : ?>");
Bonfim\Tpl\Tag\Tag::replace()
replace("<?php if ($cond) : ?>");
});
public function elseif() {
self::match('/\s*@\s*elseif\s*\((.*?)\)\s*$/m', function($cond) {
match('/\s*@\s*elseif\s*\((.*?)\)\s*$/m', function($cond) {
self::replace("<?php elseif ($cond) : ?>");
replace("<?php elseif ($cond) : ?>");
public function else()
self::match('/@\s*else/', function () {
match('/@\s*else/', function () {
self::replace("<?php else : ?>");
replace("<?php else : ?>");
public function endif()
self::match('/@\s*\/if/', function () {
match('/@\s*\/if/', function () {
self::replace("<?php endif ?>");
replace("<?php endif ?>");
self::match('/@\s*endif/', function () {