PropertyDoesNotExistException::trigger()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
loc 5
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php
2
/**
3
 * ShouldPHP
4
 *
5
 * @author  Gabriel Jacinto <[email protected]>
6
 * @status  dev
7
 * @link    https://github.com/GabrielJMJ/ShouldPHP
8
 * @license MIT
9
 */
10
11
namespace Gabrieljmj\Should\Exception;
12
13
use Gabrieljmj\Should\Exception\ExceptionCodes;
14
15 View Code Duplication
class PropertyDoesNotExistException extends \InvalidArgumentException
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
16
{
17
    public static function trigger($class, $property)
18
    {
19
        $class = is_object($class) ? get_class($class) : $class;
20
        throw new PropertyDoesNotExistException('The property ' . $class . '::$' . $property . ' does not exist', ExceptionCodes::PROPERTY_DOES_NOT_EXIST);
21
    }
22
}