@@ -24,11 +24,11 @@ class PropertyAnalyzer
2424 protected $ fileAfter ;
2525
2626 /**
27- * @param string $context
28- * @param string $fileBefore
29- * @param string $fileAfter
27+ * @param string $context
28+ * @param string|null $fileBefore
29+ * @param string|null $fileAfter
3030 */
31- public function __construct ($ context , $ fileBefore = null , $ fileAfter = null )
31+ public function __construct (string $ context , string $ fileBefore = null , string $ fileAfter = null )
3232 {
3333 $ this ->context = $ context ;
3434 $ this ->fileBefore = $ fileBefore ;
@@ -40,7 +40,7 @@ public function __construct($context, $fileBefore = null, $fileAfter = null)
4040 * @param \PhpParser\Node\Stmt $contextAfter
4141 * @return \PHPSemVerChecker\Report\Report
4242 */
43- public function analyze (Stmt $ contextBefore , Stmt $ contextAfter )
43+ public function analyze (Stmt $ contextBefore , Stmt $ contextAfter ): Report
4444 {
4545 $ report = new Report ();
4646
@@ -82,7 +82,7 @@ public function analyze(Stmt $contextBefore, Stmt $contextAfter)
8282 * @param \PhpParser\Node\Stmt $context
8383 * @return array
8484 */
85- protected function getProperties (Stmt $ context )
85+ protected function getProperties (Stmt $ context ): array
8686 {
8787 $ properties = [];
8888 foreach ($ context ->stmts as $ stmt ) {
@@ -97,7 +97,7 @@ protected function getProperties(Stmt $context)
9797 * @param \PhpParser\Node\Stmt\Property $property
9898 * @return string
9999 */
100- protected function getName (Property $ property )
100+ protected function getName (Property $ property ): string
101101 {
102102 return $ property ->props [0 ]->name ->toString ();
103103 }
0 commit comments