@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param \Aimeos\Controller\Frontend\Iface $controller Controller object |
31 | 31 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects |
32 | 32 | */ |
33 | - public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context ) |
|
33 | + public function __construct(\Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context) |
|
34 | 34 | { |
35 | 35 | $this->context = $context; |
36 | 36 | $this->controller = $controller; |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | * @return mixed Returns the value of the called method |
46 | 46 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
47 | 47 | */ |
48 | - public function __call( $name, array $param ) |
|
48 | + public function __call($name, array $param) |
|
49 | 49 | { |
50 | - return @call_user_func_array( array( $this->controller, $name ), $param ); |
|
50 | + return @call_user_func_array(array($this->controller, $name), $param); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
62 | 62 | * @since 2017.03 |
63 | 63 | */ |
64 | - public function addFilterAttribute( \Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds ) |
|
64 | + public function addFilterAttribute(\Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds) |
|
65 | 65 | { |
66 | - return $this->getController()->addFilterAttribute( $filter, $attrIds, $optIds, $oneIds ); |
|
66 | + return $this->getController()->addFilterAttribute($filter, $attrIds, $optIds, $oneIds); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | |
@@ -79,10 +79,10 @@ discard block |
||
79 | 79 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
80 | 80 | * @since 2017.03 |
81 | 81 | */ |
82 | - public function addFilterCategory( \Aimeos\MW\Criteria\Iface $filter, $catId, |
|
83 | - $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE, $sort = null, $direction = '+', $listtype = 'default' ) |
|
82 | + public function addFilterCategory(\Aimeos\MW\Criteria\Iface $filter, $catId, |
|
83 | + $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE, $sort = null, $direction = '+', $listtype = 'default') |
|
84 | 84 | { |
85 | - return $this->getController()->addFilterCategory( $search, $catid, $level, $sort, $direction, $listtype ); |
|
85 | + return $this->getController()->addFilterCategory($search, $catid, $level, $sort, $direction, $listtype); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
98 | 98 | * @since 2017.03 |
99 | 99 | */ |
100 | - public function addFilterText( \Aimeos\MW\Criteria\Iface $filter, $input, $sort = null, $direction = '+', $listtype = 'default' ) |
|
100 | + public function addFilterText(\Aimeos\MW\Criteria\Iface $filter, $input, $sort = null, $direction = '+', $listtype = 'default') |
|
101 | 101 | { |
102 | - return $this->getController()->addProductFilterText( $search, $input, $sort, $direction, $listtype ); |
|
102 | + return $this->getController()->addProductFilterText($search, $input, $sort, $direction, $listtype); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | * @return array Associative list of key values as key and the product count for this key as value |
112 | 112 | * @since 2015.08 |
113 | 113 | */ |
114 | - public function aggregate( \Aimeos\MW\Criteria\Iface $filter, $key ) |
|
114 | + public function aggregate(\Aimeos\MW\Criteria\Iface $filter, $key) |
|
115 | 115 | { |
116 | - return $this->getController()->aggregate( $filter, $key ); |
|
116 | + return $this->getController()->aggregate($filter, $key); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
129 | 129 | * @since 2015.08 |
130 | 130 | */ |
131 | - public function createFilter( $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
|
131 | + public function createFilter($sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default') |
|
132 | 132 | { |
133 | - return $this->getController()->createFilter( $sort, $direction, $start, $size, $listtype ); |
|
133 | + return $this->getController()->createFilter($sort, $direction, $start, $size, $listtype); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | |
@@ -142,9 +142,9 @@ discard block |
||
142 | 142 | * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items |
143 | 143 | * @since 2017.03 |
144 | 144 | */ |
145 | - public function getItem( $productId, array $domains = array( 'attribute', 'media', 'price', 'product', 'product/property', 'text' ) ) |
|
145 | + public function getItem($productId, array $domains = array('attribute', 'media', 'price', 'product', 'product/property', 'text')) |
|
146 | 146 | { |
147 | - return $this->getController()->getItem( $productId, $domains ); |
|
147 | + return $this->getController()->getItem($productId, $domains); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | |
@@ -156,9 +156,9 @@ discard block |
||
156 | 156 | * @return \Aimeos\MShop\Product\Item\Iface[] Associative list of product IDs as keys and product items as values |
157 | 157 | * @since 2017.03 |
158 | 158 | */ |
159 | - public function getItems( array $productIds, array $domains = array( 'media', 'price', 'text' ) ) |
|
159 | + public function getItems(array $productIds, array $domains = array('media', 'price', 'text')) |
|
160 | 160 | { |
161 | - return $this->getController()->getItems( $productIds, $domains ); |
|
161 | + return $this->getController()->getItems($productIds, $domains); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
@@ -171,9 +171,9 @@ discard block |
||
171 | 171 | * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface |
172 | 172 | * @since 2015.08 |
173 | 173 | */ |
174 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
|
174 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null) |
|
175 | 175 | { |
176 | - return $this->getController()->searchItems( $filter, $domains, $total ); |
|
176 | + return $this->getController()->searchItems($filter, $domains, $total); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @param string|null $name Name of the controller implementaton (default: "Standard") |
29 | 29 | * @return \Aimeos\Controller\Frontend\Product\Iface Controller object |
30 | 30 | */ |
31 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
31 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
32 | 32 | { |
33 | 33 | /** controller/frontend/product/name |
34 | 34 | * Class name of the used product frontend controller implementation |
@@ -63,20 +63,20 @@ discard block |
||
63 | 63 | * @since 2017.03 |
64 | 64 | * @category Developer |
65 | 65 | */ |
66 | - if( $name === null ) { |
|
67 | - $name = $context->getConfig()->get( 'controller/frontend/product/name', 'Standard' ); |
|
66 | + if ($name === null) { |
|
67 | + $name = $context->getConfig()->get('controller/frontend/product/name', 'Standard'); |
|
68 | 68 | } |
69 | 69 | |
70 | - if( ctype_alnum( $name ) === false ) |
|
70 | + if (ctype_alnum($name) === false) |
|
71 | 71 | { |
72 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Frontend\\Product\\' . $name : '<not a string>'; |
|
73 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
72 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Frontend\\Product\\' . $name : '<not a string>'; |
|
73 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | $iface = '\\Aimeos\\Controller\\Frontend\\Product\\Iface'; |
77 | 77 | $classname = '\\Aimeos\\Controller\\Frontend\\Product\\' . $name; |
78 | 78 | |
79 | - $manager = self::createControllerBase( $context, $classname, $iface ); |
|
79 | + $manager = self::createControllerBase($context, $classname, $iface); |
|
80 | 80 | |
81 | 81 | /** controller/frontend/product/decorators/excludes |
82 | 82 | * Excludes decorators added by the "common" option from the product frontend controllers |
@@ -152,6 +152,6 @@ discard block |
||
152 | 152 | * @see controller/frontend/product/decorators/excludes |
153 | 153 | * @see controller/frontend/product/decorators/global |
154 | 154 | */ |
155 | - return self::addControllerDecorators( $context, $manager, 'product' ); |
|
155 | + return self::addControllerDecorators($context, $manager, 'product'); |
|
156 | 156 | } |
157 | 157 | } |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | * @param integer $id Context ID the objects have been created with (string of \Aimeos\MShop\Context\Item\Iface) |
31 | 31 | * @param string $path Path describing the controller to clear, e.g. "basket" |
32 | 32 | */ |
33 | - static public function clear( $id = null, $path = null ) |
|
33 | + static public function clear($id = null, $path = null) |
|
34 | 34 | { |
35 | - if( $id !== null ) |
|
35 | + if ($id !== null) |
|
36 | 36 | { |
37 | - if( $path !== null ) { |
|
37 | + if ($path !== null) { |
|
38 | 38 | self::$controllers[$id][$path] = null; |
39 | 39 | } else { |
40 | 40 | self::$controllers[$id] = array(); |
@@ -62,37 +62,37 @@ discard block |
||
62 | 62 | * @return \Aimeos\Controller\Frontend\Iface New frontend controller |
63 | 63 | * @throws \Aimeos\Controller\Frontend\Exception If the given path is invalid or the manager wasn't found |
64 | 64 | */ |
65 | - static public function createController( \Aimeos\MShop\Context\Item\Iface $context, $path ) |
|
65 | + static public function createController(\Aimeos\MShop\Context\Item\Iface $context, $path) |
|
66 | 66 | { |
67 | - if( empty( $path ) ) { |
|
68 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Controller path is empty' ) ); |
|
67 | + if (empty($path)) { |
|
68 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Controller path is empty')); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | $id = (string) $context; |
72 | 72 | |
73 | - if( self::$cache === false || !isset( self::$controllers[$id][$path] ) ) |
|
73 | + if (self::$cache === false || !isset(self::$controllers[$id][$path])) |
|
74 | 74 | { |
75 | - $parts = explode( '/', $path ); |
|
75 | + $parts = explode('/', $path); |
|
76 | 76 | |
77 | - foreach( $parts as $key => $part ) |
|
77 | + foreach ($parts as $key => $part) |
|
78 | 78 | { |
79 | - if( ctype_alnum( $part ) === false ) { |
|
80 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in controller name "%1$s" in "%2$s"', $part, $path ) ); |
|
79 | + if (ctype_alnum($part) === false) { |
|
80 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in controller name "%1$s" in "%2$s"', $part, $path)); |
|
81 | 81 | } |
82 | 82 | |
83 | - $parts[$key] = ucwords( $part ); |
|
83 | + $parts[$key] = ucwords($part); |
|
84 | 84 | } |
85 | 85 | |
86 | - $factory = '\\Aimeos\\Controller\\Frontend\\' . join( '\\', $parts ) . '\\Factory'; |
|
86 | + $factory = '\\Aimeos\\Controller\\Frontend\\' . join('\\', $parts) . '\\Factory'; |
|
87 | 87 | |
88 | - if( class_exists( $factory ) === false ) { |
|
89 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" not available', $factory ) ); |
|
88 | + if (class_exists($factory) === false) { |
|
89 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" not available', $factory)); |
|
90 | 90 | } |
91 | 91 | |
92 | - $manager = call_user_func_array( array( $factory, 'createController' ), array( $context ) ); |
|
92 | + $manager = call_user_func_array(array($factory, 'createController'), array($context)); |
|
93 | 93 | |
94 | - if( $manager === false ) { |
|
95 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid factory "%1$s"', $factory ) ); |
|
94 | + if ($manager === false) { |
|
95 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid factory "%1$s"', $factory)); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | self::$controllers[$id][$path] = $manager; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * @param boolean $value True to enable caching, false to disable it. |
109 | 109 | * @return boolean Previous cache setting |
110 | 110 | */ |
111 | - static public function setCache( $value ) |
|
111 | + static public function setCache($value) |
|
112 | 112 | { |
113 | 113 | $old = self::$cache; |
114 | 114 | self::$cache = (boolean) $value; |