From da9250bb9572c83ed397d3bfda0e44fa13016efb Mon Sep 17 00:00:00 2001 From: Antonio Ospite <ao2@ao2.it> Date: Wed, 14 Nov 2018 17:24:30 +0100 Subject: [PATCH 1/1] Fix PHP_CodeSniffer errors 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 | 1 + src/Tweeper.php | 4 ++-- tweeper.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload.php b/autoload.php index d3ebc5a..d366bbb 100644 --- a/autoload.php +++ b/autoload.php @@ -1,4 +1,5 @@ <?php + /** * @file * Tweeper - some logic to allow tweeper to run with or without composer. diff --git a/src/Tweeper.php b/src/Tweeper.php index d58b529..b75409b 100644 --- a/src/Tweeper.php +++ b/src/Tweeper.php @@ -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); diff --git a/tweeper.php b/tweeper.php index 038f2b6..84712f6 100644 --- a/tweeper.php +++ b/tweeper.php @@ -1,4 +1,5 @@ <?php + /** * @file * Tweeper - a Twitter to RSS web scraper. -- 2.1.4