@@ -60,38 +60,38 @@ public static function createStore($connection)
6060 case 'flock ' === $ connection :
6161 return new FlockStore ();
6262
63- case 0 === strpos ($ connection , 'flock:// ' ):
63+ case str_starts_with ($ connection , 'flock:// ' ):
6464 return new FlockStore (substr ($ connection , 8 ));
6565
6666 case 'semaphore ' === $ connection :
6767 return new SemaphoreStore ();
6868
69- case 0 === strpos ($ connection , 'redis: ' ):
70- case 0 === strpos ($ connection , 'rediss: ' ):
71- case 0 === strpos ($ connection , 'memcached: ' ):
69+ case str_starts_with ($ connection , 'redis: ' ):
70+ case str_starts_with ($ connection , 'rediss: ' ):
71+ case str_starts_with ($ connection , 'memcached: ' ):
7272 if (!class_exists (AbstractAdapter::class)) {
7373 throw new InvalidArgumentException (sprintf ('Unsupported DSN "%s". Try running "composer require symfony/cache". ' , $ connection ));
7474 }
75- $ storeClass = 0 === strpos ($ connection , 'memcached: ' ) ? MemcachedStore::class : RedisStore::class;
75+ $ storeClass = str_starts_with ($ connection , 'memcached: ' ) ? MemcachedStore::class : RedisStore::class;
7676 $ connection = AbstractAdapter::createConnection ($ connection , ['lazy ' => true ]);
7777
7878 return new $ storeClass ($ connection );
7979
80- case 0 === strpos ($ connection , 'mssql:// ' ):
81- case 0 === strpos ($ connection , 'mysql: ' ):
82- case 0 === strpos ($ connection , 'mysql2:// ' ):
83- case 0 === strpos ($ connection , 'oci: ' ):
84- case 0 === strpos ($ connection , 'oci8:// ' ):
85- case 0 === strpos ($ connection , 'pdo_oci:// ' ):
86- case 0 === strpos ($ connection , 'pgsql: ' ):
87- case 0 === strpos ($ connection , 'postgres:// ' ):
88- case 0 === strpos ($ connection , 'postgresql:// ' ):
89- case 0 === strpos ($ connection , 'sqlsrv: ' ):
90- case 0 === strpos ($ connection , 'sqlite: ' ):
91- case 0 === strpos ($ connection , 'sqlite3:// ' ):
80+ case str_starts_with ($ connection , 'mssql:// ' ):
81+ case str_starts_with ($ connection , 'mysql: ' ):
82+ case str_starts_with ($ connection , 'mysql2:// ' ):
83+ case str_starts_with ($ connection , 'oci: ' ):
84+ case str_starts_with ($ connection , 'oci8:// ' ):
85+ case str_starts_with ($ connection , 'pdo_oci:// ' ):
86+ case str_starts_with ($ connection , 'pgsql: ' ):
87+ case str_starts_with ($ connection , 'postgres:// ' ):
88+ case str_starts_with ($ connection , 'postgresql:// ' ):
89+ case str_starts_with ($ connection , 'sqlsrv: ' ):
90+ case str_starts_with ($ connection , 'sqlite: ' ):
91+ case str_starts_with ($ connection , 'sqlite3:// ' ):
9292 return new PdoStore ($ connection );
9393
94- case 0 === strpos ($ connection , 'zookeeper:// ' ):
94+ case str_starts_with ($ connection , 'zookeeper:// ' ):
9595 return new ZookeeperStore (ZookeeperStore::createConnection ($ connection ));
9696 }
9797
0 commit comments