From dd1ed636aeae63fdeaa17df23f3d97cf84900255 Mon Sep 17 00:00:00 2001 From: Anton Date: Fri, 22 Oct 2021 00:05:41 +0300 Subject: [PATCH] Remove redundand comments in `PhpDocController` (#18968) --- build/controllers/PhpDocController.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build/controllers/PhpDocController.php b/build/controllers/PhpDocController.php index e0bcecc..5aebe85 100644 --- a/build/controllers/PhpDocController.php +++ b/build/controllers/PhpDocController.php @@ -733,19 +733,17 @@ class PhpDocController extends Controller $docLine = ' * @property'; $note = ''; if (isset($prop['get'], $prop['set'])) { - if ($prop['get']['type'] != $prop['set']['type']) { + if ($prop['get']['type'] !== $prop['set']['type']) { $note = ' Note that the type of this property differs in getter and setter.' . ' See [[get' . ucfirst($propName) . '()]]' . ' and [[set' . ucfirst($propName) . '()]] for details.'; } } elseif (isset($prop['get'])) { if (!$this->hasSetterInParents($className, $propName)) { - $note = ' This property is read-only.'; $docLine .= '-read'; } } elseif (isset($prop['set'])) { if (!$this->hasGetterInParents($className, $propName)) { - $note = ' This property is write-only.'; $docLine .= '-write'; } } else { @@ -754,7 +752,7 @@ class PhpDocController extends Controller $docLine .= ' ' . $this->getPropParam($prop, 'type') . " $$propName "; $comment = explode("\n", $this->getPropParam($prop, 'comment') . $note); foreach ($comment as &$cline) { - $cline = ltrim($cline, '* '); + $cline = ltrim(rtrim($cline), '* '); } $docLine = wordwrap($docLine . implode(' ', $comment), 110, "\n * ") . "\n";