Code Duplication    Length = 15-15 lines in 2 locations

app/Ship/Parents/Requests/RequestTrait.php 2 locations

@@ 120-134 (lines=15) @@
117
     *
118
     * @return  array
119
     */
120
    private function hasAnyPermissionAccess($user)
121
    {
122
        if (!array_key_exists('permissions', $this->access) || !$this->access['permissions']) {
123
            return [];
124
        }
125
126
        $permissions = explode('|', $this->access['permissions']);
127
128
        $hasAccess = array_map(function ($permission) use ($user) {
129
            // Note: internal return
130
            return $user->hasPermissionTo($permission);
131
        }, $permissions);
132
133
        return $hasAccess;
134
    }
135
136
    /**
137
     * @param $user
@@ 141-155 (lines=15) @@
138
     *
139
     * @return  array
140
     */
141
    private function hasAnyRoleAccess($user)
142
    {
143
        if (!array_key_exists('roles', $this->access) || !$this->access['roles']) {
144
            return [];
145
        }
146
147
        $roles = explode('|', $this->access['roles']);
148
149
        $hasAccess = array_map(function ($role) use ($user) {
150
            // Note: internal return
151
            return $user->hasRole($role);
152
        }, $roles);
153
154
        return $hasAccess;
155
    }
156
}
157