Issues (94)

src/Services/ProfileService.php (2 issues)

1
<?php
2
3
namespace FaithGen\SDK\Services;
4
5
use FaithGen\SDK\Models\Ministry\Profile;
6
use InnoFlash\LaraStart\Services\CRUDServices;
7
8
class ProfileService extends CRUDServices
9
{
10
    protected Profile $profile;
11
12
    public function __construct()
13
    {
14
        try {
15
            $this->profile = auth(config('faithgen-sdk.guard'))->user()->profile;
0 ignored issues
show
Accessing profile on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
16
        } catch (\Exception $e) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
17
        }
18
    }
19
20
    /**
21
     * Retrieves an instance of profile.
22
     *
23
     * @return \FaithGen\SDK\Models\Ministry\Profile
24
     */
25
    public function getProfile(): Profile
26
    {
27
        return $this->profile;
28
    }
29
30
    /**
31
     * This sets the attributes to be removed from the given set for updating or creating.
32
     * @return mixed
33
     */
34
    public function getUnsetFields(): array
35
    {
36
        return ['name', 'email', 'phone'];
37
    }
38
}
39