From 5b50afdcafd150186ea5c7b0e1cad98065590b35 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 28 Aug 2026 18:44:28 +0000
Subject: [PATCH] =A few more phpStorm suggestions, mainly in PHPDocs
---
inc/registrar/Registrar.php | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/inc/registrar/Registrar.php b/inc/registrar/Registrar.php
index 7c872fd..02049f4 100644
--- a/inc/registrar/Registrar.php
+++ b/inc/registrar/Registrar.php
@@ -193,7 +193,7 @@
public bool $profile_link;
public bool $is_profile = false;
/**
- * @var array|string
+ * @var array
*/
protected array $can_create = [];
/**
@@ -267,14 +267,11 @@
$exclude = $cache->remember(
$feature,
function () use ($instance, $feature) {
- switch ($feature) {
- case 'hide_single':
- return $instance->excludeSingle();
- case 'is_timeline':
- return $instance->excludeTimeline();
- default:
- return [];
- }
+ return match ($feature) {
+ 'hide_single' => $instance->excludeSingle(),
+ 'is_timeline' => $instance->excludeTimeline(),
+ default => [],
+ };
}
);
@@ -341,6 +338,8 @@
/**
* Instantiates for post types
* @param string $slug
+ * @param string $singular
+ * @param string $plural
* @return self
*/
public static function forPost(string $slug, string $singular, string $plural):self
@@ -354,6 +353,8 @@
/**
* Instantiates for term types
* @param string $slug
+ * @param string $singular
+ * @param string $plural
* @return self
*/
public static function forTerm(string $slug, string $singular, string $plural):self
@@ -367,6 +368,8 @@
/**
* Instantiates for user types
* @param string $slug
+ * @param string $singular
+ * @param string $plural
* @return self
*/
public static function forUser(string $slug, string $singular, string $plural):self
@@ -483,7 +486,7 @@
error_log('Integration not available for '.$this->slug.': '.$integration);
return $this;
}
- $this->integrationConfigs[$integration] = new Integration($integration, $this);
+ $this->integrationConfigs[$integration] = new Integration($integration);
$this->integrationFields[$integration] = new AddIntegrationFields($integration, $this);
return $this;
}
--
Gitblit v1.10.0