summaryrefslogtreecommitdiffstats
path: root/lib/private/ServerContainer.php
diff options
context:
space:
mode:
authorFaraz Samapoor <fsamapoor@gmail.com>2023-05-15 15:17:19 +0330
committerFaraz Samapoor <fsamapoor@gmail.com>2023-05-15 15:17:19 +0330
commite7cc7653b885c49b1b3f0a78f91ea05a53e102d8 (patch)
tree42da61d5c6e988d7c9eff7e081327a73f661dc89 /lib/private/ServerContainer.php
parent8bdb50fd507bfe68161ab98eba903872083ea4f3 (diff)
downloadnextcloud-server-e7cc7653b885c49b1b3f0a78f91ea05a53e102d8.tar.gz
nextcloud-server-e7cc7653b885c49b1b3f0a78f91ea05a53e102d8.zip
Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
Diffstat (limited to 'lib/private/ServerContainer.php')
-rw-r--r--lib/private/ServerContainer.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/ServerContainer.php b/lib/private/ServerContainer.php
index e53737990e8..a8583bd6875 100644
--- a/lib/private/ServerContainer.php
+++ b/lib/private/ServerContainer.php
@@ -157,7 +157,7 @@ class ServerContainer extends SimpleContainer {
// Didn't find the service or the respective app container,
// ignore it and fall back to the core container.
}
- } elseif (strpos($name, 'OC\\Settings\\') === 0 && substr_count($name, '\\') >= 3) {
+ } elseif (str_starts_with($name, 'OC\\Settings\\') && substr_count($name, '\\') >= 3) {
$segments = explode('\\', $name);
try {
$appContainer = $this->getAppContainer(strtolower($segments[1]), $segments[1]);
@@ -177,7 +177,7 @@ class ServerContainer extends SimpleContainer {
* @return DIContainer|null
*/
public function getAppContainerForService(string $id): ?DIContainer {
- if (strpos($id, 'OCA\\') !== 0 || substr_count($id, '\\') < 2) {
+ if (!str_starts_with($id, 'OCA\\') || substr_count($id, '\\') < 2) {
return null;
}