Passed
Push — develop ( 9c6499...a5e1bf )
by Jens
02:46
created
src/cc/Application.php 2 patches
Doc Comments   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,6 +83,9 @@  discard block
 block discarded – undo
83 83
             $this->storage = new Storage($this->getStorageDir(), $this->config->imagesDir, $this->config->filesDir);
84 84
         }
85 85
 
86
+        /**
87
+         * @param Request $request
88
+         */
86 89
         private function redirectMatching($request)
87 90
         {
88 91
             $redirects = $this->storage->getRedirects()->getRedirects();
@@ -112,7 +115,7 @@  discard block
 block discarded – undo
112 115
          * Loop through sitemap items and see if one matches the requestUri.
113 116
          * If it does, add it tot the matchedSitemapItems array
114 117
          *
115
-         * @param $request
118
+         * @param Request $request
116 119
          */
117 120
         private function sitemapMatching($request)
118 121
         {
@@ -177,7 +180,7 @@  discard block
 block discarded – undo
177 180
          * @param array $parameters
178 181
          * @param \stdClass|null $matchedSitemapItem
179 182
          *
180
-         * @return mixed
183
+         * @return Component
181 184
          * @throws \Exception
182 185
          */
183 186
         private function getComponentObject($class = '', $template = '', $parameters = array(), $matchedSitemapItem)
@@ -268,6 +271,9 @@  discard block
 block discarded – undo
268 271
             return $this->config->templateDir;
269 272
         }
270 273
 
274
+        /**
275
+         * @return string
276
+         */
271 277
         public function getStorageDir()
272 278
         {
273 279
             return $this->config->storageDir;
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
          */
67 67
         private function config()
68 68
         {
69
-            $configPath = __DIR__ . '/../../config.json';
69
+            $configPath = __DIR__.'/../../config.json';
70 70
             if (realpath($configPath) !== false) {
71 71
                 $json = file_get_contents($configPath);
72 72
                 $this->config = json_decode($json);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         private function redirectMatching($request)
87 87
         {
88 88
             $redirects = $this->storage->getRedirects()->getRedirects();
89
-            $relativeUri = '/' . $request::$relativeUri;
89
+            $relativeUri = '/'.$request::$relativeUri;
90 90
 
91 91
             foreach ($redirects as $redirect) {
92 92
                 if (preg_match_all($redirect->fromUrl, $relativeUri, $matches)) {
@@ -96,10 +96,10 @@  discard block
 block discarded – undo
96 96
                     }
97 97
                     if ($redirect->type == '301') {
98 98
                         header('HTTP/1.1 301 Moved Permanently');
99
-                        header('Location: ' . $request::$subfolders . $toUrl);
99
+                        header('Location: '.$request::$subfolders.$toUrl);
100 100
                         exit;
101 101
                     } elseif ($redirect->type == '302') {
102
-                        header('Location: ' . $request::$subfolders . $toUrl, true, 302);
102
+                        header('Location: '.$request::$subfolders.$toUrl, true, 302);
103 103
                         exit;
104 104
                     } else {
105 105
                         throw new \Exception('Invalid redirect type.');
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         private function sitemapMatching($request)
118 118
         {
119 119
             $sitemap = $this->storage->getSitemap()->getSitemap();
120
-            $relativeUri = '/' . $request::$relativeUri;
120
+            $relativeUri = '/'.$request::$relativeUri;
121 121
 
122 122
             foreach ($sitemap as $sitemapItem) {
123 123
                 if ($sitemapItem->regex) {
@@ -182,15 +182,15 @@  discard block
 block discarded – undo
182 182
          */
183 183
         private function getComponentObject($class = '', $template = '', $parameters = array(), $matchedSitemapItem)
184 184
         {
185
-            $libraryComponentName = '\\CloudControl\Cms\\components\\' . $class;
186
-            $userComponentName = '\\components\\' . $class;
185
+            $libraryComponentName = '\\CloudControl\Cms\\components\\'.$class;
186
+            $userComponentName = '\\components\\'.$class;
187 187
 
188 188
             if (!class_exists($libraryComponentName, false)) {
189 189
                 $component = new $libraryComponentName($template, $this->request, $parameters, $matchedSitemapItem);
190 190
             } elseif (!class_exists($userComponentName, false)) {
191 191
                 $component = new $userComponentName($template, $this->request, $parameters, $matchedSitemapItem);
192 192
             } else {
193
-                throw new \Exception('Could not load component ' . $class);
193
+                throw new \Exception('Could not load component '.$class);
194 194
             }
195 195
 
196 196
             if (!$component instanceof Component) {
@@ -248,8 +248,8 @@  discard block
 block discarded – undo
248 248
          */
249 249
         public function setCachingHeaders()
250 250
         {
251
-            header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 2))); // 2 days
252
-            header("Cache-Control: max-age=" . (60 * 60 * 24 * 2));
251
+            header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 2))); // 2 days
252
+            header("Cache-Control: max-age=".(60 * 60 * 24 * 2));
253 253
         }
254 254
 
255 255
         /**
Please login to merge, or discard this patch.
src/components/BaseComponent.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -141,8 +141,8 @@
 block discarded – undo
141 141
 		}
142 142
 
143 143
         /**
144
-         * @param $template
145
-         * @param null $application
144
+         * @param string $template
145
+         * @param null|Application $application
146 146
          * @return string
147 147
          */
148 148
         protected function getTemplatePath($template, $application=null)
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 		 * @param array   $parameters
41 41
 		 * @param         $matchedSitemapItem
42 42
 		 */
43
-		public function __construct($template='', Request $request, $parameters=array(), $matchedSitemapItem)
43
+		public function __construct($template = '', Request $request, $parameters = array(), $matchedSitemapItem)
44 44
 		{
45 45
 			$this->template = $template;
46 46
 			$this->request = $request;
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		 *
66 66
 		 * @throws \Exception
67 67
 		 */
68
-		public function render($application=null)
68
+		public function render($application = null)
69 69
 		{
70 70
 			$this->renderedContent = $this->renderTemplate($this->template, true, $application);
71 71
 		}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		 * @return string
92 92
 		 * @throws \Exception
93 93
 		 */
94
-		public function renderTemplate($template='', $obClean = true, $application=null)
94
+		public function renderTemplate($template = '', $obClean = true, $application = null)
95 95
 		{
96 96
 		    $templatePath = $this->getTemplatePath($template, $application);
97 97
 			if (realpath($templatePath) !== false) {
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 				return ob_get_contents();
111 111
 			} else {
112 112
 				if ($template !== null) { // If template is null, its a application component, which doesnt have a template
113
-					throw new \Exception('Couldnt find template ' . $templatePath);
113
+					throw new \Exception('Couldnt find template '.$templatePath);
114 114
 				}
115 115
 			}
116 116
 		}
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 		 * @return string
126 126
 		 * @throws \Exception
127 127
 		 */
128
-		public function includeTemplate($template='', $parameters = array())
128
+		public function includeTemplate($template = '', $parameters = array())
129 129
 		{
130 130
 			if (is_array($parameters)) {
131 131
 				foreach ($parameters as $name => $value) {
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
          * @param null $application
146 146
          * @return string
147 147
          */
148
-        protected function getTemplatePath($template, $application=null)
148
+        protected function getTemplatePath($template, $application = null)
149 149
         {
150 150
             $templatePath = $application->getTemplatePath();
151
-            $templatePath = $templatePath . DIRECTORY_SEPARATOR . $template . '.php';
151
+            $templatePath = $templatePath.DIRECTORY_SEPARATOR.$template.'.php';
152 152
             return $templatePath;
153 153
         }
154 154
     }
Please login to merge, or discard this patch.
src/components/FormComponent.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	}
181 181
 
182 182
 	/**
183
-	 * @param \cc\Request $request
183
+	 * @param \CloudControl\Cms\cc\Request $request
184 184
 	 * @return array
185 185
 	 */
186 186
 	private function getPostValues($request)
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 	}
292 292
 
293 293
 	/**
294
-	 * @return \cc\Request
294
+	 * @return \CloudControl\Cms\cc\Request
295 295
 	 */
296 296
 	private function setPathBackup()
297 297
 	{
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 	}
306 306
 
307 307
 	/**
308
-	 * @param \cc\Request $request
308
+	 * @param \CloudControl\Cms\cc\Request $request
309 309
 	 */
310 310
 	private function resetPathBackup($request)
311 311
 	{
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 	}
318 318
 
319 319
 	/**
320
-	 * @param $form
320
+	 * @param string|null $form
321 321
 	 */
322 322
 	private function setFormParameter($form)
323 323
 	{
Please login to merge, or discard this patch.
src/storage/storage/ImagesStorage.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -13,6 +13,10 @@
 block discarded – undo
13 13
 {
14 14
     protected $imagesDir;
15 15
 
16
+    /**
17
+     * @param \CloudControl\Cms\storage\Repository $repository
18
+     * @param string $imagesDir
19
+     */
16 20
     public function __construct($repository, $imagesDir)
17 21
     {
18 22
         parent::__construct($repository);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
         $destinationPath = $this->getDestinationPath();
46 46
 
47 47
         $filename = $this->validateFilename($postValues['name'], $destinationPath);
48
-        $destination = $destinationPath . DIRECTORY_SEPARATOR . $filename;
48
+        $destination = $destinationPath.DIRECTORY_SEPARATOR.$filename;
49 49
 
50 50
         if ($postValues['error'] != '0') {
51
-            throw new \Exception('Error uploading file. Error code: ' . $postValues['error']);
51
+            throw new \Exception('Error uploading file. Error code: '.$postValues['error']);
52 52
         }
53 53
 
54 54
         if (move_uploaded_file($postValues['tmp_name'], $destination)) {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         foreach ($images as $key => $image) {
81 81
             if ($image->file == $filename) {
82 82
                 foreach ($image->set as $imageSetFilename) {
83
-                    $destination = $destinationPath . '/' . $imageSetFilename;
83
+                    $destination = $destinationPath.'/'.$imageSetFilename;
84 84
                     if (file_exists($destination)) {
85 85
                         unlink($destination);
86 86
                     } else {
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     private function getDestinationPath()
130 130
     {
131
-        $destinationPath = realpath($this->imagesDir . DIRECTORY_SEPARATOR);
131
+        $destinationPath = realpath($this->imagesDir.DIRECTORY_SEPARATOR);
132 132
         return $destinationPath;
133 133
     }
134 134
 }
135 135
\ No newline at end of file
Please login to merge, or discard this patch.
src/images/ImageResizer.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 				}
46 46
 				return $returnFileNames;
47 47
 			} else {
48
-				throw new \Exception('Image doesnt exist: ' . $imagePath);
48
+				throw new \Exception('Image doesnt exist: '.$imagePath);
49 49
 			}
50 50
 		}
51 51
 
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
 		 * @return string
57 57
 		 * @throws \Exception
58 58
 		 */
59
-		public function resize($imagePath='', $width='',$height='')
59
+		public function resize($imagePath = '', $width = '', $height = '')
60 60
 		{
61
-			$modifier = '-r' . $width . 'x' . $height;
62
-			return $this->applyMethod('Resize', $imagePath, $width,$height, $modifier);
61
+			$modifier = '-r'.$width.'x'.$height;
62
+			return $this->applyMethod('Resize', $imagePath, $width, $height, $modifier);
63 63
 		}
64 64
 
65 65
 		/**
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
 		 * @return string
70 70
 		 * @throws \Exception
71 71
 		 */
72
-		public function smartcrop($imagePath='', $width='',$height='')
72
+		public function smartcrop($imagePath = '', $width = '', $height = '')
73 73
 		{
74
-			$modifier = '-s' . $width . 'x' . $height;
75
-			return $this->applyMethod('SmartCrop', $imagePath, $width,$height, $modifier);
74
+			$modifier = '-s'.$width.'x'.$height;
75
+			return $this->applyMethod('SmartCrop', $imagePath, $width, $height, $modifier);
76 76
 		}
77 77
 
78 78
 		/**
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
 		 * @return string
83 83
 		 * @throws \Exception
84 84
 		 */
85
-		public function boxcrop($imagePath='', $width='',$height='')
85
+		public function boxcrop($imagePath = '', $width = '', $height = '')
86 86
 		{
87
-			$modifier = '-b' . $width . 'x' . $height;
88
-			return $this->applyMethod('BoxCrop', $imagePath, $width,$height, $modifier);
87
+			$modifier = '-b'.$width.'x'.$height;
88
+			return $this->applyMethod('BoxCrop', $imagePath, $width, $height, $modifier);
89 89
 		}
90 90
 
91 91
 		/**
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 		 *
95 95
 		 * @return string
96 96
 		 */
97
-		private function modifyName($imagePath, $modifier='')
97
+		private function modifyName($imagePath, $modifier = '')
98 98
 		{
99 99
 			$filename = basename($imagePath);
100 100
 			$path = dirname($imagePath);
@@ -104,30 +104,30 @@  discard block
 block discarded – undo
104 104
 				array_pop($fileParts);
105 105
 				$fileNameWithoutExtension = implode('-', $fileParts);
106 106
 				$fileNameWithoutExtension = StringUtil::slugify($fileNameWithoutExtension);
107
-				$filename = $fileNameWithoutExtension . $modifier  . '.' . $extension;
107
+				$filename = $fileNameWithoutExtension.$modifier.'.'.$extension;
108 108
 			} else {
109 109
 				$filename = StringUtil::slugify($filename);
110 110
 			}
111 111
 
112
-			if (file_exists($path . '/' . $filename)) {
112
+			if (file_exists($path.'/'.$filename)) {
113 113
 				$fileParts = explode('.', $filename);
114 114
 				if (count($fileParts) > 1) {
115 115
 					$extension = end($fileParts);
116 116
 					array_pop($fileParts);
117 117
 					$fileNameWithoutExtension = implode('-', $fileParts);
118 118
 					$fileNameWithoutExtension .= '-copy';
119
-					$filename = $fileNameWithoutExtension . '.' . $extension;
119
+					$filename = $fileNameWithoutExtension.'.'.$extension;
120 120
 				} else {
121 121
 					$filename .= '-copy';
122 122
 				}
123
-				return $this->modifyName($path . '/' . $filename);
123
+				return $this->modifyName($path.'/'.$filename);
124 124
 			}
125
-			return $path . '/' . $filename;
125
+			return $path.'/'.$filename;
126 126
 		}
127 127
 
128 128
 		private function applyMethod($method, $imagePath, $width, $height, $modifier)
129 129
 		{
130
-			$method = 'CloudControl\Cms\\images\\methods\\' . $method;
130
+			$method = 'CloudControl\Cms\\images\\methods\\'.$method;
131 131
 			$destination = $this->modifyName($imagePath, $modifier);
132 132
 			if (file_exists($imagePath)) {
133 133
 				$image = new Image();
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 				$resizedImage->saveImage($destination, $resizedImage->getImageMimeType($imagePath), 80);
142 142
 				return basename($destination);
143 143
 			} else {
144
-				throw new \Exception('Image doesnt exist: ' . $imagePath);
144
+				throw new \Exception('Image doesnt exist: '.$imagePath);
145 145
 			}
146 146
 		}
147 147
 	}
Please login to merge, or discard this patch.
src/cc/Request.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,23 +45,23 @@
 block discarded – undo
45 45
 		 */
46 46
 		public function __construct() 
47 47
 		{
48
-            $rootPath = str_replace('\\', '/', realpath(str_replace('\\', '/', dirname(__FILE__)) . '/../../') . '/');
48
+            $rootPath = str_replace('\\', '/', realpath(str_replace('\\', '/', dirname(__FILE__)).'/../../').'/');
49 49
 			
50
-			self::$subfolders = '/' . str_replace('//', '/', str_replace(str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']), "", $rootPath));
50
+			self::$subfolders = '/'.str_replace('//', '/', str_replace(str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']), "", $rootPath));
51 51
 			self::$subfolders = str_replace('//', '/', self::$subfolders);
52 52
 			if (PHP_SAPI === 'cli') {
53 53
 				global $argv;
54 54
 				array_shift($argv);
55 55
 				self::$queryString = '';
56
-				self::$requestUri = self::$subfolders . implode('/', $argv);
56
+				self::$requestUri = self::$subfolders.implode('/', $argv);
57 57
 			} else {
58 58
 				self::$requestUri = $_SERVER['REQUEST_URI'];
59 59
 				self::$queryString = $_SERVER['QUERY_STRING'];
60 60
 			}
61 61
 			if (self::$subfolders === '/') {
62
-				self::$relativeUri = str_replace('?' . self::$queryString, '', substr(self::$requestUri,1));
62
+				self::$relativeUri = str_replace('?'.self::$queryString, '', substr(self::$requestUri, 1));
63 63
 			} else {
64
-				self::$relativeUri = str_replace('?' . self::$queryString, '', str_replace(self::$subfolders, '', self::$requestUri));
64
+				self::$relativeUri = str_replace('?'.self::$queryString, '', str_replace(self::$subfolders, '', self::$requestUri));
65 65
 			}
66 66
 
67 67
 			self::$requestParameters = explode('/', self::$relativeUri);
Please login to merge, or discard this patch.
src/templates/documents/function.renderDocument.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 { ?>
10 10
   <div class="grid-box-10">
11 11
     <h3>
12
-      <a class="btn documentTitle" href="<?= $request::$subfolders ?><?= $cmsPrefix ?>/documents/edit-document?slug=<?= $slugPrefix . $document->slug ?>" title="Edit">
12
+      <a class="btn documentTitle" href="<?= $request::$subfolders ?><?= $cmsPrefix ?>/documents/edit-document?slug=<?= $slugPrefix.$document->slug ?>" title="Edit">
13 13
         <i class="fa fa-file-text-o"></i>
14 14
         <small class="state <?= strtolower($document->state) ?>">
15 15
           <i class="fa <?= $document->state == 'published' ? 'fa-check-circle-o' : 'fa-times-circle-o' ?>"></i></small>
@@ -32,23 +32,23 @@  discard block
 block discarded – undo
32 32
       <? if ($document->state == 'unpublished' || $document->unpublishedChanges) : ?>
33 33
           <? renderAction('Publish',
34 34
               'publish',
35
-              $request::$subfolders . $cmsPrefix . '/documents/publish-document?slug=' . $slugPrefix . $document->slug,
35
+              $request::$subfolders.$cmsPrefix.'/documents/publish-document?slug='.$slugPrefix.$document->slug,
36 36
               'check'); ?>
37 37
       <? endif ?>
38 38
       <? if ($document->state == 'published') : ?>
39 39
           <? renderAction('Unpublish',
40 40
               'unpublish',
41
-              $request::$subfolders . $cmsPrefix . '/documents/unpublish-document?slug=' . $slugPrefix . $document->slug,
41
+              $request::$subfolders.$cmsPrefix.'/documents/unpublish-document?slug='.$slugPrefix.$document->slug,
42 42
               'times'); ?>
43 43
       <? endif ?>
44 44
       <? renderAction('Edit',
45 45
           '',
46
-          $request::$subfolders . $cmsPrefix . '/documents/edit-document?slug=' . $slugPrefix . $document->slug,
46
+          $request::$subfolders.$cmsPrefix.'/documents/edit-document?slug='.$slugPrefix.$document->slug,
47 47
           'pencil'); ?>
48 48
       <? if ($document->state == 'unpublished') : ?>
49 49
           <? renderAction('Delete',
50 50
               'error',
51
-              $request::$subfolders . $cmsPrefix . '/documents/delete-document?slug=' . $slugPrefix . $document->slug,
51
+              $request::$subfolders.$cmsPrefix.'/documents/delete-document?slug='.$slugPrefix.$document->slug,
52 52
               'trash',
53 53
               'return confirm(\'Are you sure you want to delete this document?\');'); ?>
54 54
       <? endif ?>
Please login to merge, or discard this patch.
src/templates/documents/brick.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@  discard block
 block discarded – undo
4 4
 </div>
5 5
 <label><?= $brick->title ?></label>
6 6
 <? if ($static == true) {
7
-    $fieldPrefix = 'bricks[' . $myBrickSlug . '][' . str_replace('.', '', str_replace(' ', '', microtime())) . '][fields]';
7
+    $fieldPrefix = 'bricks['.$myBrickSlug.']['.str_replace('.', '', str_replace(' ', '', microtime())).'][fields]';
8 8
 } else {
9
-    $fieldPrefix = 'dynamicBricks[' . $brick->slug . '][' . str_replace('.', '', str_replace(' ', '', microtime())) . ']';
9
+    $fieldPrefix = 'dynamicBricks['.$brick->slug.']['.str_replace('.', '', str_replace(' ', '', microtime())).']';
10 10
 } ?>
11 11
 <? foreach ($brick->fields as $field) : ?>
12 12
 			<div class="form-element">
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 							<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
32 32
 							<div class="form-element">
33 33
 				<? endif ?>
34
-					<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
34
+					<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
35 35
 				<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
36 36
 
37 37
 							</div>
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 						<li class="grid-container">
54 54
 							<div class="grid-box-10">
55 55
 								<div class="grid-inner form-element">
56
-									<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
56
+									<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
57 57
 								</div>
58 58
 							</div>
59 59
 							<div class="grid-box-2">
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 								</div>
64 64
 							</div>
65 65
 						</li>
66
-						<?$value='';?>
66
+						<?$value = ''; ?>
67 67
 						<? endforeach ?>
68 68
 					<? endif ?>
69 69
 				</ul>
@@ -80,10 +80,10 @@  discard block
 block discarded – undo
80 80
 							<a class="btn error js-deletemultiple"><i class="fa fa-trash"></i></a>
81 81
 							<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
82 82
 							<div class="form-element">
83
-							<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
83
+							<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
84 84
 							</div>
85 85
 						</li>
86
-						<?$value='';?>
86
+						<?$value = ''; ?>
87 87
 					<? endforeach ?>
88 88
 					<? endif ?>
89 89
 					</div>
@@ -92,5 +92,5 @@  discard block
 block discarded – undo
92 92
 				<a class="btn js-addrtemultiple">+</a>
93 93
 				<? endif ?>
94 94
 			</div>
95
-			<?$value='';?>
95
+			<?$value = ''; ?>
96 96
 		<? endforeach ?>
Please login to merge, or discard this patch.
src/templates/documents/document-form-form.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<form method="<?= isset($documentType) ? 'post' : 'get' ?>" onsubmit="return processRtes();" action="<?= isset($formId) ? '#' . $formId : '' ?>">
1
+<form method="<?= isset($documentType) ? 'post' : 'get' ?>" onsubmit="return processRtes();" action="<?= isset($formId) ? '#'.$formId : '' ?>">
2 2
     <? if (!isset($hideTitleAndState)) : ?>
3 3
       <input type="hidden" name="path" value="<?= $request::$get['path'] ?>"/>
4 4
     <? else : ?>
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
                     <input required="required" value="<?=isset($document) ? $document->title : '' ?>" type="text" id="title" name="title" placeholder="Title" />
18 18
                 </div>
19 19
 			<? endif ?>
20
-			<?$fieldPrefix='fields';?>
20
+			<?$fieldPrefix = 'fields'; ?>
21 21
 			<? foreach ($documentType->fields as $field) : ?>
22 22
 				<div class="form-element">
23 23
 					<label for="<?=$field->slug?>"><?=$field->title?></label>
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 								<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
42 42
 								<div class="form-element">
43 43
 					<? endif ?>
44
-						<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
44
+						<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
45 45
 					<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
46 46
 
47 47
 								</div>
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 							<li class="grid-container">
64 64
 								<div class="grid-box-10">
65 65
 									<div class="grid-inner form-element">
66
-										<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
66
+										<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
67 67
 									</div>
68 68
 								</div>
69 69
 								<div class="grid-box-2">
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 									</div>
74 74
 								</div>
75 75
 							</li>
76
-							<?$value='';?>
76
+							<?$value = ''; ?>
77 77
 							<? endforeach ?>
78 78
 						<? endif ?>
79 79
 					</ul>
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 								<a class="btn error js-deletemultiple"><i class="fa fa-trash"></i></a>
91 91
 								<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
92 92
 								<div class="form-element">
93
-								<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
93
+								<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
94 94
 								</div>
95 95
 							</li>
96
-							<?$value='';?>
96
+							<?$value = ''; ?>
97 97
 						<? endforeach ?>
98 98
 						<? endif ?>
99 99
 						</div>
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
 					<a class="btn js-addrtemultiple">+</a>
103 103
 					<? endif ?>
104 104
 				</div>
105
-				<?$value='';?>
105
+				<?$value = ''; ?>
106 106
 			<? endforeach ?>
107 107
 			<hr />
108
-			<? $static_brick_nr = 0;?>
108
+			<? $static_brick_nr = 0; ?>
109 109
 			<? foreach ($documentType->bricks as $brick) : ?>
110 110
 			<div class="brick">
111 111
 				<label><?=$brick->title?></label>
112 112
 				<? if ($brick->multiple == 'true') : ?>
113 113
 					<input type="hidden" value="<?=$brick->brickSlug?>"/>
114 114
 					<input type="hidden" value="<?=$brick->slug?>"/>
115
-					<?$myBrickSlug=$brick->slug;?>
115
+					<?$myBrickSlug = $brick->slug; ?>
116 116
 					<ul id="newBrickDropzone_<?=$static_brick_nr?>" class="dynamicBricks sortable">
117 117
 						<? if (isset($document)) : ?>
118 118
 							<? foreach ($document->bricks as $currentBrickSlug => $brickArray) : ?>
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 									<li class="brick form-element">
127 127
 
128 128
 										<?$static = true; ?>
129
-										<?include(__DIR__ . '/brick.php')?>
129
+										<?include(__DIR__.'/brick.php')?>
130 130
 									</li>
131 131
 									<? endif ?>
132 132
 								<? endforeach ?>
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 					<a class="btn" onclick="addDynamicBrick(this, 'true', 'newBrickDropzone_<?=$static_brick_nr?>');">+</a>
137 137
 					<?$static_brick_nr += 1?>
138 138
 				<? else : ?>
139
-					<?$fieldPrefix='bricks[' . $brick->slug . '][fields]';?>
139
+					<?$fieldPrefix = 'bricks['.$brick->slug.'][fields]'; ?>
140 140
 					<input type="hidden" name="bricks[<?=$brick->slug?>][type]" value="<?=$brick->brickSlug?>" />
141 141
 					<? foreach ($brick->structure->fields as $field) : ?>
142 142
 						<div class="form-element">
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 									<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
163 163
 									<div class="form-element">
164 164
 						<? endif ?>
165
-							<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
165
+							<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
166 166
 						<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
167 167
 
168 168
 									</div>
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 								<li class="grid-container">
186 186
 									<div class="grid-box-10">
187 187
 										<div class="grid-inner form-element">
188
-											<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
188
+											<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
189 189
 										</div>
190 190
 									</div>
191 191
 									<div class="grid-box-2">
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 										</div>
196 196
 									</div>
197 197
 								</li>
198
-								<?$value='';?>
198
+								<?$value = ''; ?>
199 199
 								<? endforeach ?>
200 200
 							<? endif ?>
201 201
 						</ul>
@@ -213,10 +213,10 @@  discard block
 block discarded – undo
213 213
 									<a class="btn error js-deletemultiple"><i class="fa fa-trash"></i></a>
214 214
 									<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
215 215
 									<div class="form-element">
216
-									<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
216
+									<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
217 217
 									</div>
218 218
 								</li>
219
-								<?$value='';?>
219
+								<?$value = ''; ?>
220 220
 							<? endforeach ?>
221 221
 							<? endif ?>
222 222
 							</div>
@@ -225,12 +225,12 @@  discard block
 block discarded – undo
225 225
 						<a class="btn js-addrtemultiple">+</a>
226 226
 						<? endif ?>
227 227
 					</div>
228
-					<?$value='';?>
228
+					<?$value = ''; ?>
229 229
 				<? endforeach ?>
230 230
 				<? endif ?>
231 231
 				</div>
232 232
 				<hr />
233
-			<? endforeach;?>
233
+			<? endforeach; ?>
234 234
 
235 235
 
236 236
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 						<li class="brick form-element">
254 254
 							<label><?=$brick->title?></label>
255 255
 							<?$static = false; ?>
256
-							<?include(__DIR__ . '/brick.php')?>
256
+							<?include(__DIR__.'/brick.php')?>
257 257
 						</li>
258 258
 					<? endforeach ?>
259 259
 				<? endif ?>
Please login to merge, or discard this patch.