for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Zikula package.
*
* Copyright Zikula Foundation - http://zikula.org/
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Zikula\BlocksModule\Block;
use Zikula\BlocksModule\AbstractBlockHandler;
/**
* Block to display the contents of a file given a path.
class FincludeBlock extends AbstractBlockHandler
{
public function display(array $properties)
if (!$this->hasPermission('fincludeblock::', "$properties[title]::", ACCESS_READ)) {
return '';
}
switch ($properties['typo']) {
case 0: // Html
return file_get_contents($properties['filo']);
break;
break
The break statement is not necessary if it is preceded for example by a return statement:
switch ($x) { case 1: return 'foo'; break; // This break is not necessary and can be left off. }
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.
case 1: // Text
return htmlspecialchars(file_get_contents($properties['filo']));
case 2: // PHP
ob_start();
include \DataUtil::formatForOS($properties['filo']);
return ob_get_clean();
default:
public function getFormClassName()
return 'Zikula\BlocksModule\Block\Form\Type\FincludeBlockType';
public function getFormOptions()
return ['translator' => $this->getTranslator()];
public function getType()
return $this->__("File Include");
The break statement is not necessary if it is preceded for example by a return statement:
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.