StaticTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 16
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
1
<?php
2
/**
3
 * Phossa Project
4
 *
5
 * PHP version 5.4
6
 *
7
 * @category  Library
8
 * @package   Phossa2\Shared
9
 * @copyright Copyright (c) 2016 phossa.com
10
 * @license   http://mit-license.org/ MIT License
11
 * @link      http://www.phossa.com/
12
 */
13
/*# declare(strict_types=1); */
14
15
namespace Phossa2\Shared\Base;
16
17
use Phossa2\Shared\Message\Message;
18
use Phossa2\Shared\Exception\RuntimeException;
19
20
/**
21
 * StaticTrait
22
 *
23
 * For used in a generic static class
24
 *
25
 * @package Phossa2\Shared
26
 * @author  Hong Zhang <[email protected]>
27
 * @version 2.0.0
28
 * @since   2.0.0 added
29
 */
30
trait StaticTrait
31
{
32
    /**
33
     * Finalized constructor to prevent instantiation.
34
     *
35
     * @access public
36
     * @final
37
     */
38
    final public function __construct()
39
    {
40
        throw new RuntimeException(
41
            Message::get(Message::MSG_CLASS_STATIC, get_called_class()),
42
            Message::MSG_CLASS_STATIC
43
        );
44
    }
45
}
46