@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

PHP 8.5: Replace semicolons with colons in switch case statements

Summary:
Using semicolons was depreacted in PHP 8.5 per https://wiki.php.net/rfc/deprecations_php_8_5 and https://github.com/php/php-src/commit/5f8d648af6ef4e29a3c7f2b2029d08466c12bc6f

Closes T16316

Test Plan: None.

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16316

Differential Revision: https://we.phorge.it/D26442

+16 -16
+2 -2
src/aphront/headerparser/AphrontHTTPHeaderParser.php
··· 47 47 $c = $content[$ii]; 48 48 49 49 switch ($state) { 50 - case 'prekey'; 50 + case 'prekey': 51 51 // We're eating space in front of a key. 52 52 if ($c == ' ') { 53 53 $ii++; ··· 56 56 $pair_name = ''; 57 57 $state = 'key'; 58 58 break; 59 - case 'key'; 59 + case 'key': 60 60 // We're parsing a key name until we find "=" or ";". 61 61 if ($c == ';') { 62 62 $state = 'done';
+1 -1
src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php
··· 124 124 } 125 125 break; 126 126 127 - case PhabricatorAuthSSHKeyTransaction::TYPE_KEY; 127 + case PhabricatorAuthSSHKeyTransaction::TYPE_KEY: 128 128 $missing = $this->validateIsEmptyTextField( 129 129 $object->getName(), 130 130 $xactions);
+1 -1
src/applications/auth/factor/__tests__/PhabricatorAuthInviteTestCase.php
··· 244 244 case 'out': 245 245 $viewer = $logged_out; 246 246 break; 247 - case 'in'; 247 + case 'in': 248 248 $viewer = $logged_in; 249 249 break; 250 250 case 'same':
+1 -1
src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php
··· 245 245 case 'INTERVAL': 246 246 case 'WKST': 247 247 case 'COUNT': 248 - case 'UNTIL'; 248 + case 'UNTIL': 249 249 break; 250 250 default: 251 251 $value = explode(',', $value);
+2 -2
src/applications/config/schema/PhabricatorConfigSchemaSpec.php
··· 348 348 $column_type = 'longtext'; 349 349 } 350 350 break; 351 - case 'fulltext'; 351 + case 'fulltext': 352 352 // MySQL (at least, under MyISAM) refuses to create a FULLTEXT index 353 353 // on a LONGBLOB column. We'd also lose case insensitivity in search. 354 354 // Force this column to utf8 collation. This will truncate results ··· 408 408 $column_type = 'bigint(20)'; 409 409 break; 410 410 case 'phid': 411 - case 'policy'; 411 + case 'policy': 412 412 case 'hashpath64': 413 413 case 'ipaddress': 414 414 $column_type = 'varbinary(64)';
+1 -1
src/applications/console/plugin/DarkConsoleServicesPlugin.php
··· 92 92 $cur_badness = 1; 93 93 $cur_reason = 'Const'; 94 94 break; 95 - case 'eq_ref'; 95 + case 'eq_ref': 96 96 $cur_badness = 2; 97 97 $cur_reason = 'EqRef'; 98 98 break;
+2 -2
src/applications/differential/storage/DifferentialDiffTransaction.php
··· 19 19 20 20 public function getActionName() { 21 21 switch ($this->getTransactionType()) { 22 - case self::TYPE_DIFF_CREATE; 22 + case self::TYPE_DIFF_CREATE: 23 23 return pht('Created'); 24 24 } 25 25 ··· 34 34 $new = $this->getNewValue(); 35 35 36 36 switch ($this->getTransactionType()) { 37 - case self::TYPE_DIFF_CREATE; 37 + case self::TYPE_DIFF_CREATE: 38 38 return pht( 39 39 '%s created this diff.', 40 40 $author_handle);
+1 -1
src/applications/differential/storage/DifferentialTransaction.php
··· 168 168 $tags = array(); 169 169 170 170 switch ($this->getTransactionType()) { 171 - case PhabricatorTransactions::TYPE_SUBSCRIBERS; 171 + case PhabricatorTransactions::TYPE_SUBSCRIBERS: 172 172 $tags[] = self::MAILTAG_CC; 173 173 break; 174 174 case self::TYPE_ACTION:
+1 -1
src/applications/files/storage/PhabricatorFile.php
··· 1036 1036 } 1037 1037 1038 1038 switch ($matches[1]) { 1039 - case 'jpg'; 1039 + case 'jpg': 1040 1040 case 'jpeg': 1041 1041 return function_exists('imagejpeg'); 1042 1042 case 'png':
+1 -1
src/applications/search/controller/PhabricatorSearchRelationshipSourceController.php
··· 36 36 $query->setParameter('ownerPHIDs', array($viewer->getPHID())); 37 37 $query->setParameter('statuses', array($status_open)); 38 38 break; 39 - case 'created'; 39 + case 'created': 40 40 $query->setParameter('authorPHIDs', array($viewer->getPHID())); 41 41 $query->setParameter('statuses', array($status_open)); 42 42 break;
+2 -2
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
··· 536 536 537 537 public function getColor() { 538 538 switch ($this->getTransactionType()) { 539 - case PhabricatorTransactions::TYPE_COMMENT; 539 + case PhabricatorTransactions::TYPE_COMMENT: 540 540 $comment = $this->getComment(); 541 541 if ($comment && $comment->getIsRemoved()) { 542 542 return 'grey'; ··· 550 550 return 'sky'; 551 551 } 552 552 break; 553 - case PhabricatorTransactions::TYPE_MFA; 553 + case PhabricatorTransactions::TYPE_MFA: 554 554 return 'pink'; 555 555 } 556 556 return null;
+1 -1
support/startup/PhabricatorStartup.php
··· 462 462 case INPUT_COOKIE: 463 463 $_COOKIE = array_merge($_COOKIE, $filtered); 464 464 break; 465 - case INPUT_ENV; 465 + case INPUT_ENV: 466 466 $env = array_merge($_ENV, $filtered); 467 467 $_ENV = self::filterEnvSuperglobal($env); 468 468 break;