-
Notifications
You must be signed in to change notification settings - Fork 1.5k
V5 #3041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V5 #3041
Conversation
src/Session/SessionManager.php
Outdated
{ | ||
$connection = $this->getMongoDBConnection(); | ||
|
||
$collection = $this->app['config']['session.table']; |
Check failure
Code scanning / PHPStan
Access to an undefined property MongoDB\Laravel\Session\SessionManager::$app. Error
src/Session/SessionManager.php
Outdated
|
||
$collection = $this->app['config']['session.table']; | ||
|
||
$database = (string) $connection->getMongoDB(); |
Check failure
Code scanning / PHPStan
Call to method getMongoDB() on an unknown class MongoDB\Laravel\Session\Connection. Error
src/Session/SessionManager.php
Outdated
|
||
$database = (string) $connection->getMongoDB(); | ||
|
||
$handler = new MongoDbSessionHandler($connection->getMongoClient(), $this->getMongoDBOptions($database, $collection)); |
Check failure
Code scanning / PHPStan
Call to method getMongoClient() on an unknown class MongoDB\Laravel\Session\Connection. Error
src/Session/SessionManager.php
Outdated
* | ||
* @return Connection | ||
*/ | ||
protected function getMongoDBConnection() |
Check failure
Code scanning / PHPStan
Method MongoDB\Laravel\Session\SessionManager::getMongoDBConnection() has invalid return type MongoDB\Laravel\Session\Connection. Error
src/Session/SessionManager.php
Outdated
*/ | ||
protected function getMongoDBConnection() | ||
{ | ||
$connection = $this->app['config']['session.connection']; |
Check failure
Code scanning / PHPStan
Access to an undefined property MongoDB\Laravel\Session\SessionManager::$app. Error
src/Session/SessionManager.php
Outdated
// The default connection may still be mysql, we need to verify if this connection | ||
// is using the mongodb driver. | ||
if (is_null($connection)) { | ||
$default = $this->app['db']->getDefaultConnection(); |
Check failure
Code scanning / PHPStan
Access to an undefined property MongoDB\Laravel\Session\SessionManager::$app. Error
src/Session/SessionManager.php
Outdated
if (is_null($connection)) { | ||
$default = $this->app['db']->getDefaultConnection(); | ||
|
||
$connections = $this->app['config']['database.connections']; |
Check failure
Code scanning / PHPStan
Access to an undefined property MongoDB\Laravel\Session\SessionManager::$app. Error
src/Session/SessionManager.php
Outdated
} | ||
} | ||
|
||
return $this->app['db']->connection($connection); |
Check failure
Code scanning / PHPStan
Access to an undefined property MongoDB\Laravel\Session\SessionManager::$app. Error
Query Builder return stdClass: https://github.com/laravel/framework/blob/213a370b703592587bafcd52d38a0ad772ff7442/src/Illuminate/Database/Connection.php#L118C16-L118C25 Alias id for _id everywhere Don't expose _id field: No _id attribute in Eloquent. Deprecate reading and writing _id attribute. Always convert datetime to UTCDateTime: https://github.com/laravel/framework/blob/213a370b703592587bafcd52d38a0ad772ff7442/src/Illuminate/Database/Connection.php#L733-L734 Timezone : using Carbon instead of system timezone.
* | ||
* @var string | ||
*/ | ||
protected $primaryKey = '_id'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The primary key can keep the default value id
, which is converted to _id
by the query builder.
@@ -451,7 +456,7 @@ public function toMql(): array | |||
} | |||
|
|||
// Fix for legacy support, converts the results to arrays instead of objects. | |||
$options['typeMap'] = ['root' => 'array', 'document' => 'array']; | |||
$options['typeMap'] = ['root' => 'object', 'document' => 'array']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Major breaking change to meet Laravel's behavior: the query builder returns a stdClass
object.
/** @deprecated Use {@see DatabaseFailedJobProvider} */ | ||
class MongoFailedJobProvider extends DatabaseFailedJobProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is no longer necessary as the Laravel class works out of the box thanks to the change of id
field, automatic transformation of dates, and results returned as objects.
Checklist