Passed
Push — master ( 2ecc51...c1b656 )
by Michael
04:26 queued 02:02
created

XoopsFormDate::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 4
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/*
3
 * You may not change or alter any portion of this comment or credits
4
 * of supporting developers from this source code or any supporting source code
5
 * which is considered copyrighted (c) material of the original comment or credit authors.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
 */
11
12
/**
13
 * @copyright    {@link https://xoops.org/ XOOPS Project}
14
 * @license      {@link http://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later}
15
 * @package
16
 * @since
17
 * @author       XOOPS Development Team,
18
 */
19
20
defined('XOOPS_ROOT_PATH') || exit('XOOPS Root Path not defined');
21
22
/**
23
 * Class XoopsFormDate extends form classes for date selection
24
 * @author    EFQ Consultancy <[email protected]>
25
 * @copyright EFQ Consultancy (c) 2007
26
 * @version   1.0.0
27
 *
28
 * @param   array $listing Array with listing details
29
 */
30
class XoopsFormDate extends XoopsFormElementTray
0 ignored issues
show
Bug introduced by
The type XoopsFormElementTray was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
31
{
32
    /**
33
     * Function XoopsFormDate adds form element for selecting Date
34
     * @author    EFQ Consultancy <[email protected]>
35
     * @copyright EFQ Consultancy (c) 2007
36
     * @version   1.0.0
37
     *
38
     * @param string $caption
39
     * @param string $name
40
     * @param int    $size
41
     * @param string $value
42
     * @internal  param array $listing Array with listing details
43
     */
44
    public function __construct($caption, $name, $size = 15, $value = '')
45
    {
46
        parent::__construct($caption, '&nbsp;');
47
        $datetime = getdate($value);
0 ignored issues
show
Bug introduced by
$value of type string is incompatible with the type integer expected by parameter $timestamp of getdate(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

47
        $datetime = getdate(/** @scrutinizer ignore-type */ $value);
Loading history...
Unused Code introduced by
The assignment to $datetime is dead and can be removed.
Loading history...
48
        $this->addElement(new XoopsFormTextDateSelect('', $name, $size, $value));
0 ignored issues
show
Bug introduced by
The type XoopsFormTextDateSelect was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
49
    }
50
}
51