Skip to content

Commit 1aabf1e

Browse files
committed
Update PHPDoc.
1 parent 9e86860 commit 1aabf1e

24 files changed

+182
-4
lines changed

src/PHPSemVerChecker/Analyzer/ClassAnalyzer.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@
88
use PHPSemVerChecker\Report\Report;
99

1010
class ClassAnalyzer {
11+
/**
12+
* @var string
13+
*/
1114
protected $context = 'class';
1215

16+
/**
17+
* @param \PHPSemVerChecker\Registry\Registry $registryBefore
18+
* @param \PHPSemVerChecker\Registry\Registry $registryAfter
19+
* @return \PHPSemVerChecker\Report\Report
20+
*/
1321
public function analyze(Registry $registryBefore, Registry $registryAfter)
1422
{
1523
$report = new Report();

src/PHPSemVerChecker/Analyzer/ClassMethodAnalyzer.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,17 @@
2020
use PHPSemVerChecker\Report\Report;
2121

2222
class ClassMethodAnalyzer {
23+
/**
24+
* @var string
25+
*/
2326
protected $context;
27+
/**
28+
* @var null|string
29+
*/
2430
protected $fileBefore;
31+
/**
32+
* @var null|string
33+
*/
2534
protected $fileAfter;
2635

2736
/**
@@ -36,6 +45,11 @@ public function __construct($context, $fileBefore = null, $fileAfter = null)
3645
$this->fileAfter = $fileAfter;
3746
}
3847

48+
/**
49+
* @param \PhpParser\Node\Stmt $contextBefore
50+
* @param \PhpParser\Node\Stmt $contextAfter
51+
* @return \PHPSemVerChecker\Report\Report
52+
*/
3953
public function analyze(Stmt $contextBefore, Stmt $contextAfter)
4054
{
4155
$report = new Report();

src/PHPSemVerChecker/Analyzer/FunctionAnalyzer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
use PHPSemVerChecker\Operation\FunctionParameterTypingAdded;
1818
use PHPSemVerChecker\Operation\FunctionParameterTypingRemoved;
1919
use PHPSemVerChecker\Operation\FunctionRemoved;
20-
use PHPSemVerChecker\Operation\Unknown;
2120
use PHPSemVerChecker\Registry\Registry;
2221
use PHPSemVerChecker\Report\Report;
2322

2423
class FunctionAnalyzer {
24+
/**
25+
* @var string
26+
*/
2527
protected $context = 'function';
2628

2729
/**

src/PHPSemVerChecker/Analyzer/InterfaceAnalyzer.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@
88
use PHPSemVerChecker\Report\Report;
99

1010
class InterfaceAnalyzer {
11+
/**
12+
* @var string
13+
*/
1114
protected $context = 'interface';
1215

16+
/**
17+
* @param \PHPSemVerChecker\Registry\Registry $registryBefore
18+
* @param \PHPSemVerChecker\Registry\Registry $registryAfter
19+
* @return \PHPSemVerChecker\Report\Report
20+
*/
1321
public function analyze(Registry $registryBefore, Registry $registryAfter)
1422
{
1523
$report = new Report();

src/PHPSemVerChecker/Analyzer/PropertyAnalyzer.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ public function __construct($context, $fileBefore = null, $fileAfter = null)
3434
$this->fileAfter = $fileAfter;
3535
}
3636

37+
/**
38+
* @param \PhpParser\Node\Stmt $contextBefore
39+
* @param \PhpParser\Node\Stmt $contextAfter
40+
* @return \PHPSemVerChecker\Report\Report
41+
*/
3742
public function analyze(Stmt $contextBefore, Stmt $contextAfter)
3843
{
3944
$report = new Report();
@@ -72,6 +77,10 @@ public function analyze(Stmt $contextBefore, Stmt $contextAfter)
7277
return $report;
7378
}
7479

80+
/**
81+
* @param \PhpParser\Node\Stmt $context
82+
* @return array
83+
*/
7584
protected function getProperties(Stmt $context)
7685
{
7786
$properties = [];
@@ -83,6 +92,10 @@ protected function getProperties(Stmt $context)
8392
return $properties;
8493
}
8594

95+
/**
96+
* @param \PhpParser\Node\Stmt\Property $property
97+
* @return string
98+
*/
8699
protected function getName(Property $property)
87100
{
88101
return $property->props[0]->name;

src/PHPSemVerChecker/Analyzer/TraitAnalyzer.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@
88
use PHPSemVerChecker\Report\Report;
99

1010
class TraitAnalyzer {
11+
/**
12+
* @var string
13+
*/
1114
protected $context = 'trait';
1215

16+
/**
17+
* @param \PHPSemVerChecker\Registry\Registry $registryBefore
18+
* @param \PHPSemVerChecker\Registry\Registry $registryAfter
19+
* @return \PHPSemVerChecker\Report\Report
20+
*/
1321
public function analyze(Registry $registryBefore, Registry $registryAfter)
1422
{
1523
$report = new Report();

src/PHPSemVerChecker/Comparator/Node.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
class Node
66
{
7+
/**
8+
* @param \PhpParser\Node $nodeA
9+
* @param \PhpParser\Node $nodeB
10+
* @return bool
11+
*/
712
public static function isEqual(\PhpParser\Node $nodeA, \PhpParser\Node $nodeB)
813
{
914
if ($nodeA->getType() !== $nodeB->getType()) {

src/PHPSemVerChecker/Configuration/Configuration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Configuration
1818

1919
/**
2020
* @param string|array $path
21+
* @throws \Noodlehaus\Exception\EmptyDirectoryException
2122
*/
2223
public function __construct($path)
2324
{
@@ -28,14 +29,17 @@ public function __construct($path)
2829
/**
2930
* @param string|array $file
3031
* @return \PHPSemVerChecker\Configuration\Configuration
32+
* @throws \Noodlehaus\Exception\EmptyDirectoryException
3133
*/
3234
public static function fromFile($file)
3335
{
3436
return new Configuration($file);
3537
}
3638

3739
/**
40+
* @param string $name
3841
* @return \PHPSemVerChecker\Configuration\Configuration
42+
* @throws \Noodlehaus\Exception\EmptyDirectoryException
3943
*/
4044
public static function defaults($name)
4145
{

src/PHPSemVerChecker/Configuration/LevelMapping.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
class LevelMapping
88
{
9+
/**
10+
* @var array
11+
*/
912
public static $mapping = [
1013
'V001' => Level::MAJOR,
1114
'V002' => Level::MAJOR,
@@ -123,11 +126,18 @@ class LevelMapping
123126
'V117' => Level::MAJOR,
124127
];
125128

129+
/**
130+
* @param string $code
131+
* @return int
132+
*/
126133
public static function getLevelForCode($code)
127134
{
128135
return static::$mapping[$code];
129136
}
130137

138+
/**
139+
* @param array $mapping
140+
*/
131141
public static function setOverrides(array $mapping)
132142
{
133143
foreach ($mapping as $code => $level) {

src/PHPSemVerChecker/Console/Application.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ class Application extends SymfonyApplication {
99

1010
const VERSION = '@package_version@';
1111

12+
/**
13+
* @var string
14+
*/
1215
private static $logo = ' ____ ______ _______
1316
/ __ \/ ___/ | / / ___/
1417
/ /_/ /__ /| |/ / /__
@@ -21,11 +24,17 @@ public function __construct()
2124
parent::__construct('PHP Semantic Versioning Checker by Tom Rochette', self::VERSION);
2225
}
2326

27+
/**
28+
* @return string
29+
*/
2430
public function getHelp()
2531
{
2632
return self::$logo . parent::getHelp();
2733
}
2834

35+
/**
36+
* @return array|\Symfony\Component\Console\Command\Command[]
37+
*/
2938
protected function getDefaultCommands()
3039
{
3140
$commands = parent::getDefaultCommands();

0 commit comments

Comments
 (0)