for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace XoopsModules\About;
/**
* About
*
* 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 The XOOPS Co.Ltd. http://www.xoops.com.cn
* @copyright XOOPS Project (https://xoops.org)
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
* @package about
* @since 1.0.0
* @author Susheng Yang <[email protected]>
*/
require_once XOOPS_ROOT_PATH . '/class/xoopsform/form.php';
* Class BlockForm
class BlockForm extends \XoopsForm
{
* BlockForm constructor.
public function __construct()
}
* create HTML to output the form as a table
* @return string
public function render()
$ret = '<div>';
$hidden = '';
foreach ($this->getElements() as $ele) {
if (!\is_object($ele)) {
$ret .= $ele;
} elseif (!$ele->isHidden()) {
if ('' !== ($caption = $ele->getCaption())) {
$ret .= "<div class='xoops-form-element-caption" . ($ele->isRequired() ? '-required' : '') . "'>" . "<span class='caption-text'><strong>{$caption}</strong></span>" . "<span class='caption-marker'>*</span>" . '</div>';
$ret .= "<div style='margin:5px 0 8px 0; '>" . $ele->render() . "</div>\n";
$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.
} else {
$hidden .= $ele->render();
$ret .= '</div>';
$ret .= $this->renderValidationJS(true);
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.