Code Duplication    Length = 14-14 lines in 2 locations

cloudcontrol/library/storage/JsonStorage.php 2 locations

@@ 67-80 (lines=14) @@
64
		 *
65
		 * @return array
66
		 */
67
		public function getUserByUsername($username)
68
		{
69
			$return = array();
70
			
71
			$users = $this->repository->users;
72
			foreach ($users as $user) {
73
				if ($user->username == $username) {
74
					$return = $user;
75
					break;
76
				}
77
			}
78
			
79
			return $return;
80
		}
81
82
        /**
83
         * Get user by slug
@@ 88-101 (lines=14) @@
85
         * @param $slug
86
         * @return array
87
         */
88
		public function getUserBySlug($slug)
89
		{
90
			$return = array();
91
92
			$users = $this->repository->users;
93
			foreach ($users as $user) {
94
				if ($user->slug == $slug) {
95
					$return = $user;
96
					break;
97
				}
98
			}
99
100
			return $return;
101
		}
102
103
        /**
104
         * Get all users