Skip to content

Commit 4fd4e60

Browse files
committed
Remove use statements
1 parent 8327db6 commit 4fd4e60

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

app/code/Magento/Backend/Model/Menu/Item/Validator.php

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
*/
66
namespace Magento\Backend\Model\Menu\Item;
77

8-
use BadMethodCallException;
9-
use InvalidArgumentException;
10-
use Zend_Validate;
11-
128
/**
139
* Class Validator
1410
*
@@ -35,7 +31,7 @@ class Validator
3531
/**
3632
* The list of primitive validators
3733
*
38-
* @var Zend_Validate[]
34+
* @var \Zend_Validate[]
3935
*/
4036
protected $_validators = [];
4137

@@ -44,17 +40,17 @@ class Validator
4440
*/
4541
public function __construct()
4642
{
47-
$idValidator = new Zend_Validate();
43+
$idValidator = new \Zend_Validate();
4844
$idValidator->addValidator(new \Zend_Validate_StringLength(['min' => 3]));
4945
$idValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/:_]+$/'));
5046

51-
$resourceValidator = new Zend_Validate();
47+
$resourceValidator = new \Zend_Validate();
5248
$resourceValidator->addValidator(new \Zend_Validate_StringLength(['min' => 8]));
5349
$resourceValidator->addValidator(
5450
new \Zend_Validate_Regex('/^[A-Z][A-Za-z0-9]+_[A-Z][A-Za-z0-9]+::[A-Za-z_0-9]+$/')
5551
);
5652

57-
$attributeValidator = new Zend_Validate();
53+
$attributeValidator = new \Zend_Validate();
5854
$attributeValidator->addValidator(new \Zend_Validate_StringLength(['min' => 3]));
5955
$attributeValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/_\-]+$/'));
6056

@@ -77,8 +73,8 @@ public function __construct()
7773
*
7874
* @param array $data
7975
* @return void
80-
* @throws InvalidArgumentException
81-
* @throws BadMethodCallException
76+
* @throws \InvalidArgumentException
77+
* @throws \BadMethodCallException
8278
*/
8379
public function validate($data)
8480
{
@@ -111,13 +107,13 @@ private function checkMenuItemIsRemoved($data)
111107
*
112108
* @param array $data
113109
*
114-
* @throws BadMethodCallException
110+
* @throws \BadMethodCallException
115111
*/
116112
private function assertContainsRequiredParameters($data)
117113
{
118114
foreach ($this->_required as $param) {
119115
if (!isset($data[$param])) {
120-
throw new BadMethodCallException('Missing required param ' . $param);
116+
throw new \BadMethodCallException('Missing required param ' . $param);
121117
}
122118
}
123119
}
@@ -126,12 +122,12 @@ private function assertContainsRequiredParameters($data)
126122
* Check that menu item id is not used
127123
*
128124
* @param string $id
129-
* @throws InvalidArgumentException
125+
* @throws \InvalidArgumentException
130126
*/
131127
private function assertIdentifierIsNotUsed($id)
132128
{
133129
if (array_search($id, $this->_ids) !== false) {
134-
throw new InvalidArgumentException('Item with id ' . $id . ' already exists');
130+
throw new \InvalidArgumentException('Item with id ' . $id . ' already exists');
135131
}
136132
}
137133

@@ -140,7 +136,7 @@ private function assertIdentifierIsNotUsed($id)
140136
*
141137
* @param string $param
142138
* @param mixed $value
143-
* @throws InvalidArgumentException
139+
* @throws \InvalidArgumentException
144140
*/
145141
private function validateMenuItemParameter($param, $value)
146142
{
@@ -156,7 +152,7 @@ private function validateMenuItemParameter($param, $value)
156152
return;
157153
}
158154

159-
throw new InvalidArgumentException(
155+
throw new \InvalidArgumentException(
160156
"Param " . $param . " doesn't pass validation: " . implode(
161157
'; ',
162158
$validator->getMessages()
@@ -170,16 +166,16 @@ private function validateMenuItemParameter($param, $value)
170166
* @param string $param
171167
* @param mixed $value
172168
* @return void
173-
* @throws InvalidArgumentException
169+
* @throws \InvalidArgumentException
174170
*/
175171
public function validateParam($param, $value)
176172
{
177173
if (in_array($param, $this->_required) && $value === null) {
178-
throw new InvalidArgumentException('Param ' . $param . ' is required');
174+
throw new \InvalidArgumentException('Param ' . $param . ' is required');
179175
}
180176

181177
if ($value !== null && isset($this->_validators[$param]) && !$this->_validators[$param]->isValid($value)) {
182-
throw new InvalidArgumentException(
178+
throw new \InvalidArgumentException(
183179
'Param ' . $param . ' doesn\'t pass validation: ' . implode(
184180
'; ',
185181
$this->_validators[$param]->getMessages()

0 commit comments

Comments
 (0)