Completed
Branch master (f693f1)
by George
08:42
created
src/SiteChecker/Asset.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
      * @param $type
70 70
      */
71 71
     public function __construct(
72
-      $url,
73
-      $parentPage = null,
74
-      $fullHtml = '',
75
-      $type = 'page'
72
+        $url,
73
+        $parentPage = null,
74
+        $fullHtml = '',
75
+        $type = 'page'
76 76
     ) {
77 77
         $urlProperties = parse_url($url);
78 78
 
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
     {
116 116
         // Empty scheme usually means http
117 117
         return in_array(
118
-          $this->scheme,
119
-          ['http', 'https', '']
118
+            $this->scheme,
119
+            ['http', 'https', '']
120 120
         );
121 121
     }
122 122
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     public function getURL()
229 229
     {
230 230
         $path = strpos($this->path, '/') === 0 ? substr($this->path,
231
-          1) : $this->path;
231
+            1) : $this->path;
232 232
 
233 233
         $port = ($this->port === 80 ? '' : ":{$this->port}");
234 234
         $url = "{$this->scheme}://{$this->host}{$port}/{$path}";
Please login to merge, or discard this patch.
src/SiteChecker/Commands/CheckCommand.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -27,31 +27,31 @@  discard block
 block discarded – undo
27 27
     protected function configure()
28 28
     {
29 29
         $this->setName("site-checker:check")
30
-          ->setDescription("Display the fibonacci numbers between 2 given numbers")
31
-          ->setDefinition([
30
+            ->setDescription("Display the fibonacci numbers between 2 given numbers")
31
+            ->setDefinition([
32 32
             new InputArgument('site', InputArgument::REQUIRED),
33 33
             new InputOption('check-external', 'e', InputOption::VALUE_NONE,
34
-              'Check external links'),
34
+                'Check external links'),
35 35
             new InputOption('log-success', 's', InputOption::VALUE_NONE,
36
-              'Log successful page loads'),
36
+                'Log successful page loads'),
37 37
             new InputOption('full-html', 'f', InputOption::VALUE_NONE,
38
-              'Show full html tag of element in log'),
39
-          ])
40
-          ->setHelp(<<<EOT
38
+                'Show full html tag of element in log'),
39
+            ])
40
+            ->setHelp(<<<EOT
41 41
 Checks a site for broken links and missing files (CSS, js, images)
42 42
 
43 43
 Usage:
44 44
 
45 45
 <info> sitechecker http://site.url</info>
46 46
 EOT
47
-          );
47
+            );
48 48
     }
49 49
 
50 50
     protected function execute(InputInterface $input, OutputInterface $output)
51 51
     {
52 52
 
53 53
         $header_style = new OutputFormatterStyle('white', 'green',
54
-          array('bold'));
54
+            array('bold'));
55 55
         $output->getFormatter()->setStyle('header', $header_style);
56 56
 
57 57
         $site = $input->getArgument('site');
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $verbosityLevelMap = [];
62 62
         if ($input->getOption('log-success')) {
63 63
             $verbosityLevelMap = array(
64
-              LogLevel::INFO => OutputInterface::VERBOSITY_NORMAL,
64
+                LogLevel::INFO => OutputInterface::VERBOSITY_NORMAL,
65 65
             );
66 66
         }
67 67
 
Please login to merge, or discard this patch.
src/SiteChecker/SiteChecker.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
     public static function create(SiteCheckObserver $observer)
85 85
     {
86 86
         $client = new Client([
87
-          RequestOptions::ALLOW_REDIRECTS => true,
88
-          RequestOptions::COOKIES => true,
89
-          RequestOptions::VERIFY => false,
87
+            RequestOptions::ALLOW_REDIRECTS => true,
88
+            RequestOptions::COOKIES => true,
89
+            RequestOptions::VERIFY => false,
90 90
         ]);
91 91
 
92 92
         return new static($client, $observer);
@@ -140,11 +140,11 @@  discard block
 block discarded – undo
140 140
 
141 141
         try {
142 142
             $response = $this->client->request('GET', $asset->getURL(),
143
-              ['cookies' => $jar, 'config' => [
143
+                ['cookies' => $jar, 'config' => [
144 144
                 'curl' => [
145
-                  CURLOPT_SSLVERSION => -9838
145
+                    CURLOPT_SSLVERSION => -9838
146 146
                 ]
147
-              ]]);
147
+                ]]);
148 148
         } catch (RequestException $exception) {
149 149
             $response = $exception->getResponse();
150 150
             $asset->setResponseCode('500');
@@ -211,36 +211,36 @@  discard block
 block discarded – undo
211 211
         $assets = [];
212 212
 
213 213
         $assets = array_merge(
214
-          $assets,
215
-          $this->createAssetsFromDOMElements(
214
+            $assets,
215
+            $this->createAssetsFromDOMElements(
216 216
             $html, '//a', 'href', 'page', $parentPage
217
-          )
217
+            )
218 218
         );
219 219
 
220 220
         if ($this->config->checkImages) {
221 221
             $assets = array_merge(
222
-              $assets,
223
-              $this->createAssetsFromDOMElements(
222
+                $assets,
223
+                $this->createAssetsFromDOMElements(
224 224
                 $html, '//img', 'src', 'css file', $parentPage
225
-              )
225
+                )
226 226
             );
227 227
         }
228 228
 
229 229
         if ($this->config->checkJS) {
230 230
             $assets = array_merge(
231
-              $assets,
232
-              $this->createAssetsFromDOMElements(
231
+                $assets,
232
+                $this->createAssetsFromDOMElements(
233 233
                 $html, '//script', 'src', 'js file', $parentPage
234
-              )
234
+                )
235 235
             );
236 236
         }
237 237
 
238 238
         if ($this->config->checkCSS) {
239 239
             $assets = array_merge(
240
-              $assets,
241
-              $this->createAssetsFromDOMElements(
240
+                $assets,
241
+                $this->createAssetsFromDOMElements(
242 242
                 $html, '//link[@rel="stylesheet"]', 'href', 'image', $parentPage
243
-              )
243
+                )
244 244
             );
245 245
         }
246 246
 
@@ -256,11 +256,11 @@  discard block
 block discarded – undo
256 256
      * @return array
257 257
      */
258 258
     protected function createAssetsFromDOMElements(
259
-      $html,
260
-      $selector,
261
-      $urlAttribute,
262
-      $type,
263
-      $parentPage
259
+        $html,
260
+        $selector,
261
+        $urlAttribute,
262
+        $type,
263
+        $parentPage
264 264
     ) {
265 265
         $assets = [];
266 266
 
@@ -276,10 +276,10 @@  discard block
 block discarded – undo
276 276
                 }
277 277
 
278 278
                 $assets[] = new Asset(
279
-                  $urlValue,
280
-                  $parentPage,
281
-                  $element->ownerDocument->saveHTML($element),
282
-                  $type
279
+                    $urlValue,
280
+                    $parentPage,
281
+                    $element->ownerDocument->saveHTML($element),
282
+                    $type
283 283
                 );
284 284
             }
285 285
         }
@@ -341,8 +341,8 @@  discard block
 block discarded – undo
341 341
         if ($asset->isRelative()) {
342 342
 
343 343
             $asset->setScheme($this->basePage->scheme)
344
-              ->setHost($this->basePage->host)
345
-              ->setPort($this->basePage->port);
344
+                ->setHost($this->basePage->host)
345
+                ->setPort($this->basePage->port);
346 346
         }
347 347
 
348 348
         if ($asset->isProtocolIndependent()) {
Please login to merge, or discard this patch.