Skip to content

Commit 8daf850

Browse files
committed
str starts with is easier on the eyes
1 parent 0b83118 commit 8daf850

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Doctrine/DoctrineHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function doesClassUseDriver(string $className, string $driverClass): bool
9898
}
9999

100100
foreach ($metadataDriver->getDrivers() as $namespace => $driver) {
101-
if (0 === strpos($className, $namespace)) {
101+
if (str_starts_with($className, $namespace)) {
102102
return $this->isInstanceOf($driver, $driverClass);
103103
}
104104
}
@@ -109,7 +109,7 @@ public function doesClassUseDriver(string $className, string $driverClass): bool
109109
$managerName = array_search($em, $this->getRegistry()->getManagers(), true);
110110

111111
foreach ($this->mappingDriversByPrefix[$managerName] as [$prefix, $prefixDriver]) {
112-
if (0 === strpos($className, $prefix)) {
112+
if (str_starts_with($className, $prefix)) {
113113
return $this->isInstanceOf($prefixDriver, $driverClass);
114114
}
115115
}
@@ -208,7 +208,7 @@ public function getMetadata(string $classOrNamespace = null, bool $disconnected
208208
return $m;
209209
}
210210

211-
if (0 === strpos($m->getName(), $classOrNamespace)) {
211+
if (str_starts_with($m->getName(), $classOrNamespace)) {
212212
$metadata[$m->getName()] = $m;
213213
}
214214
}

0 commit comments

Comments
 (0)