-
-
Notifications
You must be signed in to change notification settings - Fork 75
Modernize the codebase #492
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
Changes from all commits
4b7cd34
e81b8a8
5d5bf02
6510f58
e77d95e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ includes: | |
|
|
||
| parameters: | ||
| level: 7 | ||
| checkMissingOverrideMethodAttribute: true | ||
| phpVersion: 80400 | ||
|
|
||
| paths: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| namespace Doctrine\Persistence; | ||
|
|
||
| use InvalidArgumentException; | ||
| use Override; | ||
| use ReflectionClass; | ||
|
|
||
| use function assert; | ||
|
|
@@ -22,8 +23,8 @@ abstract class AbstractManagerRegistry implements ManagerRegistry | |
| */ | ||
| public function __construct( | ||
| private readonly string $name, | ||
| private array $connections, | ||
| private array $managers, | ||
| private readonly array $connections, | ||
| private readonly array $managers, | ||
| private readonly string $defaultConnection, | ||
| private readonly string $defaultManager, | ||
| private readonly string|null $proxyInterfaceName = null, | ||
|
|
@@ -56,6 +57,7 @@ public function getName(): string | |
| return $this->name; | ||
| } | ||
|
|
||
| #[Override] | ||
| public function getConnection(string|null $name = null): object | ||
| { | ||
| if ($name === null) { | ||
|
|
@@ -74,6 +76,7 @@ public function getConnection(string|null $name = null): object | |
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| #[Override] | ||
| public function getConnectionNames(): array | ||
| { | ||
| return $this->connections; | ||
|
|
@@ -82,6 +85,7 @@ public function getConnectionNames(): array | |
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| #[Override] | ||
| public function getConnections(): array | ||
| { | ||
| $connections = []; | ||
|
|
@@ -92,11 +96,13 @@ public function getConnections(): array | |
| return $connections; | ||
| } | ||
|
|
||
| #[Override] | ||
| public function getDefaultConnectionName(): string | ||
| { | ||
| return $this->defaultConnection; | ||
| } | ||
|
|
||
| #[Override] | ||
| public function getDefaultManagerName(): string | ||
| { | ||
| return $this->defaultManager; | ||
|
|
@@ -107,6 +113,7 @@ public function getDefaultManagerName(): string | |
| * | ||
| * @throws InvalidArgumentException | ||
| */ | ||
| #[Override] | ||
| public function getManager(string|null $name = null): ObjectManager | ||
| { | ||
| if ($name === null) { | ||
|
|
@@ -125,6 +132,7 @@ public function getManager(string|null $name = null): ObjectManager | |
| return $service; | ||
| } | ||
|
|
||
| #[Override] | ||
| public function getManagerForClass(string $class): ObjectManager|null | ||
| { | ||
| $proxyClass = new ReflectionClass($class); | ||
|
|
@@ -157,6 +165,7 @@ public function getManagerForClass(string $class): ObjectManager|null | |
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| #[Override] | ||
| public function getManagerNames(): array | ||
| { | ||
| return $this->managers; | ||
|
|
@@ -165,6 +174,7 @@ public function getManagerNames(): array | |
| /** | ||
| * {@inheritDoc} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be removed. The inline phpdoc tag is only about inheriting the long description (which is only useful when wanting to include it inside the long description define of the child, thing about it as the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @stof should we wait on slevomat/coding-standard#1824 before attempting to address this?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the PR slevomat/coding-standard#1828 @greg0ire. We can remove the phpdoc in all the doctrine projects in an other PR. |
||
| */ | ||
| #[Override] | ||
| public function getManagers(): array | ||
| { | ||
| $managers = []; | ||
|
|
@@ -178,6 +188,7 @@ public function getManagers(): array | |
| return $managers; | ||
| } | ||
|
|
||
| #[Override] | ||
| public function getRepository( | ||
| string $persistentObject, | ||
| string|null $persistentManagerName = null, | ||
|
|
@@ -187,6 +198,7 @@ public function getRepository( | |
| ->getRepository($persistentObject); | ||
| } | ||
|
|
||
| #[Override] | ||
| public function resetManager(string|null $name = null): ObjectManager | ||
| { | ||
| if ($name === null) { | ||
|
|
||
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.
From my first commit message:
If you can imagine a reason why I didn't, let me know. If not, then I guess the best way to find out will be to just do it.