LegacyMessageMethods   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 24
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setFrom() 0 3 1
A setSubject() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Nip\Mail;
6
7
trait LegacyMessageMethods
8
{
9
    /**
10
     * @param $from
11
     *
12
     * @deprecated use addFrom() instead
13
     *
14
     * @return $this
15
     */
16
    public function setFrom($from): self
17
    {
18
        return $this->addFrom($from);
0 ignored issues
show
Bug introduced by
It seems like addFrom() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        return $this->/** @scrutinizer ignore-call */ addFrom($from);
Loading history...
19
    }
20
21
    /**
22
     * @param $subject
23
     *
24
     * @deprecated use subject() instead
25
     *
26
     * @return $this
27
     */
28
    public function setSubject($subject): self
29
    {
30
        return $this->subject($subject);
0 ignored issues
show
Bug introduced by
It seems like subject() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
        return $this->/** @scrutinizer ignore-call */ subject($subject);
Loading history...
31
    }
32
}
33