@@ 65-76 (lines=12) @@ | ||
62 | * |
|
63 | * @throws InvalidArgumentException |
|
64 | */ |
|
65 | public function setType($type) |
|
66 | { |
|
67 | if (!in_array($type, self::$types, true)) { |
|
68 | throw new InvalidArgumentException(sprintf( |
|
69 | '"%s" is not a valid type! Valid types: %s', |
|
70 | $type, |
|
71 | implode(', ', self::$types) |
|
72 | )); |
|
73 | } |
|
74 | ||
75 | $this->type = $type; |
|
76 | } |
|
77 | ||
78 | /** |
|
79 | * {@inheritdoc} |
@@ 52-63 (lines=12) @@ | ||
49 | * |
|
50 | * @throws InvalidArgumentException |
|
51 | */ |
|
52 | public function setType($type) |
|
53 | { |
|
54 | if (!in_array($type, self::$types, true)) { |
|
55 | throw new InvalidArgumentException(sprintf( |
|
56 | '"%s" is not a valid type! Valid types: %s', |
|
57 | $type, |
|
58 | implode(', ', self::$types) |
|
59 | )); |
|
60 | } |
|
61 | ||
62 | $this->type = $type; |
|
63 | } |
|
64 | ||
65 | /** |
|
66 | * {@inheritdoc} |
@@ 112-122 (lines=11) @@ | ||
109 | * |
|
110 | * @return $this |
|
111 | */ |
|
112 | protected function setType($type) |
|
113 | { |
|
114 | if (!in_array($type, self::$types, true)) { |
|
115 | $message = sprintf('"%s" is not a valid type! Valid types: %s', $type, implode(', ', self::$types)); |
|
116 | throw new InvalidArgumentException($message); |
|
117 | } |
|
118 | ||
119 | $this->type = $type; |
|
120 | ||
121 | return $this; |
|
122 | } |
|
123 | } |
|
124 |
@@ 55-66 (lines=12) @@ | ||
52 | * |
|
53 | * @throws InvalidArgumentException |
|
54 | */ |
|
55 | public function setType($type) |
|
56 | { |
|
57 | if (!in_array($type, self::$types)) { |
|
58 | throw new InvalidArgumentException(sprintf( |
|
59 | '"%s" is not a valid type! Valid types: %s', |
|
60 | $type, |
|
61 | implode(', ', self::$types) |
|
62 | )); |
|
63 | } |
|
64 | ||
65 | $this->type = $type; |
|
66 | } |
|
67 | } |
|
68 |
@@ 48-59 (lines=12) @@ | ||
45 | return true; |
|
46 | } |
|
47 | ||
48 | public function setType($type) |
|
49 | { |
|
50 | if (!in_array($type, self::$types)) { |
|
51 | throw new InvalidArgumentException(sprintf( |
|
52 | '"%s" is not a valid type! Valid types: %s', |
|
53 | $type, |
|
54 | implode(', ', self::$types) |
|
55 | )); |
|
56 | } |
|
57 | ||
58 | $this->type = $type; |
|
59 | } |
|
60 | } |
|
61 |