Copyright   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A copyright() 0 8 2
1
<?php
2
3
/**
4
 * KNUT7 K7F (https://marciozebedeu.com/)
5
 * KNUT7 K7F (tm) : Rapid Development Framework (https://marciozebedeu.com/)
6
 *
7
 * Licensed under The MIT License
8
 * For full copyright and license information, please see the LICENSE.txt
9
 * Redistributions of files must retain the above copyright notice.
10
 *
11
 * @link      https://github.com/knut7/framework/ for the canonical source repository
12
 * @copyright (c) 2015.  KNUT7  Software Technologies AO Inc. (https://marciozebedeu.com/)
13
 * @license   https://marciozebedeu.com/license/new-bsd New BSD License
14
 * @author    Marcio Zebedeu - [email protected]
15
 * @version   1.0.2
16
 */
17
18
namespace Ballybran\Helpers\Copyright;
19
20
use Ballybran\Helpers\Security\ValidateTypes;
21
22
class Copyright extends ValidateTypes implements CopyrightInterface
23
{
24
25
    private static $date;
26
    private static $data_last = 2015;
27
28
    public static function copyright(int $data_last = NULL, string $name = "knut7 FRAMWORK")
29
    {
30
31
        self::$date = date('y');
32
        if (self::getSQLValueString($data_last, 'int')) {
0 ignored issues
show
Bug Best Practice introduced by
The expression self::getSQLValueString($data_last, 'int') of type integer|null is loosely compared to true; this is ambiguous if the integer can be 0. You might want to explicitly use !== null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For integer values, zero is a special case, in particular the following results might be unexpected:

0   == false // true
0   == null  // true
123 == false // false
123 == null  // false

// It is often better to use strict comparison
0 === false // false
0 === null  // false
Loading history...
33
            return "Copyright (c)\n" . $data_last . "\n-" . self::$date . "\n" . $name . "\n" . "All Rights Reserved";
34
        }
35
        return "Copyright (c)\n" . self::$data_last . "\n-" . self::$date . "\n" . $name . "\n" . "All Rights Reserved";
36
37
    }
38
39
}
40