From ba92fc90a29ca5646fcdce7a87c3be46fc4f1ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 11 Jul 2022 20:16:40 +0200 Subject: [PATCH] Enhancement: Enable `visibility_required` fixer Closes GH-639. --- .php-cs-fixer.php | 1 + src/News/Entry.php | 18 +++++++++--------- src/UserNotes/Sorter.php | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index fd19fe182..113bfaa43 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -11,6 +11,7 @@ $finder = $config->getFinder() $config->setRules([ 'no_trailing_whitespace' => true, + 'visibility_required' => true, 'whitespace_after_comma_in_array' => true, ]); diff --git a/src/News/Entry.php b/src/News/Entry.php index c3b01c8d1..c650125dd 100755 --- a/src/News/Entry.php +++ b/src/News/Entry.php @@ -3,21 +3,21 @@ namespace phpweb\News; class Entry { - const CATEGORIES = [ + public const CATEGORIES = [ 'frontpage' => 'PHP.net frontpage news', 'releases' => 'New PHP release', 'conferences' => 'Conference announcement', 'cfp' => 'Call for Papers', ]; - const WEBROOT = "https://www.php.net"; - const PHPWEB = __DIR__ . '/../../'; - const ARCHIVE_FILE_REL = 'archive/archive.xml'; - const ARCHIVE_FILE_ABS = self::PHPWEB . self::ARCHIVE_FILE_REL; - const ARCHIVE_ENTRIES_REL = 'archive/entries/'; - const ARCHIVE_ENTRIES_ABS = self::PHPWEB . self::ARCHIVE_ENTRIES_REL; - const IMAGE_PATH_REL = 'images/news/'; - const IMAGE_PATH_ABS = self::PHPWEB . self::IMAGE_PATH_REL; + public const WEBROOT = "https://www.php.net"; + public const PHPWEB = __DIR__ . '/../../'; + public const ARCHIVE_FILE_REL = 'archive/archive.xml'; + public const ARCHIVE_FILE_ABS = self::PHPWEB . self::ARCHIVE_FILE_REL; + public const ARCHIVE_ENTRIES_REL = 'archive/entries/'; + public const ARCHIVE_ENTRIES_ABS = self::PHPWEB . self::ARCHIVE_ENTRIES_REL; + public const IMAGE_PATH_REL = 'images/news/'; + public const IMAGE_PATH_ABS = self::PHPWEB . self::IMAGE_PATH_REL; protected $title = ''; diff --git a/src/UserNotes/Sorter.php b/src/UserNotes/Sorter.php index 7850f214e..e25bfa04b 100644 --- a/src/UserNotes/Sorter.php +++ b/src/UserNotes/Sorter.php @@ -15,7 +15,7 @@ class Sorter { private $ratingWeight = 60; private $ageWeight = 2; - function sort(array &$notes) { + public function sort(array &$notes) { // First we make a pass over the data to get the min and max values // for data normalization. $this->findMinMaxValues($notes);