diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php index b8394459ba..b7b512156f 100644 --- a/src/applications/search/controller/PhabricatorApplicationSearchController.php +++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php @@ -775,7 +775,7 @@ final class PhabricatorApplicationSearchController $force_nux) { // Don't render NUX if the user has clicked away from the default page. - if (strlen($this->getQueryKey())) { + if (phutil_nonempty_string($this->getQueryKey())) { return null; } diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php index 95f1ffafa3..a81e055a56 100644 --- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php +++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php @@ -179,7 +179,7 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject { $order = $saved->getParameter('order'); $builtin = $query->getBuiltinOrderAliasMap(); - if (strlen($order) && isset($builtin[$order])) { + if (phutil_nonempty_string($order) && isset($builtin[$order])) { $query->setOrder($order); } else { // If the order is invalid or not available, we choose the first diff --git a/src/view/form/control/AphrontFormTokenizerControl.php b/src/view/form/control/AphrontFormTokenizerControl.php index fe80c86f81..7af8fcae32 100644 --- a/src/view/form/control/AphrontFormTokenizerControl.php +++ b/src/view/form/control/AphrontFormTokenizerControl.php @@ -68,7 +68,7 @@ final class AphrontFormTokenizerControl extends AphrontFormControl { $datasource->setViewer($this->getUser()); $placeholder = null; - if (!strlen($this->placeholder)) { + if (!phutil_nonempty_string($this->placeholder)) { $placeholder = $datasource->getPlaceholderText(); } diff --git a/src/view/phui/PHUIInfoView.php b/src/view/phui/PHUIInfoView.php index cefeedbe5f..58898d40d2 100644 --- a/src/view/phui/PHUIInfoView.php +++ b/src/view/phui/PHUIInfoView.php @@ -19,6 +19,12 @@ final class PHUIInfoView extends AphrontTagView { private $flush; private $icon; + /** + * Set a title + * + * @param string|null $title + * @return self + */ public function setTitle($title) { $this->title = $title; return $this; @@ -147,7 +153,7 @@ final class PHUIInfoView extends AphrontTagView { } $title = $this->title; - if ($title || strlen($title)) { + if ($title || phutil_nonempty_string($title)) { $title = phutil_tag( 'h1', array(