Ezpublish::setEzUserService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2016-2020
6
 * @package MShop
7
 * @subpackage Context
8
 */
9
10
11
namespace Aimeos\MShop\Context\Item;
12
13
14
/**
15
 * Common objects which must to be available for all manager objects
16
 *
17
 * @package MShop
18
 * @subpackage Context
19
 */
20
class Ezpublish extends \Aimeos\MShop\Context\Item\Standard
21
{
22
	private $ezUserService;
23
24
25
	/**
26
	 * Sets the eZ user service object
27
	 *
28
	 * @param \eZ\Publish\API\Repository\UserService $service eZ user service object
29
	 * @return \Aimeos\MShop\Context\Item\Iface Context item for chaining method calls
30
	 */
31
	public function setEzUserService( \eZ\Publish\API\Repository\UserService $service ) : \Aimeos\MShop\Context\Item\Iface
0 ignored issues
show
Bug introduced by
The type eZ\Publish\API\Repository\UserService 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...
32
	{
33
		$this->ezUserService = $service;
34
		return $this;
35
	}
36
37
38
	/**
39
	 * Returns the eZ user service object
40
	 *
41
	 * @return \eZ\Publish\API\Repository\UserService eZ user service object
42
	 */
43
	public function getEzUserService() : \eZ\Publish\API\Repository\UserService
44
	{
45
		if( !isset( $this->ezUserService ) ) {
46
			throw new \Aimeos\MShop\Exception( sprintf( 'eZ user service not available' ) );
47
		}
48
49
		return $this->ezUserService;
50
	}
51
}
52