Passed
Push — master ( ae26a6...9bf461 )
by Aimeos
32:56 queued 17:36
created

Laravel::get()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2024
6
 * @package Base
7
 * @subpackage Mail
8
 */
9
10
11
namespace Aimeos\Base\Mail\Manager;
12
13
14
/**
15
 * Laravel mail manager
16
 *
17
 * @package Base
18
 * @subpackage Mail
19
 */
20
class Laravel implements Iface
21
{
22
	private ?\Illuminate\Mail\MailManager $manager;
23
24
25
	/**
26
	 * Initializes the object
27
	 *
28
	 * @param \Illuminate\Mail\MailManager $manager Mail manager object
29
	 */
30
	public function __construct( \Illuminate\Mail\MailManager $manager )
31
	{
32
		$this->manager = $manager;
33
	}
34
35
36
	/**
37
	 * Returns the mailer for the given name
38
	 *
39
	 * @param string|null $name Key for the mailer
40
	 * @return \Aimeos\Base\Mail\Iface Mail object
41
	 */
42
	public function get( string $name = null ) : \Aimeos\Base\Mail\Iface
43
	{
44
		return new \Aimeos\Base\Mail\Laravel( $this->manager->mailer( $name ?: $this->manager->getDefaultDriver() ) );
0 ignored issues
show
Bug introduced by
The method getDefaultDriver() does not exist on null. ( Ignorable by Annotation )

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

44
		return new \Aimeos\Base\Mail\Laravel( $this->manager->mailer( $name ?: $this->manager->/** @scrutinizer ignore-call */ getDefaultDriver() ) );

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
45
	}
46
}
47