Completed
Push — master ( 3988a7...aba870 )
by Vitaly
01:05
created
application/Application.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,6 @@
 block discarded – undo
8 8
 
9 9
 namespace samsoncms\seo\application;
10 10
 
11
-use samsonphp\event\Event;
12
-
13 11
 if (class_exists('\samsoncms\Application', false)) {
14 12
 
15 13
     class Application extends \samsoncms\Application
Please login to merge, or discard this patch.
src/Core.php 2 patches
Unused Use Statements   -5 removed lines patch added patch discarded remove patch
@@ -2,19 +2,14 @@
 block discarded – undo
2 2
 
3 3
 namespace samsoncms\seo;
4 4
 
5
-use samson\activerecord\dbRecord;
6 5
 use samson\activerecord\structure;
7 6
 use samson\activerecord\structurematerial;
8
-use samson\cms\CMSMaterial;
9 7
 use samsoncms\seo\Migrate;
10 8
 use samsoncms\seo\render\Element;
11 9
 use samsoncms\seo\schema\control\seo\Dynamic;
12
-use samsoncms\seo\schema\material\Facebook;
13
-use samsoncms\seo\schema\Main;
14 10
 use samsoncms\seo\schema\Schema;
15 11
 use samson\core\CompressableService;
16 12
 use samsoncms\seo\sitemap\SiteMap;
17
-use samsoncms\seo\sitemap\Xml;
18 13
 use samsoncms\seo\tab\InfoTab;
19 14
 use samsonphp\event\Event;
20 15
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             if ($schema->getStructureId() == $structureId) {
73 73
 
74 74
                 // Render elements if exists
75
-                $isElements = isset($schema->elements)&&(!empty($schema->elements));
75
+                $isElements = isset($schema->elements) && (!empty($schema->elements));
76 76
 
77 77
                 // If exists elements on the tab then show their
78 78
                 if ($isElements) {
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                     // Insert element as first child of table
87 87
                     $content = preg_replace(
88 88
                         '/\<div class=\"material_table_tab\"\>/',
89
-                        '<div class="material_table_tab">' . $contentNestedElement,
89
+                        '<div class="material_table_tab">'.$contentNestedElement,
90 90
                         $content,
91 91
                         1
92 92
                     );
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
      * @param $query
154 154
      * @param $entity
155 155
      */
156
-    public function renderMaterialTab(\samsoncms\app\material\form\Form &$form, $renderer, $query, $entity)
156
+    public function renderMaterialTab(\samsoncms\app\material\form\Form&$form, $renderer, $query, $entity)
157 157
     {
158 158
 
159 159
         $migrate = new \samsoncms\seo\Migrate($this->query);
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
                 // If content not empty render field(meta tag)
250 250
                 if (isset($content{0})) {
251 251
                     // Save html view
252
-                    $html .= $this->view($schema->view)->name($alias)->content($content)->output() . "\n";
252
+                    $html .= $this->view($schema->view)->name($alias)->content($content)->output()."\n";
253 253
                 }
254 254
             }
255 255
         }
@@ -300,9 +300,9 @@  discard block
 block discarded – undo
300 300
     public function templateRenderer(&$html, $parameters, $module)
301 301
     {
302 302
         // TODO: Change this to normal dependency
303
-        if($module->id() != 'compressor') {
303
+        if ($module->id() != 'compressor') {
304 304
             $content = $this->show();
305
-            $html = str_ireplace('</head>', $content . '</head>', $html);
305
+            $html = str_ireplace('</head>', $content.'</head>', $html);
306 306
         }
307 307
     }
308 308
 }
Please login to merge, or discard this patch.
src/Display.php 3 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
     /**
22 22
      * Init query
23
-     * @param $query
23
+     * @param \samson\activerecord\dbQuery $query
24 24
      */
25 25
     public function __construct($query)
26 26
     {
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
     /**
31 31
      * Get data from passed material
32
-     * @param $fieldName
32
+     * @param string $fieldName
33 33
      * @param $material
34 34
      * @return null
35 35
      * @throws \Exception
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      * @param $schema
109 109
      * @param $fieldName
110 110
      * @param $material
111
-     * @return null
111
+     * @return string|null
112 112
      */
113 113
     public function findField($schema, $fieldName, $material)
114 114
     {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
     /**
140 140
      * Get material by url
141
-     * @param $url
141
+     * @param string $url
142 142
      * @return mixed
143 143
      */
144 144
     public function getMaterialByUrl($url)
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
     /**
189 189
      * Get all views which not assign to any material
190
-     * @param $renderer
190
+     * @param Core $renderer
191 191
      * @return String
192 192
      */
193 193
     public function getCommonViews($renderer)
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@
 block discarded – undo
8 8
 
9 9
 namespace samsoncms\seo;
10 10
 
11
-use samsoncms\seo\schema\control\seo\Dynamic;
12 11
 use samsoncms\seo\schema\material\Publisher;
13 12
 use samsoncms\seo\schema\Schema;
14 13
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     {
66 66
 
67 67
         // Set field name with prefix of schema
68
-        $fieldNameFull = $fieldName . '_' . $schema->id;
68
+        $fieldNameFull = $fieldName.'_'.$schema->id;
69 69
         $fieldValue = $this->getDataField($fieldNameFull, $material);
70 70
 
71 71
         // If in the current schema need value wasn't found then find in sibling schemas
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
                 }
81 81
 
82 82
                 // Set field name with prefix of schema
83
-                $fieldNameFull = $fieldName . '_' . $schemaFind->id;
83
+                $fieldNameFull = $fieldName.'_'.$schemaFind->id;
84 84
 
85 85
                 // If it is deep search i.e search in parent structures then change current material to parent
86 86
                 if ($deep == true) {
@@ -204,11 +204,11 @@  discard block
 block discarded – undo
204 204
             foreach ($schema->relations as $fieldName => $alias) {
205 205
 
206 206
                 // Get value
207
-                $content = trim($material[$fieldName . '_' . $schema->id]);
207
+                $content = trim($material[$fieldName.'_'.$schema->id]);
208 208
 
209 209
                 if (isset($content{0})) {
210 210
                     // Render
211
-                    $html .= $renderer->view($schema->view)->name($alias)->content($content)->output() . "\n";
211
+                    $html .= $renderer->view($schema->view)->name($alias)->content($content)->output()."\n";
212 212
                 }
213 213
             }
214 214
         }
Please login to merge, or discard this patch.
src/sitemap/SiteMap.php 2 patches
Doc Comments   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
     /**
115 115
      * @param $params
116
-     * @param $xml
116
+     * @param Xml $xml
117 117
      * @return int
118 118
      * @throws \Exception
119 119
      */
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
     /**
150 150
      * @param $params
151
-     * @param $xml
151
+     * @param Xml $xml
152 152
      * @return int
153 153
      * @throws \Exception
154 154
      */
@@ -276,6 +276,9 @@  discard block
 block discarded – undo
276 276
         }
277 277
     }
278 278
 
279
+    /**
280
+     * @param ControlSchema $controlSchema
281
+     */
279 282
     public function getRelatedStructuresInMaterial($controlSchema, $mainMaterial)
280 283
     {
281 284
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             $mainSiteMapContent = $xml->generateIndexSiteMap($mainParams, $this->filePrefix);
102 102
 
103 103
             // Save
104
-            $xml->saveXmlToFile($this->mainMapName . '.xml', $mainSiteMapContent);
104
+            $xml->saveXmlToFile($this->mainMapName.'.xml', $mainSiteMapContent);
105 105
         }
106 106
 
107 107
         $time_elapsed_secs = microtime(true) - $start;
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $fileName = 'static.xml';
142 142
 
143 143
         // Create site map file for current category
144
-        $xml->saveXmlToFile($this->filePrefix . $fileName, $result);
144
+        $xml->saveXmlToFile($this->filePrefix.$fileName, $result);
145 145
 
146 146
         return $count;
147 147
     }
@@ -178,16 +178,16 @@  discard block
 block discarded – undo
178 178
                 $fileName = preg_replace('/^\//', '', $link);
179 179
 
180 180
                 // Exchange all slash to dash
181
-                $fileName = preg_replace('/\//', '-', $fileName) . '.xml';
181
+                $fileName = preg_replace('/\//', '-', $fileName).'.xml';
182 182
 
183 183
                 // Create site map file for current category
184
-                $xml->saveXmlToFile($this->filePrefix . $fileName, $result);
184
+                $xml->saveXmlToFile($this->filePrefix.$fileName, $result);
185 185
 
186 186
                 $links[] = $param;
187 187
             }
188 188
 
189 189
             // If need recursively execute structures
190
-            if ((isset($param['__SEO_IsRecursive']))&&($param['__SEO_IsRecursive'] == true)||$recursive) {
190
+            if ((isset($param['__SEO_IsRecursive'])) && ($param['__SEO_IsRecursive'] == true) || $recursive) {
191 191
 
192 192
                 $structures = null;
193 193
                 $this->query->className('structure')
Please login to merge, or discard this patch.
src/tab/InfoTab.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -18,6 +18,9 @@
 block discarded – undo
18 18
     /** @var string Path to main view */
19 19
     public $indexView = 'info/index';
20 20
 
21
+    /**
22
+     * @param \samsoncms\seo\Core $renderer
23
+     */
21 24
     public function __construct($renderer, $data = null)
22 25
     {
23 26
         // Save renderer
Please login to merge, or discard this patch.
src/tab/Tab.php 3 patches
Doc Comments   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
 
85 85
         /**
86 86
          * Render default tab with fields
87
-         * @param $renderer
88
-         * @param $query
89
-         * @param $entity
90
-         * @param $schema
87
+         * @param RenderInterface $renderer
88
+         * @param QueryInterface $query
89
+         * @param Record $entity
90
+         * @param MaterialSchema $schema
91 91
          */
92 92
         public function renderDefaultStructure($renderer, $query, $entity, $schema)
93 93
         {
@@ -105,6 +105,10 @@  discard block
 block discarded – undo
105 105
 
106 106
         /**
107 107
          * Render control schemas
108
+         * @param RenderInterface $renderer
109
+         * @param QueryInterface $query
110
+         * @param Record $entity
111
+         * @param ControlSchema $schema
108 112
          */
109 113
         public function renderControlStructure($renderer, $query, $entity, $schema)
110 114
         {
@@ -170,6 +174,9 @@  discard block
 block discarded – undo
170 174
             return $this->renderer->view($this->contentView)->content($content)->output();
171 175
         }
172 176
 
177
+        /**
178
+         * @param string $name
179
+         */
173 180
         public function setName($name)
174 181
         {
175 182
             $this->name = $name;
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -8,12 +8,10 @@
 block discarded – undo
8 8
 
9 9
 namespace samsoncms\seo\tab;
10 10
 
11
-use samson\activerecord\dbRelation;
12 11
 use samsoncms\seo\render\Element;
13 12
 use samsoncms\seo\schema\control\ControlSchema;
14 13
 use samsoncms\seo\schema\material\MaterialSchema;
15 14
 use samsoncms\seo\schema\Schema;
16
-use samson\core\SamsonLocale;
17 15
 use samsonframework\core\RenderInterface;
18 16
 use samsonframework\orm\QueryInterface;
19 17
 use samsonframework\orm\Record;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                 $html = $subTab->content();
140 140
 
141 141
                 // Render elements if exists
142
-                $isElements = isset($subTab->schema->elements)&&(!empty($subTab->schema->elements));
142
+                $isElements = isset($subTab->schema->elements) && (!empty($subTab->schema->elements));
143 143
                 if ($isElements) {
144 144
 
145 145
                     // Create element instance
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                     $contentNestedElement = $elements->renderNestedElements($subTab->schema->elements);
150 150
 
151 151
                     // Insert element as first child of table
152
-                    $html = preg_replace('/>/', '>' . $contentNestedElement, $html, 1);
152
+                    $html = preg_replace('/>/', '>'.$contentNestedElement, $html, 1);
153 153
 
154 154
                     // Get all not nested element
155 155
                     $contentNotNestedElement = $elements->renderNotNestedElements($subTab->schema->elements);
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                 if ($isElements) {
163 163
 
164 164
                     // Concatenate element to main view
165
-                    $content = $contentNotNestedElement . $content;
165
+                    $content = $contentNotNestedElement.$content;
166 166
                 }
167 167
             }
168 168
 
@@ -177,5 +177,5 @@  discard block
 block discarded – undo
177 177
     }
178 178
 
179 179
 } else {
180
-    class Tab{}
180
+    class Tab {}
181 181
 }
Please login to merge, or discard this patch.
src/render/Element.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         foreach ($elements as $element) {
64 64
 
65 65
             // Check if this element is nested
66
-            $isNested = (isset($element['Nested'])&&$element['Nested'] == true);
66
+            $isNested = (isset($element['Nested']) && $element['Nested'] == true);
67 67
 
68 68
             if (isset($element['Field']) && ($field == false)) {
69 69
                 continue;
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
 
79 79
             // Check if this element is need to be hide
80
-            $isHide = (isset($element['Hide'])&&$element['Hide'] == true);
80
+            $isHide = (isset($element['Hide']) && $element['Hide'] == true);
81 81
 
82 82
             // If not right go further
83 83
             if ($isHide) {
Please login to merge, or discard this patch.
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -116,6 +116,7 @@
 block discarded – undo
116 116
     /**
117 117
      * Render only nested elements
118 118
      * @param $elements
119
+     * @param boolean $field
119 120
      * @return String
120 121
      */
121 122
     public function renderNestedElements($elements, $field = null)
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,6 @@
 block discarded – undo
8 8
 
9 9
 namespace samsoncms\seo\render;
10 10
 
11
-use samsoncms\seo\render\Button;
12
-
13 11
 /**
14 12
  * Class Element generate elements
15 13
  * @package samsoncms\seo\render
Please login to merge, or discard this patch.
src/render/Info.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
  * Class Info block which show info about something
13 13
  * @package samsoncms\seo\render
14 14
  */
15
-class Info{
15
+class Info {
16 16
 
17 17
     public function __construct($renderer, $data)
18 18
     {
Please login to merge, or discard this patch.
src/sitemap/Xml.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
         if (!empty($urls)) {
55 55
 
56 56
             // Get full path
57
-            $path = $this->currentHost . $category . DIRECTORY_SEPARATOR;
57
+            $path = $this->currentHost.$category.DIRECTORY_SEPARATOR;
58 58
 
59 59
             // Add separator
60 60
             $tagAsSeparator = "</loc></url><url><loc>{$path}";
61 61
 
62 62
             // Implode all array elements and concatenate separator with right xml tags and concatenate first and last tags
63
-            $xml = '<url><loc>' . $path . implode($tagAsSeparator, $urls) . '</loc></url>';
63
+            $xml = '<url><loc>'.$path.implode($tagAsSeparator, $urls).'</loc></url>';
64 64
         }
65 65
 
66 66
         return $xml;
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
         $innerBlock = $this->getXmlContentByUrls($urls, $path);
91 91
 
92 92
         // Concatenate header and footer of xml text
93
-        $result = "<?xml version='1.0' standalone='yes'?>" .
93
+        $result = "<?xml version='1.0' standalone='yes'?>".
94 94
             '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
95 95
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
96 96
             xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
97
-            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">' . $innerBlock . '</urlset>';
97
+            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">' . $innerBlock.'</urlset>';
98 98
 
99 99
         return $result;
100 100
     }
Please login to merge, or discard this patch.