Code Duplication    Length = 10-12 lines in 3 locations

controller/ownnoteajaxcontroller.php 1 location

@@ 75-84 (lines=10) @@
72
	/**
73
	 * @NoAdminRequired
74
	 */
75
	public function ajaxcreate($name, $group) {
76
		$FOLDER = $this->config->getAppValue($this->appName, 'folder', '');
77
		if (isset($name) && isset($group)) {
78
			$note = [
79
				'name' => $name,
80
				'group' => $group
81
			];
82
			return $this->noteService->create($FOLDER, $note, $this->uid);
83
		}
84
	}
85
86
	/**
87
	 * @NoAdminRequired

controller/ownnoteapicontroller.php 2 locations

@@ 90-99 (lines=10) @@
87
	* @NoAdminRequired
88
	* @NoCSRFRequired
89
	*/
90
	public function create($name, $group) {
91
		$FOLDER = $this->config->getAppValue($this->appName, 'folder', '');
92
		if (isset($name) && isset($group)) {
93
			$note = [
94
				'name' => $name,
95
				'group' => $group
96
			];
97
			return $this->noteService->create($FOLDER, $note, $this->uid);
98
		}
99
	}
100
101
	/**
102
	* @NoAdminRequired
@@ 129-140 (lines=12) @@
126
	* @NoAdminRequired
127
	* @NoCSRFRequired
128
	*/
129
	public function save($id, $content) {
130
		$FOLDER = $this->config->getAppValue($this->appName, 'folder', '');
131
		if (isset($id) && isset($content)) {
132
			$note = [
133
				'id' => $id,
134
				'note' => $content,
135
				'mtime' => time()
136
			];
137
138
			return ($this->noteService->update($FOLDER, $note));
139
		}
140
	}
141
142
	/**
143
	* @NoAdminRequired