1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Fix some PHP 8.1 issues in Diviner generator

Summary:
After this change I was able to generate again the Diviner
documentation from PHP 8.2 using the related command:

    ./bin/diviner generate

Closes T15255

Test Plan:
- run `./bin/diviner generate` - great success
- tested the advanced search in various ways - it still works

Reviewers: O1 Blessed Committers, Matthew

Reviewed By: O1 Blessed Committers, Matthew

Subscribers: Ekubischta, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15226, T15255

Differential Revision: https://we.phorge.it/D25124
This commit is contained in:
Valerio Bozzolan 2023-04-20 18:00:04 +02:00
parent 996a853fc4
commit 1ba5c8c260
3 changed files with 4 additions and 4 deletions

View file

@ -133,7 +133,7 @@ final class DivinerBookQuery extends PhabricatorCursorPagedPolicyAwareQuery {
$this->phids);
}
if (strlen($this->nameLike)) {
if (phutil_nonempty_string($this->nameLike)) {
$where[] = qsprintf(
$conn,
'name LIKE %~',
@ -147,7 +147,7 @@ final class DivinerBookQuery extends PhabricatorCursorPagedPolicyAwareQuery {
$this->names);
}
if (strlen($this->namePrefix)) {
if (phutil_nonempty_string($this->namePrefix)) {
$where[] = qsprintf(
$conn,
'name LIKE %>',

View file

@ -182,7 +182,7 @@ final class DivinerLiveSymbol extends DivinerDAO
public function setTitle($value) {
$this->writeField('title', $value);
if (strlen($value)) {
if (phutil_nonempty_string($value)) {
$slug = DivinerAtomRef::normalizeTitleString($value);
$hash = PhabricatorHash::digestForIndex($slug);
$this->titleSlugHash = $hash;

View file

@ -194,7 +194,7 @@ final class DivinerGenerateWorkflow extends DivinerWorkflow {
$identifier = $args->getArg('repository');
$repository = null;
if (strlen($identifier)) {
if (phutil_nonempty_string($identifier)) {
$repository = id(new PhabricatorRepositoryQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->withIdentifiers(array($identifier))