for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Bonfim\Tpl\Tag;
class Loop extends Tag
{
public function __construct()
$this->foreach();
$this->endforeach();
$this->for();
$this->endfor();
}
private function for()
self::match('/\s*@\s*for\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*for\s*\((.*?)\)\s*$/m', function ($cond) {
self::replace("<?php for ($cond) : ?>");
Bonfim\Tpl\Tag\Tag::replace()
replace("<?php for ($cond) : ?>");
});
private function endfor()
self::match('/@\s*\/for/', function () {
match('/@\s*\/for/', function () {
self::replace("<?php endfor ?>");
replace("<?php endfor ?>");
private function foreach()
self::match('/\s*@\s*foreach\s*\((.*?)\)\s*$/m', function ($cond) {
match('/\s*@\s*foreach\s*\((.*?)\)\s*$/m', function ($cond) {
self::replace("<?php foreach ($cond) : ?>");
replace("<?php foreach ($cond) : ?>");
private function endforeach()
self::match('/@\s*\/foreach/', function () {
match('/@\s*\/foreach/', function () {
self::replace("<?php endforeach ?>");
replace("<?php endforeach ?>");
self::match('/@\s*endforeach/', function () {