Completed
Branch dependabot/composer/tijsverkoy... (491ea6)
by
unknown
32:00 queued 25:42
created
core/services/container/RecipeInterface.php 1 patch
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -11,82 +11,82 @@
 block discarded – undo
11 11
  */
12 12
 interface RecipeInterface
13 13
 {
14
-    /**
15
-     * @return string
16
-     */
17
-    public function identifier();
14
+	/**
15
+	 * @return string
16
+	 */
17
+	public function identifier();
18 18
 
19
-    /**
20
-     * @return string
21
-     */
22
-    public function fqcn();
19
+	/**
20
+	 * @return string
21
+	 */
22
+	public function fqcn();
23 23
 
24
-    /**
25
-     * @return array
26
-     */
27
-    public function ingredients();
24
+	/**
25
+	 * @return array
26
+	 */
27
+	public function ingredients();
28 28
 
29
-    /**
30
-     * @return string
31
-     */
32
-    public function type();
29
+	/**
30
+	 * @return string
31
+	 */
32
+	public function type();
33 33
 
34
-    /**
35
-     * @return array
36
-     */
37
-    public function filters();
34
+	/**
35
+	 * @return array
36
+	 */
37
+	public function filters();
38 38
 
39
-    /**
40
-     * @return array
41
-     */
42
-    public function paths();
39
+	/**
40
+	 * @return array
41
+	 */
42
+	public function paths();
43 43
 
44
-    /**
45
-     * @param  string $identifier Identifier for the entity class that the Recipe applies to
46
-     *                            Typically a Fully Qualified Class Name
47
-     */
48
-    public function setIdentifier($identifier);
44
+	/**
45
+	 * @param  string $identifier Identifier for the entity class that the Recipe applies to
46
+	 *                            Typically a Fully Qualified Class Name
47
+	 */
48
+	public function setIdentifier($identifier);
49 49
 
50
-    /**
51
-     * Ensures incoming string is a valid Fully Qualified Class Name,
52
-     * except if this is the default wildcard Recipe ( * ),
53
-     * or it's NOT an actual FQCN because the Recipe is using filepaths
54
-     * for classes that are not PSR-4 compatible
55
-     * PLZ NOTE:
56
-     *  Recipe::setFqcn() has a check to see if Recipe::$paths is empty or not,
57
-     *  therefore you should always call Recipe::setPaths() before Recipe::setFqcn()
58
-     *
59
-     * @param string $fqcn
60
-     */
61
-    public function setFqcn($fqcn);
50
+	/**
51
+	 * Ensures incoming string is a valid Fully Qualified Class Name,
52
+	 * except if this is the default wildcard Recipe ( * ),
53
+	 * or it's NOT an actual FQCN because the Recipe is using filepaths
54
+	 * for classes that are not PSR-4 compatible
55
+	 * PLZ NOTE:
56
+	 *  Recipe::setFqcn() has a check to see if Recipe::$paths is empty or not,
57
+	 *  therefore you should always call Recipe::setPaths() before Recipe::setFqcn()
58
+	 *
59
+	 * @param string $fqcn
60
+	 */
61
+	public function setFqcn($fqcn);
62 62
 
63
-    /**
64
-     * @param array $ingredients    an array of dependencies where keys are the aliases and values are the FQCNs
65
-     *                              example:
66
-     *                              array( 'ClassInterface' => 'Fully\Qualified\ClassName' )
67
-     */
68
-    public function setIngredients(array $ingredients);
63
+	/**
64
+	 * @param array $ingredients    an array of dependencies where keys are the aliases and values are the FQCNs
65
+	 *                              example:
66
+	 *                              array( 'ClassInterface' => 'Fully\Qualified\ClassName' )
67
+	 */
68
+	public function setIngredients(array $ingredients);
69 69
 
70
-    /**
71
-     * @param string $type one of the class constants returned from CoffeeMaker::getTypes()
72
-     */
73
-    public function setType($type = CoffeeMaker::BREW_NEW);
70
+	/**
71
+	 * @param string $type one of the class constants returned from CoffeeMaker::getTypes()
72
+	 */
73
+	public function setType($type = CoffeeMaker::BREW_NEW);
74 74
 
75
-    /**
76
-     * @param array $filters    an array of filters where keys are the aliases and values are the FQCNs
77
-     *                          example:
78
-     *                          array( 'ClassInterface' => 'Fully\Qualified\ClassName' )
79
-     */
80
-    public function setFilters(array $filters);
75
+	/**
76
+	 * @param array $filters    an array of filters where keys are the aliases and values are the FQCNs
77
+	 *                          example:
78
+	 *                          array( 'ClassInterface' => 'Fully\Qualified\ClassName' )
79
+	 */
80
+	public function setFilters(array $filters);
81 81
 
82
-    /**
83
-     * Ensures incoming paths is a valid filepath, or array of valid filepaths,
84
-     * and merges them in with any existing filepaths
85
-     * PLZ NOTE:
86
-     *  Recipe::setFqcn() has a check to see if Recipe::$paths is empty or not,
87
-     *  therefore you should always call Recipe::setPaths() before Recipe::setFqcn()
88
-     *
89
-     * @param string|array $paths
90
-     */
91
-    public function setPaths($paths = array());
82
+	/**
83
+	 * Ensures incoming paths is a valid filepath, or array of valid filepaths,
84
+	 * and merges them in with any existing filepaths
85
+	 * PLZ NOTE:
86
+	 *  Recipe::setFqcn() has a check to see if Recipe::$paths is empty or not,
87
+	 *  therefore you should always call Recipe::setPaths() before Recipe::setFqcn()
88
+	 *
89
+	 * @param string|array $paths
90
+	 */
91
+	public function setPaths($paths = array());
92 92
 }
Please login to merge, or discard this patch.
core/services/container/CoffeeMill.php 1 patch
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -14,59 +14,59 @@
 block discarded – undo
14 14
  */
15 15
 class CoffeeMill
16 16
 {
17
-    /**
18
-     * @var CoffeeShop $coffee_shop
19
-     */
20
-    private static $coffee_shop;
17
+	/**
18
+	 * @var CoffeeShop $coffee_shop
19
+	 */
20
+	private static $coffee_shop;
21 21
 
22 22
 
23
-    /**
24
-     * @return mixed
25
-     */
26
-    public static function getCoffeeShop()
27
-    {
28
-        return self::$coffee_shop;
29
-    }
23
+	/**
24
+	 * @return mixed
25
+	 */
26
+	public static function getCoffeeShop()
27
+	{
28
+		return self::$coffee_shop;
29
+	}
30 30
 
31 31
 
32
-    /**
33
-     * @param CoffeeShop $coffee_shop
34
-     */
35
-    public static function setCoffeeShop(CoffeeShop $coffee_shop)
36
-    {
37
-        self::$coffee_shop = $coffee_shop;
38
-    }
32
+	/**
33
+	 * @param CoffeeShop $coffee_shop
34
+	 */
35
+	public static function setCoffeeShop(CoffeeShop $coffee_shop)
36
+	{
37
+		self::$coffee_shop = $coffee_shop;
38
+	}
39 39
 
40 40
 
41
-    /**
42
-     * @param string $identifier
43
-     * @param array  $arguments
44
-     * @param string $type
45
-     * @return mixed
46
-     * @throws ServiceNotFoundException
47
-     */
48
-    public static function createNew($identifier, $arguments = array(), $type = CoffeeMaker::BREW_NEW)
49
-    {
50
-        return self::$coffee_shop->brew($identifier, $arguments, $type);
51
-    }
41
+	/**
42
+	 * @param string $identifier
43
+	 * @param array  $arguments
44
+	 * @param string $type
45
+	 * @return mixed
46
+	 * @throws ServiceNotFoundException
47
+	 */
48
+	public static function createNew($identifier, $arguments = array(), $type = CoffeeMaker::BREW_NEW)
49
+	{
50
+		return self::$coffee_shop->brew($identifier, $arguments, $type);
51
+	}
52 52
 
53 53
 
54
-    /**
55
-     * IMPORTANT!!!
56
-     * Usage of this method is discouraged as it promotes service location.
57
-     * It's current use is only as a stop gap measure until the CoffeeShop
58
-     * Dependency Injection Container can be implemented properly for all classes.
59
-     * If it is at all possible, inject your dependencies via your class constructor.
60
-     * This method WILL BE DEPRECATED at some point in the near future.
61
-     *
62
-     * @param string $identifier
63
-     * @param array  $arguments
64
-     * @param string $type
65
-     * @return mixed
66
-     * @throws ServiceNotFoundException
67
-     */
68
-    public static function getService($identifier, $arguments = array(), $type = CoffeeMaker::BREW_SHARED)
69
-    {
70
-        return self::$coffee_shop->brew($identifier, $arguments, $type);
71
-    }
54
+	/**
55
+	 * IMPORTANT!!!
56
+	 * Usage of this method is discouraged as it promotes service location.
57
+	 * It's current use is only as a stop gap measure until the CoffeeShop
58
+	 * Dependency Injection Container can be implemented properly for all classes.
59
+	 * If it is at all possible, inject your dependencies via your class constructor.
60
+	 * This method WILL BE DEPRECATED at some point in the near future.
61
+	 *
62
+	 * @param string $identifier
63
+	 * @param array  $arguments
64
+	 * @param string $type
65
+	 * @return mixed
66
+	 * @throws ServiceNotFoundException
67
+	 */
68
+	public static function getService($identifier, $arguments = array(), $type = CoffeeMaker::BREW_SHARED)
69
+	{
70
+		return self::$coffee_shop->brew($identifier, $arguments, $type);
71
+	}
72 72
 }
Please login to merge, or discard this patch.
core/services/container/exceptions/ServiceNotFoundException.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -11,26 +11,26 @@
 block discarded – undo
11 11
  */
12 12
 class ServiceNotFoundException extends \RuntimeException
13 13
 {
14
-    /**
15
-     * ServiceNotFoundException constructor
16
-     *
17
-     * @param string     $service_name the name of the requested service
18
-     * @param string     $message
19
-     * @param int        $code
20
-     * @param \Exception $previous
21
-     */
22
-    public function __construct(
23
-        $service_name,
24
-        $message = '',
25
-        $code = 0,
26
-        \Exception $previous = null
27
-    ) {
28
-        if (empty($message)) {
29
-            $message = sprintf(
30
-                esc_html__('The requested service "%1$s" could not found be found in the CoffeeShop.', 'event_espresso'),
31
-                $service_name
32
-            );
33
-        }
34
-        parent::__construct($message, $code, $previous);
35
-    }
14
+	/**
15
+	 * ServiceNotFoundException constructor
16
+	 *
17
+	 * @param string     $service_name the name of the requested service
18
+	 * @param string     $message
19
+	 * @param int        $code
20
+	 * @param \Exception $previous
21
+	 */
22
+	public function __construct(
23
+		$service_name,
24
+		$message = '',
25
+		$code = 0,
26
+		\Exception $previous = null
27
+	) {
28
+		if (empty($message)) {
29
+			$message = sprintf(
30
+				esc_html__('The requested service "%1$s" could not found be found in the CoffeeShop.', 'event_espresso'),
31
+				$service_name
32
+			);
33
+		}
34
+		parent::__construct($message, $code, $previous);
35
+	}
36 36
 }
Please login to merge, or discard this patch.
core/services/container/exceptions/ServiceExistsException.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -12,26 +12,26 @@
 block discarded – undo
12 12
  */
13 13
 class ServiceExistsException extends \OutOfRangeException
14 14
 {
15
-    /**
16
-     * ServiceExistsException constructor
17
-     *
18
-     * @param string     $service_name the name of the requested service
19
-     * @param string     $message
20
-     * @param int        $code
21
-     * @param \Exception $previous
22
-     */
23
-    public function __construct(
24
-        $service_name,
25
-        $message = '',
26
-        $code = 0,
27
-        \Exception $previous = null
28
-    ) {
29
-        if (empty($message)) {
30
-            $message = sprintf(
31
-                esc_html__('The "%1$s" service already exists in the CoffeeShop and can not be added again.', 'event_espresso'),
32
-                $service_name
33
-            );
34
-        }
35
-        parent::__construct($message, $code, $previous);
36
-    }
15
+	/**
16
+	 * ServiceExistsException constructor
17
+	 *
18
+	 * @param string     $service_name the name of the requested service
19
+	 * @param string     $message
20
+	 * @param int        $code
21
+	 * @param \Exception $previous
22
+	 */
23
+	public function __construct(
24
+		$service_name,
25
+		$message = '',
26
+		$code = 0,
27
+		\Exception $previous = null
28
+	) {
29
+		if (empty($message)) {
30
+			$message = sprintf(
31
+				esc_html__('The "%1$s" service already exists in the CoffeeShop and can not be added again.', 'event_espresso'),
32
+				$service_name
33
+			);
34
+		}
35
+		parent::__construct($message, $code, $previous);
36
+	}
37 37
 }
Please login to merge, or discard this patch.
core/services/container/exceptions/InvalidServiceException.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -12,27 +12,27 @@
 block discarded – undo
12 12
  */
13 13
 class InvalidServiceException extends \UnexpectedValueException
14 14
 {
15
-    /**
16
-     * InvalidServiceException constructor.
17
-     *
18
-     * @param string     $service_name the name of the requested service
19
-     * @param string     $actual       classname of what we got
20
-     * @param string     $message
21
-     * @param int        $code
22
-     * @param \Exception $previous
23
-     */
24
-    public function __construct($service_name, $actual, $message = '', $code = 0, \Exception $previous = null)
25
-    {
26
-        if (empty($message)) {
27
-            $message = sprintf(
28
-                esc_html__(
29
-                    'The "%1$s" service could not be retrieved from the CoffeeShop, but "%2$s" was received.',
30
-                    'event_espresso'
31
-                ),
32
-                $service_name,
33
-                print_r($actual, true)
34
-            );
35
-        }
36
-        parent::__construct($message, $code, $previous);
37
-    }
15
+	/**
16
+	 * InvalidServiceException constructor.
17
+	 *
18
+	 * @param string     $service_name the name of the requested service
19
+	 * @param string     $actual       classname of what we got
20
+	 * @param string     $message
21
+	 * @param int        $code
22
+	 * @param \Exception $previous
23
+	 */
24
+	public function __construct($service_name, $actual, $message = '', $code = 0, \Exception $previous = null)
25
+	{
26
+		if (empty($message)) {
27
+			$message = sprintf(
28
+				esc_html__(
29
+					'The "%1$s" service could not be retrieved from the CoffeeShop, but "%2$s" was received.',
30
+					'event_espresso'
31
+				),
32
+				$service_name,
33
+				print_r($actual, true)
34
+			);
35
+		}
36
+		parent::__construct($message, $code, $previous);
37
+	}
38 38
 }
Please login to merge, or discard this patch.
core/services/container/exceptions/InstantiationException.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -14,25 +14,25 @@
 block discarded – undo
14 14
  */
15 15
 class InstantiationException extends BadMethodCallException
16 16
 {
17
-    /**
18
-     * InstantiationException constructor.
19
-     *
20
-     * @param string     $identifier the name of the requested entity or service
21
-     * @param string     $message
22
-     * @param int        $code
23
-     * @param \Exception $previous
24
-     */
25
-    public function __construct($identifier, $message = '', $code = 0, \Exception $previous = null)
26
-    {
27
-        if (empty($message)) {
28
-            $message = sprintf(
29
-                esc_html__(
30
-                    'The "%1$s" class could not be constructed.',
31
-                    'event_espresso'
32
-                ),
33
-                $identifier
34
-            );
35
-        }
36
-        parent::__construct($message, $code, $previous);
37
-    }
17
+	/**
18
+	 * InstantiationException constructor.
19
+	 *
20
+	 * @param string     $identifier the name of the requested entity or service
21
+	 * @param string     $message
22
+	 * @param int        $code
23
+	 * @param \Exception $previous
24
+	 */
25
+	public function __construct($identifier, $message = '', $code = 0, \Exception $previous = null)
26
+	{
27
+		if (empty($message)) {
28
+			$message = sprintf(
29
+				esc_html__(
30
+					'The "%1$s" class could not be constructed.',
31
+					'event_espresso'
32
+				),
33
+				$identifier
34
+			);
35
+		}
36
+		parent::__construct($message, $code, $previous);
37
+	}
38 38
 }
Please login to merge, or discard this patch.
core/services/container/CoffeePotInterface.php 1 patch
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -10,68 +10,68 @@
 block discarded – undo
10 10
  */
11 11
 interface CoffeePotInterface extends ContainerInterface
12 12
 {
13
-    /**
14
-     * returns an instance of the requested entity type using the supplied arguments.
15
-     * If a shared service is requested and an instance is already in the carafe, then it will be returned.
16
-     * If it is not already in the carafe, then the service will be constructed, added to the carafe, and returned
17
-     * If the request is for a new entity and a closure exists in the reservoir for creating it,
18
-     * then a new entity will be instantiated from the closure and returned.
19
-     * If a closure does not exist, then one will be built and added to the reservoir
20
-     * before instantiating the requested entity.
21
-     *
22
-     * @param  string $identifier Identifier for the entity class to be constructed.
23
-     *                            Typically a Fully Qualified Class Name
24
-     * @param array   $arguments  an array of arguments to be passed to the entity constructor
25
-     * @param string  $type
26
-     * @return mixed
27
-     */
28
-    public function brew($identifier, $arguments = array(), $type = '');
29
-
30
-
31
-
32
-    /**
33
-     * @param string   $identifier
34
-     * @param callable $closure
35
-     */
36
-    public function addClosure($identifier, $closure);
37
-
38
-
39
-
40
-    /**
41
-     * @param string $identifier
42
-     * @param mixed  $service
43
-     * @return boolean
44
-     */
45
-    public function addService($identifier, $service);
46
-
47
-
48
-
49
-    /**
50
-     * Adds instructions on how to brew objects
51
-     *
52
-     * @param RecipeInterface $recipe
53
-     * @return mixed
54
-     */
55
-    public function addRecipe(RecipeInterface $recipe);
56
-
57
-
58
-
59
-    /**
60
-     * Get instructions on how to brew objects
61
-     *
62
-     * @param string $identifier
63
-     * @return Recipe
64
-     */
65
-    public function getRecipe($identifier);
66
-
67
-
68
-
69
-    /**
70
-     * adds class name aliases to list of filters
71
-     *
72
-     * @param  string $identifier
73
-     * @param  array  $aliases
74
-     * @return string
75
-     */
76
-    public function addAliases($identifier, $aliases);
13
+	/**
14
+	 * returns an instance of the requested entity type using the supplied arguments.
15
+	 * If a shared service is requested and an instance is already in the carafe, then it will be returned.
16
+	 * If it is not already in the carafe, then the service will be constructed, added to the carafe, and returned
17
+	 * If the request is for a new entity and a closure exists in the reservoir for creating it,
18
+	 * then a new entity will be instantiated from the closure and returned.
19
+	 * If a closure does not exist, then one will be built and added to the reservoir
20
+	 * before instantiating the requested entity.
21
+	 *
22
+	 * @param  string $identifier Identifier for the entity class to be constructed.
23
+	 *                            Typically a Fully Qualified Class Name
24
+	 * @param array   $arguments  an array of arguments to be passed to the entity constructor
25
+	 * @param string  $type
26
+	 * @return mixed
27
+	 */
28
+	public function brew($identifier, $arguments = array(), $type = '');
29
+
30
+
31
+
32
+	/**
33
+	 * @param string   $identifier
34
+	 * @param callable $closure
35
+	 */
36
+	public function addClosure($identifier, $closure);
37
+
38
+
39
+
40
+	/**
41
+	 * @param string $identifier
42
+	 * @param mixed  $service
43
+	 * @return boolean
44
+	 */
45
+	public function addService($identifier, $service);
46
+
47
+
48
+
49
+	/**
50
+	 * Adds instructions on how to brew objects
51
+	 *
52
+	 * @param RecipeInterface $recipe
53
+	 * @return mixed
54
+	 */
55
+	public function addRecipe(RecipeInterface $recipe);
56
+
57
+
58
+
59
+	/**
60
+	 * Get instructions on how to brew objects
61
+	 *
62
+	 * @param string $identifier
63
+	 * @return Recipe
64
+	 */
65
+	public function getRecipe($identifier);
66
+
67
+
68
+
69
+	/**
70
+	 * adds class name aliases to list of filters
71
+	 *
72
+	 * @param  string $identifier
73
+	 * @param  array  $aliases
74
+	 * @return string
75
+	 */
76
+	public function addAliases($identifier, $aliases);
77 77
 }
Please login to merge, or discard this patch.
core/services/container/CoffeeMakerInterface.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -11,31 +11,31 @@
 block discarded – undo
11 11
  */
12 12
 interface CoffeeMakerInterface
13 13
 {
14
-    /**
15
-     * @return array
16
-     */
17
-    public static function getTypes();
14
+	/**
15
+	 * @return array
16
+	 */
17
+	public static function getTypes();
18 18
 
19 19
 
20 20
 
21
-    /**
22
-     * @param $type
23
-     */
24
-    public static function validateType($type);
21
+	/**
22
+	 * @param $type
23
+	 */
24
+	public static function validateType($type);
25 25
 
26 26
 
27 27
 
28
-    /**
29
-     * @param RecipeInterface $recipe
30
-     * @param array           $arguments
31
-     * @return mixed
32
-     */
33
-    public function brew(RecipeInterface $recipe, $arguments = array());
28
+	/**
29
+	 * @param RecipeInterface $recipe
30
+	 * @param array           $arguments
31
+	 * @return mixed
32
+	 */
33
+	public function brew(RecipeInterface $recipe, $arguments = array());
34 34
 
35 35
 
36 36
 
37
-    /**
38
-     * @return string
39
-     */
40
-    public function type();
37
+	/**
38
+	 * @return string
39
+	 */
40
+	public function type();
41 41
 }
Please login to merge, or discard this patch.
core/services/container/LoadOnlyCoffeeMaker.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -20,23 +20,23 @@
 block discarded – undo
20 20
  */
21 21
 class LoadOnlyCoffeeMaker extends CoffeeMaker
22 22
 {
23
-    /**
24
-     * @return string
25
-     */
26
-    public function type()
27
-    {
28
-        return CoffeeMaker::BREW_LOAD_ONLY;
29
-    }
23
+	/**
24
+	 * @return string
25
+	 */
26
+	public function type()
27
+	{
28
+		return CoffeeMaker::BREW_LOAD_ONLY;
29
+	}
30 30
 
31 31
 
32
-    /**
33
-     * @param RecipeInterface $recipe
34
-     * @param array           $arguments
35
-     * @return mixed
36
-     * @throws InvalidClassException
37
-     */
38
-    public function brew(RecipeInterface $recipe, $arguments = array())
39
-    {
40
-        return $this->resolveClassAndFilepath($recipe);
41
-    }
32
+	/**
33
+	 * @param RecipeInterface $recipe
34
+	 * @param array           $arguments
35
+	 * @return mixed
36
+	 * @throws InvalidClassException
37
+	 */
38
+	public function brew(RecipeInterface $recipe, $arguments = array())
39
+	{
40
+		return $this->resolveClassAndFilepath($recipe);
41
+	}
42 42
 }
Please login to merge, or discard this patch.