[web-php] master: Enhancement: Enable `visibility_required` fixer
| From: | Andreas Möller via GitHub | Date: | Mon, 11 Jul 2022 18:23:07 +0000 |
| Subject: | [web-php] master: Enhancement: Enable `visibility_required` fixer | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-30351@lists.php.net to get a copy of this message | ||
Author: Andreas Möller (localheinz)
Committer: GitHub (web-flow)
Pusher: cmb69
Date: 2022-07-11T20:16:40+02:00
Commit: https://github.com/php/web-php/commit/ba92fc90a29ca5646fcdce7a87c3be46fc4f1ec0
Raw diff: https://github.com/php/web-php/commit/ba92fc90a29ca5646fcdce7a87c3be46fc4f1ec0.diff
Enhancement: Enable
visibility_required fixer
Closes GH-639.
Changed paths:
M .php-cs-fixer.php
M src/News/Entry.php
M src/UserNotes/Sorter.php
Diff:
diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php
index fd19fe1825..113bfaa433 100644
--- a/.php-cs-fixer.php
+++ b/.php-cs-fixer.php
@@ -11,6 +11,7 @@
$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 c3b01c8d1e..c650125dd1 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 7850f214ee..e25bfa04b5 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);