Fix PHP_CodeSniffer errors
authorAntonio Ospite <ao2@ao2.it>
Wed, 14 Nov 2018 16:24:30 +0000 (17:24 +0100)
committerAntonio Ospite <ao2@ao2.it>
Fri, 16 Nov 2018 09:28:16 +0000 (10:28 +0100)
Fix the following errors reported by PHP_CodeSniffer:

FILE: .../tweeper.php
-----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------
 1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------

FILE: .../src/Tweeper.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------
 373 | ERROR | [x] Incorrect spacing between argument "$host" and equals sign; expected 1 but found 0
 373 | ERROR | [x] Incorrect spacing between default value and equals sign for argument "$host"; expected 1 but found 0
 373 | ERROR | [x] Incorrect spacing between argument "$validate_scheme" and equals sign; expected 1 but found 0
 373 | ERROR | [x] Incorrect spacing between default value and equals sign for argument "$validate_scheme"; expected 1 but found 0
 388 | ERROR | [x] Inline comments must start with a capital letter
 388 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, colons, question marks, or closing parentheses
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------

FILE: .../autoload.php
-----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------
 1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------

Time: 260ms; Memory: 10Mb

autoload.php
src/Tweeper.php
tweeper.php

index d3ebc5a..d366bbb 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * Tweeper - some logic to allow tweeper to run with or without composer.
index d58b529..b75409b 100644 (file)
@@ -370,7 +370,7 @@ class Tweeper {
   /**
    * Convert the site content to RSS.
    */
-  public function tweep($src_url, $host=NULL, $validate_scheme=TRUE) {
+  public function tweep($src_url, $host = NULL, $validate_scheme = TRUE) {
     $url = parse_url($src_url);
     if (FALSE === $url) {
       trigger_error("Invalid URL: $src_url", E_USER_WARNING);
@@ -385,7 +385,7 @@ class Tweeper {
       }
     }
 
-    // if the host is not given derive it from the URL
+    // If the host is not given derive it from the URL.
     if (NULL === $host) {
       if (empty($url["host"])) {
         trigger_error("Invalid host in URL: $src_url", E_USER_WARNING);
index 038f2b6..84712f6 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * Tweeper - a Twitter to RSS web scraper.