diff --git a/CHANGELOG.md b/CHANGELOG.md index c4d20c6..42775e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,12 @@ rebuild; it ships as **1.0.0 Alpha 4**, the successor of the 1.0.0 Alpha 3 relea `HTTP/` line with PHP's built-in server). A file with a second status line, a setter, or a computed `header()` argument is reported without a fix. The description states that the status code sent by the replacement is the same. +- No deprecated PHP plugin API is left (JetBrains Plugin Verifier, 2026.2 and 2026.3: "2 usages of deprecated API"): + the exit-guard check reads a `throw …;` statement through `PhpThrowExpression` instead of `PhpThrow`, and + **ResultSetGuard** reads a declared return type through `Function.getTypeDeclaration()` instead of + `getReturnType()`. A throw on one side of `||` or `??` is still no exit guard. +- The plugin description says that install and update normally need no IDE restart; the IDE decides that per + install, and the verifier asks for a manual check. ## 1.0.0-alpha.5 — 1.0.0 Alpha 5 — Marketplace release 2026-10-26 diff --git a/src/main/kotlin/org/xoops/support/inspections/XoopsResultSetGuardInspection.kt b/src/main/kotlin/org/xoops/support/inspections/XoopsResultSetGuardInspection.kt index 97e81fd..2a698d6 100644 --- a/src/main/kotlin/org/xoops/support/inspections/XoopsResultSetGuardInspection.kt +++ b/src/main/kotlin/org/xoops/support/inspections/XoopsResultSetGuardInspection.kt @@ -248,7 +248,7 @@ class XoopsResultSetGuardInspection : XoopsInspection() { } private fun plainReturn(fn: Function, element: PsiElement): String? { - val declaredRaw = fn.returnType?.text?.replace(":", "")?.trim()?.lowercase() + val declaredRaw = fn.typeDeclaration?.text?.replace(":", "")?.trim()?.lowercase() if (!declaredRaw.isNullOrBlank()) { val nullable = declaredRaw.startsWith("?") || declaredRaw.split('|').any { it.trim() == "null" } val declared = declaredRaw.removePrefix("?") diff --git a/src/main/kotlin/org/xoops/support/psi/Php.kt b/src/main/kotlin/org/xoops/support/psi/Php.kt index 29cedf8..4e204ce 100644 --- a/src/main/kotlin/org/xoops/support/psi/Php.kt +++ b/src/main/kotlin/org/xoops/support/psi/Php.kt @@ -24,7 +24,7 @@ import com.jetbrains.php.lang.psi.elements.PhpExit import com.jetbrains.php.lang.psi.elements.PhpNamespace import com.jetbrains.php.lang.psi.elements.PhpPsiElement import com.jetbrains.php.lang.psi.elements.PhpReturn -import com.jetbrains.php.lang.psi.elements.PhpThrow +import com.jetbrains.php.lang.psi.elements.PhpThrowExpression import com.jetbrains.php.lang.psi.elements.PhpUseList import com.jetbrains.php.lang.psi.elements.Statement import com.jetbrains.php.lang.psi.elements.StringLiteralExpression @@ -268,7 +268,9 @@ object Php { else -> body } if (last == null) return false - if (last is PhpReturn || last is PhpThrow) return true + // A `throw …;` statement starts with its throw expression; `$x ?? throw …` and `$ok || throw …` do not, + // and they leave only on one side. + if (last is PhpReturn || last.firstChild is PhpThrowExpression) return true if (PsiTreeUtil.findChildOfType(last, PhpExit::class.java, false) != null) return true val firstCall = PsiTreeUtil.findChildOfType(last, FunctionReference::class.java, false) ?: return false if (isCall(firstCall, "redirect_header")) return true diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 947dd86..93ebca0 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -49,7 +49,7 @@
Install the plugin and open a XOOPS project. Detection is automatic. You can set the Core Version and other options under Settings → Languages & Frameworks → XOOPS Support, and the inspections are listed - under Settings → Editor → Inspections → XOOPS. The plugin installs and updates without an IDE restart.
+ under Settings → Editor → Inspections → XOOPS. The plugin is dynamic: it normally installs and updates without an IDE restart.Source, documentation and issues on GitHub
]]> @@ -89,7 +89,7 @@class/xoopsobject.php, xoopsmodule.php, xoopsuser.php and mimetypes.inc.php stubs moved to
kernel/ / include/; the eight deprecated xoops_load() short names ('cache' → 'xoopscache' …);
and a new inspection for $xoopsOption[…] inside a function without global $xoopsOption.
-