Skip to content

Commit c304829

Browse files
authored
Enhancement: Enable and configure class_attributes_separation fixer
Closes phpGH-643.
1 parent cdb8324 commit c304829

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

.php-cs-fixer.php

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
->setRiskyAllowed(true)
2121
->setRules([
2222
'array_indentation' => true,
23+
'class_attributes_separation' => true,
2324
'constant_case' => true,
2425
'indentation_type' => true,
2526
'line_ending' => true,

src/News/Entry.php

+14
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@ class Entry {
1111
];
1212

1313
public const WEBROOT = "https://www.php.net";
14+
1415
public const PHPWEB = __DIR__ . '/../../';
16+
1517
public const ARCHIVE_FILE_REL = 'archive/archive.xml';
18+
1619
public const ARCHIVE_FILE_ABS = self::PHPWEB . self::ARCHIVE_FILE_REL;
20+
1721
public const ARCHIVE_ENTRIES_REL = 'archive/entries/';
22+
1823
public const ARCHIVE_ENTRIES_ABS = self::PHPWEB . self::ARCHIVE_ENTRIES_REL;
24+
1925
public const IMAGE_PATH_REL = 'images/news/';
26+
2027
public const IMAGE_PATH_ABS = self::PHPWEB . self::IMAGE_PATH_REL;
2128

2229
protected $title = '';
@@ -35,6 +42,7 @@ public function setTitle(string $title): self {
3542
$this->title = $title;
3643
return $this;
3744
}
45+
3846
public function setCategories(array $cats): self {
3947
foreach ($cats as $cat) {
4048
if (!isset(self::CATEGORIES[$cat])) {
@@ -44,6 +52,7 @@ public function setCategories(array $cats): self {
4452
$this->categories = $cats;
4553
return $this;
4654
}
55+
4756
public function addCategory(string $cat): self {
4857
if (!isset(self::CATEGORIES[$cat])) {
4958
throw new \Exception("Unknown category: $cat");
@@ -57,10 +66,12 @@ public function addCategory(string $cat): self {
5766
public function isConference(): bool {
5867
return (bool)array_intersect($this->categories, ['cfp', 'conferences']);
5968
}
69+
6070
public function setConfTime(int $time): self {
6171
$this->conf_time = $time;
6272
return $this;
6373
}
74+
6475
public function setImage(string $path, string $title, ?string $link): self {
6576
if (basename($path) !== $path) {
6677
throw new \Exception('path must be a simple file name under ' . self::IMAGE_PATH_REL);
@@ -75,13 +86,15 @@ public function setImage(string $path, string $title, ?string $link): self {
7586
];
7687
return $this;
7788
}
89+
7890
public function setContent(string $content): self {
7991
if (empty($content)) {
8092
throw new \Exception('Content must not be empty');
8193
}
8294
$this->content = $content;
8395
return $this;
8496
}
97+
8598
public function getId(): string {
8699
return $this->id;
87100
}
@@ -165,6 +178,7 @@ public function updateArchiveXML(): self {
165178

166179
return $this;
167180
}
181+
168182
private static function selectNextId(): string {
169183
$filename = date("Y-m-d", $_SERVER["REQUEST_TIME"]);
170184
$count = 0;

src/UserNotes/Sorter.php

+6
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@
44

55
class Sorter {
66
private $maxVote;
7+
78
private $minVote;
9+
810
private $maxAge;
11+
912
private $minAge;
1013

1114
private $voteFactor;
15+
1216
private $ageFactor;
1317

1418
private $voteWeight = 38;
19+
1520
private $ratingWeight = 60;
21+
1622
private $ageWeight = 2;
1723

1824
public function sort(array &$notes) {

0 commit comments

Comments
 (0)