Code Duplication    Length = 13-13 lines in 3 locations

code/api/nouns/APIEnvironment.php 2 locations

@@ 53-65 (lines=13) @@
50
	 * @param \SS_HTTPRequest $request
51
	 * @return \SS_HTTPResponse
52
	 */
53
	public function ping(\SS_HTTPRequest $request) {
54
		if(!$this->record->canView($this->getMember())) {
55
			return $this->message('You are not authorized to do that on this environment', 403);
56
		}
57
		switch($request->httpMethod()) {
58
			case 'GET':
59
				return $this->getPing($this->getRequest()->param('ID'));
60
			case 'POST':
61
				return $this->createPing();
62
			default:
63
				return $this->message('API not found', 404);
64
		}
65
	}
66
67
	/**
68
	 * @deprecated 2.0.0 - moved to DeployDispatcher
@@ 73-85 (lines=13) @@
70
	 * @param \SS_HTTPRequest $request
71
	 * @return \SS_HTTPResponse
72
	 */
73
	public function deploy(\SS_HTTPRequest $request) {
74
		if(!$this->record->canView($this->getMember())) {
75
			return $this->message('You are not authorized to do that on this environment', 403);
76
		}
77
		switch($request->httpMethod()) {
78
			case 'GET':
79
				return $this->getDeploy($this->getRequest()->param('ID'));
80
			case 'POST':
81
				return $this->createDeploy();
82
			default:
83
				return $this->message('API not found', 404);
84
		}
85
	}
86
87
	/**
88
	 * @return string

code/api/nouns/APIProject.php 1 location

@@ 49-61 (lines=13) @@
46
	 * @param \SS_HTTPRequest $request
47
	 * @return \SS_HTTPResponse
48
	 */
49
	public function fetch(\SS_HTTPRequest $request) {
50
		if(!$this->record->canView($this->getMember())) {
51
			return $this->message('You are not authorized to do that on this environment', 403);
52
		}
53
		switch($request->httpMethod()) {
54
			case 'GET':
55
				return $this->getFetch($this->getRequest()->param('ID'));
56
			case 'POST':
57
				return $this->createFetch();
58
			default:
59
				return $this->message('API not found', 404);
60
		}
61
	}
62
63
	/**
64
	 * @param int $ID