Conditions | 4 |
Paths | 3 |
Total Lines | 25 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function __invoke($contID) |
||
18 | { |
||
19 | $contact = CustomerContact::findOrFail($contID); |
||
20 | $customer = Customer::find($contact->cust_id); |
||
21 | $name = explode(' ', $contact->name); |
||
22 | |||
23 | // Build the VCard |
||
24 | $vcard = new VCard(); |
||
25 | $vcard->addName(isset($name[1]) ? $name[1] : null, $name[0]); |
||
26 | $vcard->addCompany($customer->name); |
||
27 | $vcard->addAddress(null, null, $customer->address, $customer->city, $customer->state, $customer->zip, null); |
||
28 | |||
29 | // Add phone numbers to the VCard |
||
30 | foreach($contact->CustomerContactPhone as $phone) |
||
31 | { |
||
32 | $number = $phone->readable; |
||
33 | if($phone->extension) |
||
34 | { |
||
35 | $number .= ', '.$phone->extension; |
||
36 | } |
||
37 | $vcard->addPhoneNumber($number, $phone->type_name); |
||
38 | } |
||
39 | |||
40 | event(new CustomerContactDownloadedEvent($customer, $contact)); |
||
41 | return $vcard->download(); |
||
1 ignored issue
–
show
|
|||
42 | } |
||
44 |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.