Code Duplication    Length = 11-11 lines in 2 locations

src/ApiRoute.php 2 locations

@@ 88-98 (lines=11) @@
85
			if (empty($data['methods'])) {
86
				$this->actions = $this->default_actions;
87
			} else {
88
				foreach ($data['methods'] as $method => $action) {
89
					if (is_string($method)) {
90
						$this->setAction($action, $method);
91
					} else {
92
						$m = $action;
93
94
						if (isset($this->default_actions[$m])) {
95
							$this->setAction($this->default_actions[$m], $m);
96
						}
97
					}
98
				}
99
100
				unset($data['methods']);
101
			}
@@ 244-254 (lines=11) @@
241
	 */
242
	public function setMethods(array $methods)
243
	{
244
		foreach ($methods as $method => $action) {
245
			if (is_string($method)) {
246
				$this->setAction($action, $method);
247
			} else {
248
				$m = $action;
249
250
				if (isset($this->default_actions[$m])) {
251
					$this->setAction($this->default_actions[$m], $m);
252
				}
253
			}
254
		}
255
	}
256
257