Completed
Pull Request — develop (#147)
by Wachter
14:07
created

ParameterNotAllowedException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 44
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getProperty() 0 4 1
A getClass() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of Sulu.
5
 *
6
 * (c) MASSIVE ART WebServices GmbH
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Sulu\Bundle\ArticleBundle\Exception;
13
14
/**
15
 * Thrown when parameter is not allowed.
16
 */
17
class ParameterNotAllowedException extends \Exception
18
{
19
    /**
20
     * @var string
21
     */
22
    private $property;
23
24
    /**
25
     * @var string
26
     */
27
    private $class;
28
29
    /**
30
     * @param string $property
31
     * @param string $class
32
     */
33
    public function __construct($property, $class)
34
    {
35
        parent::__construct(sprintf('Parameter "%s" is not allowed for class "%s".', $property, $class));
36
37
        $this->property = $property;
38
        $this->class = $class;
39
    }
40
41
    /**
42
     * Returns property.
43
     *
44
     * @return string
45
     */
46
    public function getProperty()
47
    {
48
        return $this->property;
49
    }
50
51
    /**
52
     * Returns class.
53
     *
54
     * @return string
55
     */
56
    public function getClass()
57
    {
58
        return $this->class;
59
    }
60
}
61