helick /
mail
| 1 | <?php |
||||||
| 2 | |||||||
| 3 | namespace Helick\Mail; |
||||||
| 4 | |||||||
| 5 | use Helick\Contracts\Bootable; |
||||||
| 6 | use PHPMailer; |
||||||
|
0 ignored issues
–
show
|
|||||||
| 7 | |||||||
| 8 | final class Plugin implements Bootable |
||||||
| 9 | { |
||||||
| 10 | /** |
||||||
| 11 | * Boot the service. |
||||||
| 12 | * |
||||||
| 13 | * @return void |
||||||
| 14 | */ |
||||||
| 15 | public static function boot(): void |
||||||
| 16 | { |
||||||
| 17 | $self = new static; |
||||||
| 18 | |||||||
| 19 | add_action('phpmailer_init', [$self, 'setup']); |
||||||
|
0 ignored issues
–
show
The function
add_action was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 20 | add_filter('wp_mail_from_name', [$self, 'fromName']); |
||||||
|
0 ignored issues
–
show
The function
add_filter was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 21 | add_filter('wp_mail_from', [$self, 'fromAddress']); |
||||||
| 22 | } |
||||||
| 23 | |||||||
| 24 | /** |
||||||
| 25 | * Setup the SMTP connection. |
||||||
| 26 | * |
||||||
| 27 | * @param PHPMailer $mailer |
||||||
| 28 | * |
||||||
| 29 | * @return void |
||||||
| 30 | */ |
||||||
| 31 | public function setup(PHPMailer $mailer): void |
||||||
| 32 | { |
||||||
| 33 | $mailer->isSMTP(); |
||||||
| 34 | $mailer->SMTPAuth = true; |
||||||
| 35 | |||||||
| 36 | $mailer->Host = host(); |
||||||
| 37 | $mailer->Port = port(); |
||||||
| 38 | $mailer->Username = user(); |
||||||
| 39 | $mailer->Password = password(); |
||||||
| 40 | } |
||||||
| 41 | |||||||
| 42 | /** |
||||||
| 43 | * Setup "From Name" header. |
||||||
| 44 | * |
||||||
| 45 | * @return string |
||||||
| 46 | */ |
||||||
| 47 | public function fromName(): string |
||||||
| 48 | { |
||||||
| 49 | return from_name(); |
||||||
| 50 | } |
||||||
| 51 | |||||||
| 52 | /** |
||||||
| 53 | * Setup "From Address" header. |
||||||
| 54 | * |
||||||
| 55 | * @return string |
||||||
| 56 | */ |
||||||
| 57 | public function fromAddress(): string |
||||||
| 58 | { |
||||||
| 59 | return from_address(); |
||||||
| 60 | } |
||||||
| 61 | } |
||||||
| 62 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths