Code Duplication    Length = 14-14 lines in 2 locations

cloudcontrol/library/storage/JsonStorage.php 2 locations

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