Code Duplication    Length = 9-10 lines in 2 locations

lib/service/aliasesservice.php 2 locations

@@ 81-89 (lines=9) @@
78
	 * @param int $id
79
	 * @return \OCA\Mail\Db\Alias[]
80
	 */
81
	public function delete($id) {
82
		try {
83
			$alias = $this->mapper->find($id);
84
			$this->mapper->delete($alias);
85
			return $alias;
86
		} catch(Exception $e) {
87
			$this->handleException($e);
88
		}
89
	}
90
91
	/**
92
	 * @param int $id
@@ 96-105 (lines=10) @@
93
	 * @param string $alias_name
94
	 * @return Alias[]
95
	 */
96
	public function update($id, $alias_name) {
97
		try {
98
			$alias = $this->mapper->find($id);
99
			$alias->setAlias($alias_name);
100
			return $this->mapper->update($alias);
101
		} catch(Exception $e) {
102
			$this->handleException($e);
103
		}
104
105
	}
106
}
107