aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/App.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/AppFramework/App.php')
-rw-r--r--lib/private/AppFramework/App.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/AppFramework/App.php b/lib/private/AppFramework/App.php
index abf8a08a44b..0cbe47b75a5 100644
--- a/lib/private/AppFramework/App.php
+++ b/lib/private/AppFramework/App.php
@@ -91,12 +91,12 @@ class App {
}
public static function getAppIdForClass(string $className, string $topNamespace = 'OCA\\'): ?string {
- if (strpos($className, $topNamespace) !== 0) {
+ if (!str_starts_with($className, $topNamespace)) {
return null;
}
foreach (self::$nameSpaceCache as $appId => $namespace) {
- if (strpos($className, $topNamespace . $namespace . '\\') === 0) {
+ if (str_starts_with($className, $topNamespace . $namespace . '\\')) {
return $appId;
}
}
@@ -147,7 +147,7 @@ class App {
try {
$controller = $container->get($controllerName);
} catch (QueryException $e) {
- if (strpos($controllerName, '\\Controller\\') !== false) {
+ if (str_contains($controllerName, '\\Controller\\')) {
// This is from a global registered app route that is not enabled.
[/*OC(A)*/, $app, /* Controller/Name*/] = explode('\\', $controllerName, 3);
throw new HintException('App ' . strtolower($app) . ' is not enabled');