Skip to content

Commit 1beadde

Browse files
committed
build: Add missing documentation to protected class properties
Add doc-typehints to protected class properties found by the PropertyDocumentation sniff to improve the documentation. Enable the sniff to avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: I392ccdf9eee7f0e618a46ba2e15b98fdac4e7e17
1 parent 0a66caf commit 1beadde

8 files changed

Lines changed: 12 additions & 1 deletion

File tree

.phpcs.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
1010
<exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
1111
<exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" />
12-
<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected" />
1312
<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPublic" />
1413
<exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
1514
<exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName" />

lessc.inc.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ class lessc {
1717
public static $VERSION = Less_Version::less_version;
1818

1919
public $importDir = '';
20+
/** @var array<string,int> */
2021
protected $allParsedFiles = [];
22+
/** @var array<string,callable> */
2123
protected $libFunctions = [];
24+
/** @var array */
2225
protected $registeredVars = [];
2326
/** @var string */
2427
private $formatterName;

lib/Less/Exception/Chunk.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
*/
55
class Less_Exception_Chunk extends Less_Exception_Parser {
66

7+
/** @var int */
78
protected $parserCurrentIndex = 0;
89

10+
/** @var int */
911
protected $emitFrom = 0;
1012

13+
/** @var int */
1114
protected $input_len;
1215

1316
/**

lib/Less/Exception/Parser.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Less_Exception_Parser extends Exception {
1919
*/
2020
public $index;
2121

22+
/** @var string|null */
2223
protected $input;
2324

2425
/**

lib/Less/Parser.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class Less_Parser {
7171
*/
7272
private $env;
7373

74+
/** @var Less_Tree[] */
7475
protected $rules = [];
7576

7677
/**

lib/Less/Tree/Ruleset.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55
class Less_Tree_Ruleset extends Less_Tree {
66

7+
/** @var array[][] */
78
protected $lookups;
89
public $_variables;
910
public $_properties;

lib/Less/Visitor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55
class Less_Visitor {
66

7+
/** @var array */
78
protected $_visitFnCache = [];
89

910
public function __construct() {

test/phpunit/bootstrap.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?php
22

33
class LessTestCase extends PHPUnit\Framework\TestCase {
4+
/** @var string */
45
protected static $fixturesDir;
6+
/** @var string */
57
protected static $cacheDir;
68

79
public static function setUpBeforeClass(): void {

0 commit comments

Comments
 (0)