Completed
Push — master ( 4fbb13...0db14d )
by Aimeos
11:06
created
lib/custom/src/MW/Cache/Flow.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 	 * @param array $config List of configuration values
32 32
 	 * @param \Neos\Cache\Frontend\FrontendInterface $cache Neos cache object
33 33
 	 */
34
-	public function __construct( array $config, \Neos\Cache\Frontend\FrontendInterface $cache )
34
+	public function __construct(array $config, \Neos\Cache\Frontend\FrontendInterface $cache)
35 35
 	{
36
-		$this->prefix = ( isset( $config['siteid'] ) ? $config['siteid'] . '-' : '' );
36
+		$this->prefix = (isset($config['siteid']) ? $config['siteid'].'-' : '');
37 37
 		$this->object = $cache;
38 38
 	}
39 39
 
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 	 *
46 46
 	 * @param string $key Key string that identifies the single cache entry
47 47
 	 */
48
-	public function delete( $key )
48
+	public function delete($key)
49 49
 	{
50
-		$this->object->remove( $this->prefix . $key );
50
+		$this->object->remove($this->prefix.$key);
51 51
 	}
52 52
 
53 53
 
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
 	 * @param \Traversable|array $keys List of key strings that identify the cache entries
60 60
 	 * 	that should be removed
61 61
 	 */
62
-	public function deleteMultiple( $keys )
62
+	public function deleteMultiple($keys)
63 63
 	{
64
-		foreach( $keys as $key ) {
65
-			$this->object->remove( $this->prefix . $key );
64
+		foreach ($keys as $key) {
65
+			$this->object->remove($this->prefix.$key);
66 66
 		}
67 67
 	}
68 68
 
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
 	 * @param string[] $tags List of tag strings that are associated to one or more
76 76
 	 * 	cache entries that should be removed
77 77
 	 */
78
-	public function deleteByTags( array $tags )
78
+	public function deleteByTags(array $tags)
79 79
 	{
80
-		foreach( $tags as $tag ) {
81
-			$this->object->flushByTag( $this->prefix . $tag );
80
+		foreach ($tags as $tag) {
81
+			$this->object->flushByTag($this->prefix.$tag);
82 82
 		}
83 83
 	}
84 84
 
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 	 */
91 91
 	public function clear()
92 92
 	{
93
-		if( $this->prefix ) {
94
-			$this->object->flushByTag( $this->prefix . 'siteid' );
93
+		if ($this->prefix) {
94
+			$this->object->flushByTag($this->prefix.'siteid');
95 95
 		} else {
96 96
 			$this->object->flush();
97 97
 		}
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
 	 * @param string $default Value returned if requested key isn't found
108 108
 	 * @return mixed Value associated to the requested key
109 109
 	 */
110
-	public function get( $name, $default = null )
110
+	public function get($name, $default = null)
111 111
 	{
112
-		if( ( $entry = $this->object->get( $this->prefix . $name ) ) !== false ) {
112
+		if (($entry = $this->object->get($this->prefix.$name)) !== false) {
113 113
 			return $entry;
114 114
 		}
115 115
 
@@ -129,13 +129,13 @@  discard block
 block discarded – undo
129 129
 	 * 	will be in the result list
130 130
 	 * @throws \Aimeos\MW\Cache\Exception If the cache server doesn't respond
131 131
 	 */
132
-	public function getMultiple( $keys, $default = null )
132
+	public function getMultiple($keys, $default = null)
133 133
 	{
134 134
 		$result = array();
135 135
 
136
-		foreach( $keys as $key )
136
+		foreach ($keys as $key)
137 137
 		{
138
-			if( ( $entry = $this->object->get( $this->prefix . $key ) ) !== false ) {
138
+			if (($entry = $this->object->get($this->prefix.$key)) !== false) {
139 139
 				$result[$key] = $entry;
140 140
 			} else {
141 141
 				$result[$key] = $default;
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
 	 * 	entries. If a tag isn't associated to any cache entry, nothing is returned
157 157
 	 * 	for that tag
158 158
 	 */
159
-	public function getMultipleByTags( array $tags )
159
+	public function getMultipleByTags(array $tags)
160 160
 	{
161 161
 		$result = array();
162
-		$len = strlen( $this->prefix );
162
+		$len = strlen($this->prefix);
163 163
 
164
-		foreach( $tags as $tag )
164
+		foreach ($tags as $tag)
165 165
 		{
166
-			foreach( $this->object->getByTag( $this->prefix . $tag ) as $key => $value )
166
+			foreach ($this->object->getByTag($this->prefix.$tag) as $key => $value)
167 167
 			{
168
-				if( strncmp( $key, $this->prefix, $len ) === 0 ) {
169
-					$result[ substr( $key, $len ) ] = $value;
168
+				if (strncmp($key, $this->prefix, $len) === 0) {
169
+					$result[substr($key, $len)] = $value;
170 170
 				} else {
171 171
 					$result[$key] = $value;
172 172
 				}
@@ -190,19 +190,19 @@  discard block
 block discarded – undo
190 190
 	 * @param array $tags List of tag strings that should be assoicated to the
191 191
 	 * 	given value in the cache
192 192
 	 */
193
-	public function set( $key, $value, $expires = null, array $tags = array() )
193
+	public function set($key, $value, $expires = null, array $tags = array())
194 194
 	{
195
-		if( is_string( $expires ) ) {
196
-			$expires = date_create( $expires )->getTimestamp() - time();
195
+		if (is_string($expires)) {
196
+			$expires = date_create($expires)->getTimestamp() - time();
197 197
 		}
198 198
 
199
-		$tagList = ( $this->prefix ? array( $this->prefix . 'siteid' ) : array() );
199
+		$tagList = ($this->prefix ? array($this->prefix.'siteid') : array());
200 200
 
201
-		foreach( $tags as $tag ) {
202
-			$tagList[] = $this->prefix . $tag;
201
+		foreach ($tags as $tag) {
202
+			$tagList[] = $this->prefix.$tag;
203 203
 		}
204 204
 
205
-		$this->object->set( $this->prefix . $key, $value, $tagList, $expires );
205
+		$this->object->set($this->prefix.$key, $value, $tagList, $expires);
206 206
 	}
207 207
 
208 208
 
@@ -222,14 +222,14 @@  discard block
 block discarded – undo
222 222
 	 * @return null
223 223
 	 * @throws \Aimeos\MW\Cache\Exception If the cache server doesn't respond
224 224
 	 */
225
-	public function setMultiple( $pairs, $expires = null, array $tags = array() )
225
+	public function setMultiple($pairs, $expires = null, array $tags = array())
226 226
 	{
227
-		foreach( $pairs as $key => $value )
227
+		foreach ($pairs as $key => $value)
228 228
 		{
229
-			$tagList = ( isset( $tags[$key] ) ? (array) $tags[$key] : array() );
230
-			$keyExpire = ( isset( $expires[$key] ) ? $expires[$key] : $expires );
229
+			$tagList = (isset($tags[$key]) ? (array) $tags[$key] : array());
230
+			$keyExpire = (isset($expires[$key]) ? $expires[$key] : $expires);
231 231
 
232
-			$this->set( $key, $value, $keyExpire, $tagList );
232
+			$this->set($key, $value, $keyExpire, $tagList);
233 233
 		}
234 234
 	}
235 235
 }
Please login to merge, or discard this patch.
lib/custom/src/MW/View/Engine/Flow.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 *
28 28
 	 * @param \Neos\Fluid\View\StandaloneView $view Flow template view object
29 29
 	 */
30
-	public function __construct( \Neos\Fluid\View\StandaloneView $view )
30
+	public function __construct(\Neos\Fluid\View\StandaloneView $view)
31 31
 	{
32 32
 		$this->view = $view;
33 33
 	}
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 	 * @return string Output generated by the template
43 43
 	 * @throws \Aimeos\MW\View\Exception If the template isn't found
44 44
 	 */
45
-	public function render( \Aimeos\MW\View\Iface $view, $filename, array $values )
45
+	public function render(\Aimeos\MW\View\Iface $view, $filename, array $values)
46 46
 	{
47 47
 		$fluid = clone $this->view;
48 48
 
49
-		$fluid->setTemplatePathAndFilename( $filename );
50
-		$fluid->assign( '_aimeos_view', $view );
51
-		$fluid->assignMultiple( $values );
49
+		$fluid->setTemplatePathAndFilename($filename);
50
+		$fluid->assign('_aimeos_view', $view);
51
+		$fluid->assignMultiple($values);
52 52
 
53 53
 		return $fluid->render();
54 54
 	}
Please login to merge, or discard this patch.
lib/custom/src/MW/View/Helper/Url/Flow.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 	 * @param \Neos\Flow\Mvc\Routing\UriBuilder $builder Flow URI builder object
32 32
 	 * @param array Associative list of fixed parameters that should be available for all routes
33 33
 	 */
34
-	public function __construct( $view, \Neos\Flow\Mvc\Routing\UriBuilder $builder, array $fixed )
34
+	public function __construct($view, \Neos\Flow\Mvc\Routing\UriBuilder $builder, array $fixed)
35 35
 	{
36
-		parent::__construct( $view );
36
+		parent::__construct($view);
37 37
 
38 38
 		$this->builder = $builder;
39 39
 		$this->fixed = $fixed;
@@ -51,20 +51,20 @@  discard block
 block discarded – undo
51 51
 	 * @param array $config Additional configuration parameter per URL
52 52
 	 * @return string Complete URL that can be used in the template
53 53
 	 */
54
-	public function transform( $target = null, $controller = null, $action = null, array $params = array(), array $trailing = array(), array $config = array() )
54
+	public function transform($target = null, $controller = null, $action = null, array $params = array(), array $trailing = array(), array $config = array())
55 55
 	{
56
-		$params = $this->sanitize( $params );
57
-		$values = $this->getValues( $config );
56
+		$params = $this->sanitize($params);
57
+		$values = $this->getValues($config);
58 58
 
59 59
 		$this->builder
60 60
 			->reset()
61
-			->setSection( join( '/', $trailing ) )
62
-			->setCreateAbsoluteUri( $values['absoluteUri'] )
63
-			->setFormat( $values['format'] );
61
+			->setSection(join('/', $trailing))
62
+			->setCreateAbsoluteUri($values['absoluteUri'])
63
+			->setFormat($values['format']);
64 64
 
65 65
 		$params['node'] = $target;
66 66
 
67
-		return $this->builder->uriFor( $action, $params + $this->fixed, $controller, $values['package'], $values['subpackage'] );
67
+		return $this->builder->uriFor($action, $params + $this->fixed, $controller, $values['package'], $values['subpackage']);
68 68
 	}
69 69
 
70 70
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 * @param array $config Associative list of key/value pairs
75 75
 	 * @return array Associative list of sanitized key/value pairs
76 76
 	 */
77
-	protected function getValues( array $config )
77
+	protected function getValues(array $config)
78 78
 	{
79 79
 		$values = array(
80 80
 			'package' => 'Aimeos.Shop',
@@ -83,19 +83,19 @@  discard block
 block discarded – undo
83 83
 			'format' => 'html',
84 84
 		);
85 85
 
86
-		if( isset( $config['package'] ) ) {
86
+		if (isset($config['package'])) {
87 87
 			$values['package'] = (string) $config['package'];
88 88
 		}
89 89
 
90
-		if( isset( $config['subpackage'] ) ) {
90
+		if (isset($config['subpackage'])) {
91 91
 			$values['subpackage'] = (string) $config['subpackage'];
92 92
 		}
93 93
 
94
-		if( isset( $config['absoluteUri'] ) ) {
94
+		if (isset($config['absoluteUri'])) {
95 95
 			$values['absoluteUri'] = (bool) $config['absoluteUri'];
96 96
 		}
97 97
 
98
-		if( isset( $config['format'] ) ) {
98
+		if (isset($config['format'])) {
99 99
 			$values['format'] = (string) $config['format'];
100 100
 		}
101 101
 
Please login to merge, or discard this patch.
lib/custom/src/MAdmin/Cache/Proxy/Flow.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @param \Aimeos\MShop\Context\Item\Iface $context MShop context object
33 33
 	 * @param \Neos\Cache\Frontend\StringFrontend $cache Flow cache object
34 34
 	 */
35
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context, \Neos\Cache\Frontend\StringFrontend $cache )
35
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context, \Neos\Cache\Frontend\StringFrontend $cache)
36 36
 	{
37 37
 		$this->context = $context;
38 38
 		$this->cache = $cache;
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	protected function getObject()
48 48
 	{
49
-		if( !isset( $this->object ) )
49
+		if (!isset($this->object))
50 50
 		{
51 51
 			$siteid = $this->context->getLocale()->getSiteId();
52
-			$conf = array( 'siteid' => $this->context->getConfig()->get( 'madmin/cache/prefix' ) . $siteid );
53
-			$this->object = \Aimeos\MW\Cache\Factory::createManager( 'Flow', $conf, $this->cache );
52
+			$conf = array('siteid' => $this->context->getConfig()->get('madmin/cache/prefix').$siteid);
53
+			$this->object = \Aimeos\MW\Cache\Factory::createManager('Flow', $conf, $this->cache);
54 54
 		}
55 55
 
56 56
 		return $this->object;
Please login to merge, or discard this patch.