Passed
Push — develop ( dfa246...179c36 )
by Francisco
02:27
created

DeclinedExchangeNotification::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 10
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 10
loc 10
rs 9.4285
c 1
b 0
f 0
1
<?php
2
3
namespace App\Mail;
4
5
use Illuminate\Bus\Queueable;
6
use Illuminate\Mail\Mailable;
7
use App\Judite\Models\Exchange;
8
use Illuminate\Queue\SerializesModels;
9
10 View Code Duplication
class DeclinedExchangeNotification extends Mailable
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    use Queueable, SerializesModels;
13
14
    /**
15
     * The declined exchange.
16
     *
17
     * @var string
18
     */
19
    private $exchange;
20
21
    /**
22
     * Create a new message instance.
23
     *
24
     * @param \App\Judite\Models\Exchange|\App\Safira\Models\Exchange $exchange
0 ignored issues
show
Bug introduced by
The type App\Safira\Models\Exchange was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
25
     */
26
    public function __construct(Exchange $exchange)
27
    {
28
        $this->exchange = $exchange;
29
    }
30
31
    /**
32
     * Build the message.
33
     *
34
     * @return $this
35
     */
36
    public function build()
37
    {
38
        $course = $this->exchange->course();
39
        $fromStudent = $this->exchange->fromStudent();
40
        $toStudent = $this->exchange->toStudent();
41
        $fromShift = $this->exchange->fromShift();
42
        $toShift = $this->exchange->toShift();
43
44
        return $this->markdown('emails.exchanges.declined',
45
            compact('course', 'fromStudent', 'toStudent', 'fromShift', 'toShift'));
46
    }
47
}
48