Skip to content

Commit bab2e08

Browse files
committedOct 23, 2017
Properly mark DefaultRepositoryFactory as final
1 parent e68c7de commit bab2e08

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎lib/Doctrine/ODM/MongoDB/Repository/DefaultRepositoryFactory.php

+11
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,20 @@
2626
* This factory is used to create default repository objects for entities at runtime.
2727
*
2828
* @todo make the default implementation final in 2.0
29+
* @final since version 1.2
2930
*/
3031
/* final */ class DefaultRepositoryFactory extends AbstractRepositoryFactory
3132
{
33+
public function __construct()
34+
{
35+
if (get_class($this) !== DefaultRepositoryFactory::class) {
36+
@trigger_error(
37+
sprintf('The %s class extends %s which will be final in ODM 2.0. You should extend %s instead.', __CLASS__, DefaultRepositoryFactory::class, AbstractRepositoryFactory::class),
38+
E_USER_DEPRECATED
39+
);
40+
}
41+
}
42+
3243
/**
3344
* {@inheritdoc}
3445
*/

0 commit comments

Comments
 (0)
Please sign in to comment.