for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace XoopsModules\Modulebuilder\Form;
/**
* XOOPS simple form.
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* @copyright XOOPS Project (https://xoops.org)
* @license GNU GPL 2 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* @since 2.0.0
* @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/
*/
\defined('XOOPS_ROOT_PATH') || die('Restricted access');
/*
* base class
\XoopsLoad::load('XoopsFormLoader');
* Form that will output as a simple HTML form with minimum formatting.
class SimpleForm extends \XoopsForm
{
* create HTML to output the form with minimal formatting.
* @return string
public function render()
$ret = ($this->getTitle() ? '<div class=" center head ">' . $this->getTitle() . '</div>' : '');
$ret .= '<form name="' . $this->getName() . '" id="' . $this->getName() . '" action="' . $this->getAction() . '" method="' . $this->getMethod() . '"' . $this->getExtra() . '>' . NWLINE;
foreach ($this->getElements() as $ele) {
if (!$ele->isHidden()) {
$ret .= '<div class="' . $ele->getClass() . '"><strong>' . $ele->getCaption() . '</strong>' . $ele->render() . '</div>' . NWLINE;
$ele->render()
XoopsFormElement::render()
This check looks for function or method calls that always return null and whose return value is used.
class A { function getObject() { return null; } } $a = new A(); if ($a->getObject()) {
The method getObject() can return nothing but null, so it makes no sense to use the return value.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
$ele->getClass()
false|string
concatenation
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
ignore-type
$ret .= '<div class="' . /** @scrutinizer ignore-type */ $ele->getClass() . '"><strong>' . $ele->getCaption() . '</strong>' . $ele->render() . '</div>' . NWLINE;
} else {
$ret .= $ele->render();
}
$ret .= NWLINE . '</form>';
return $ret;
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.