Skip to content

Commit a098025

Browse files
authored
Merge pull request #2022 from alcaeus/use-package-name-in-deprecation
Reword most deprecation notices
2 parents e443cf2 + 230021d commit a098025

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+149
-149
lines changed

lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function field($fieldName)
7373
protected function ensureArray($expression)
7474
{
7575
if (self::class !== static::class) {
76-
@trigger_error(sprintf('The "%s" method will be private in MongoDB ODM 2.0. You should not rely on calling this method.', __METHOD__), E_USER_DEPRECATED);
76+
@trigger_error(sprintf('The "%s" method will be private in doctrine/mongodb-odm 2.0. You should not rely on calling this method.', __METHOD__), E_USER_DEPRECATED);
7777
}
7878

7979
// Convert field names in expressions

lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Bucket.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(Builder $builder, DocumentManager $documentManager,
4848
protected function convertExpression($expression)
4949
{
5050
if (self::class !== static::class) {
51-
@trigger_error(sprintf('The "%s" method will be private in MongoDB ODM 2.0. You should not rely on calling this method.', __METHOD__), E_USER_DEPRECATED);
51+
@trigger_error(sprintf('The "%s" method will be private in doctrine/mongodb-odm 2.0. You should not rely on calling this method.', __METHOD__), E_USER_DEPRECATED);
5252
}
5353

5454
if (is_array($expression)) {

lib/Doctrine/ODM/MongoDB/Aggregation/Stage/BucketAuto.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(Builder $builder, DocumentManager $documentManager,
4848
protected function convertExpression($expression)
4949
{
5050
if (self::class !== static::class) {
51-
@trigger_error(sprintf('The "%s" method will be private in MongoDB ODM 2.0. You should not rely on calling this method.', __METHOD__), E_USER_DEPRECATED);
51+
@trigger_error(sprintf('The "%s" method will be private in doctrine/mongodb-odm 2.0. You should not rely on calling this method.', __METHOD__), E_USER_DEPRECATED);
5252
}
5353

5454
if (is_array($expression)) {

lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GraphLookup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private function fromReference($fieldName)
156156
protected function convertExpression($expression)
157157
{
158158
if (self::class !== static::class) {
159-
@trigger_error(sprintf('The "%s" method will be private in MongoDB ODM 2.0. You should not rely on calling this method.', __METHOD__), E_USER_DEPRECATED);
159+
@trigger_error(sprintf('The "%s" method will be private in doctrine/mongodb-odm 2.0. You should not rely on calling this method.', __METHOD__), E_USER_DEPRECATED);
160160
}
161161

162162
if (is_array($expression)) {
@@ -171,7 +171,7 @@ protected function convertExpression($expression)
171171
protected function convertTargetFieldName($fieldName)
172172
{
173173
if (self::class !== static::class) {
174-
@trigger_error(sprintf('The "%s" method will be private in MongoDB ODM 2.0. You should not rely on calling this method.', __METHOD__), E_USER_DEPRECATED);
174+
@trigger_error(sprintf('The "%s" method will be private in doctrine/mongodb-odm 2.0. You should not rely on calling this method.', __METHOD__), E_USER_DEPRECATED);
175175
}
176176

177177
if (is_array($fieldName)) {

lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Match.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function includesReferenceTo($document)
6060
*/
6161
public function debug($name = null)
6262
{
63-
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in MongoDB ODM 2.0.', __METHOD__), E_USER_DEPRECATED);
63+
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in doctrine/mongodb-odm 2.0.', __METHOD__), E_USER_DEPRECATED);
6464

6565
return parent::debug($name);
6666
}
@@ -71,7 +71,7 @@ public function debug($name = null)
7171
public function geoWithinPolygon()
7272
{
7373
if (func_num_args() < 3) {
74-
@trigger_error(sprintf('Calling "%s" with fewer than 3 arguments was deprecated in MongoDB ODM 1.3 and will require at least 3 arguments in 2.0.', __METHOD__), E_USER_DEPRECATED);
74+
@trigger_error(sprintf('Calling "%s" with fewer than 3 arguments was deprecated in doctrine/mongodb-odm 1.3 and will require at least 3 arguments in 2.0.', __METHOD__), E_USER_DEPRECATED);
7575
}
7676

7777
return parent::geoWithinPolygon(...func_get_args());
@@ -84,7 +84,7 @@ public function geoWithinPolygon()
8484
*/
8585
public function maxDistance($maxDistance)
8686
{
87-
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in MongoDB ODM 2.0.', __METHOD__), E_USER_DEPRECATED);
87+
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in doctrine/mongodb-odm 2.0.', __METHOD__), E_USER_DEPRECATED);
8888

8989
return parent::maxDistance($maxDistance);
9090
}
@@ -96,7 +96,7 @@ public function maxDistance($maxDistance)
9696
*/
9797
public function minDistance($minDistance)
9898
{
99-
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in MongoDB ODM 2.0.', __METHOD__), E_USER_DEPRECATED);
99+
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in doctrine/mongodb-odm 2.0.', __METHOD__), E_USER_DEPRECATED);
100100

101101
return parent::minDistance($minDistance);
102102
}

lib/Doctrine/ODM/MongoDB/Aggregation/Stage/ReplaceRoot.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(Builder $builder, DocumentManager $documentManager,
4848
protected function convertExpression($expression)
4949
{
5050
if (self::class !== static::class) {
51-
@trigger_error(sprintf('The "%s" method will be private in MongoDB ODM 2.0. You should not rely on calling this method.', __METHOD__), E_USER_DEPRECATED);
51+
@trigger_error(sprintf('The "%s" method will be private in doctrine/mongodb-odm 2.0. You should not rely on calling this method.', __METHOD__), E_USER_DEPRECATED);
5252
}
5353

5454
if (is_array($expression)) {

lib/Doctrine/ODM/MongoDB/Configuration.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,14 @@ public function setAutoGenerateProxyClasses($autoGenerateProxyClasses)
247247
{
248248
if (is_bool($autoGenerateProxyClasses)) {
249249
@trigger_error(
250-
sprintf('Passing boolean value to %s is deprecated, please use constants of %s instead.', __METHOD__, AbstractProxyFactory::class),
250+
sprintf('Passing boolean value to "%s" is deprecated, please use constants of "%s" instead.', __METHOD__, AbstractProxyFactory::class),
251251
E_USER_DEPRECATED
252252
);
253253
}
254254

255255
if ($autoGenerateProxyClasses === AbstractProxyFactory::AUTOGENERATE_ALWAYS || $autoGenerateProxyClasses === AbstractProxyFactory::AUTOGENERATE_NEVER) {
256256
@trigger_error(
257-
sprintf('The "AUTOGENERATE_ALWAYS" and "AUTOGENERATE_NEVER" strategies for proxy generation are deprecated and will be dropped in 2.0. Please use "AUTOGENERATE_FILE_NOT_EXISTS" and "AUTOGENERATE_EVAL".'),
257+
sprintf('The "AUTOGENERATE_ALWAYS" and "AUTOGENERATE_NEVER" strategies for proxy generation are deprecated and will be dropped in doctrine/mongodb-odm 2.0. Please use "AUTOGENERATE_FILE_NOT_EXISTS" and "AUTOGENERATE_EVAL".'),
258258
E_USER_DEPRECATED
259259
);
260260
}
@@ -326,7 +326,7 @@ public function setAutoGenerateHydratorClasses($bool)
326326
{
327327
if (is_bool($bool)) {
328328
@trigger_error(
329-
sprintf('Passing boolean value to %s is deprecated, please use AUTOGENERATE_* constants of %s instead.', __METHOD__, self::class),
329+
sprintf('Passing boolean value to "%s" is deprecated, please use "AUTOGENERATE_*" constants of "%s" instead.', __METHOD__, self::class),
330330
E_USER_DEPRECATED
331331
);
332332
}
@@ -545,7 +545,7 @@ public function getFilterParameters($name)
545545
public function setDefaultRepositoryClassName($className)
546546
{
547547
@trigger_error(
548-
sprintf('"%s" was deprecated in MongoDB ODM 1.2 and will be removed in 2.0. Please use "%s::setDefaultDocumentRepositoryClassName" instead.', __METHOD__, __CLASS__),
548+
sprintf('"%s" was deprecated in doctrine/mongodb-odm 1.2 and will be removed in 2.0. Please use "%s::setDefaultDocumentRepositoryClassName" instead.', __METHOD__, __CLASS__),
549549
E_USER_DEPRECATED
550550
);
551551
$this->setDefaultDocumentRepositoryClassName($className);
@@ -561,7 +561,7 @@ public function setDefaultRepositoryClassName($className)
561561
public function getDefaultRepositoryClassName()
562562
{
563563
@trigger_error(
564-
sprintf('"%s" was deprecated in MongoDB ODM 1.2 and will be removed in 2.0. Please use "%s::getDefaultDocumentRepositoryClassName" instead.', __METHOD__, __CLASS__),
564+
sprintf('"%s" was deprecated in doctrine/mongodb-odm 1.2 and will be removed in 2.0. Please use "%s::getDefaultDocumentRepositoryClassName" instead.', __METHOD__, __CLASS__),
565565
E_USER_DEPRECATED
566566
);
567567
return $this->getDefaultDocumentRepositoryClassName();
@@ -669,7 +669,7 @@ public function getPersistentCollectionGenerator()
669669
*/
670670
public function getLoggerCallable()
671671
{
672-
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in MongoDB ODM 2.0.', __METHOD__), E_USER_DEPRECATED);
672+
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in doctrine/mongodb-odm 2.0.', __METHOD__), E_USER_DEPRECATED);
673673

674674
return parent::getLoggerCallable();
675675
}
@@ -681,7 +681,7 @@ public function getLoggerCallable()
681681
*/
682682
public function setLoggerCallable($loggerCallable)
683683
{
684-
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in MongoDB ODM 2.0.', __METHOD__), E_USER_DEPRECATED);
684+
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in doctrine/mongodb-odm 2.0.', __METHOD__), E_USER_DEPRECATED);
685685

686686
parent::setLoggerCallable($loggerCallable);
687687
}
@@ -693,7 +693,7 @@ public function setLoggerCallable($loggerCallable)
693693
*/
694694
public function getMongoCmd()
695695
{
696-
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in MongoDB ODM 2.0.', __METHOD__), E_USER_DEPRECATED);
696+
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in doctrine/mongodb-odm 2.0.', __METHOD__), E_USER_DEPRECATED);
697697

698698
return parent::getMongoCmd();
699699
}
@@ -705,7 +705,7 @@ public function getMongoCmd()
705705
*/
706706
public function setMongoCmd($cmd)
707707
{
708-
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in MongoDB ODM 2.0.', __METHOD__), E_USER_DEPRECATED);
708+
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in doctrine/mongodb-odm 2.0.', __METHOD__), E_USER_DEPRECATED);
709709

710710
parent::setMongoCmd($cmd);
711711
}
@@ -717,7 +717,7 @@ public function setMongoCmd($cmd)
717717
*/
718718
public function getRetryConnect()
719719
{
720-
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in MongoDB ODM 2.0.', __METHOD__), E_USER_DEPRECATED);
720+
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in doctrine/mongodb-odm 2.0.', __METHOD__), E_USER_DEPRECATED);
721721

722722
return parent::getRetryConnect();
723723
}
@@ -729,7 +729,7 @@ public function getRetryConnect()
729729
*/
730730
public function setRetryConnect($retryConnect)
731731
{
732-
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in MongoDB ODM 2.0.', __METHOD__), E_USER_DEPRECATED);
732+
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in doctrine/mongodb-odm 2.0.', __METHOD__), E_USER_DEPRECATED);
733733

734734
parent::setRetryConnect($retryConnect);
735735
}
@@ -741,7 +741,7 @@ public function setRetryConnect($retryConnect)
741741
*/
742742
public function getRetryQuery()
743743
{
744-
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in MongoDB ODM 2.0.', __METHOD__), E_USER_DEPRECATED);
744+
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in doctrine/mongodb-odm 2.0.', __METHOD__), E_USER_DEPRECATED);
745745

746746
return parent::getRetryQuery();
747747
}
@@ -753,7 +753,7 @@ public function getRetryQuery()
753753
*/
754754
public function setRetryQuery($retryQuery)
755755
{
756-
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in MongoDB ODM 2.0.', __METHOD__), E_USER_DEPRECATED);
756+
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in doctrine/mongodb-odm 2.0.', __METHOD__), E_USER_DEPRECATED);
757757

758758
parent::setRetryQuery($retryQuery);
759759
}

lib/Doctrine/ODM/MongoDB/Cursor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ public function slaveOkay($ok = true)
559559
$ok = (boolean) $ok;
560560
if ($ok) {
561561
@trigger_error(
562-
sprintf('%s was deprecated in version 1.2 - use setReadPreference on the query instead.', __METHOD__),
562+
sprintf('The "%s" method was deprecated in doctrine/mongodb-odm 1.2 and will be removed in 2.0. Use setReadPreference on the query instead.', __METHOD__),
563563
E_USER_DEPRECATED
564564
);
565565
}

lib/Doctrine/ODM/MongoDB/DocumentManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ private function getDiscriminatorData(array $referenceMapping, ClassMetadata $cl
799799
*/
800800
public function createDBRef($document, array $referenceMapping = null)
801801
{
802-
@trigger_error('The ' . __METHOD__ . ' method has been deprecated and will be removed in ODM 2.0. Use createReference() instead.', E_USER_DEPRECATED);
802+
@trigger_error(sprintf('The "%s" method has been deprecated and will be removed in doctrine/mongodb-odm 2.0. Use createReference() instead.', __METHOD__), E_USER_DEPRECATED);
803803

804804
if (!isset($referenceMapping['storeAs'])) {
805805
$referenceMapping['storeAs'] = ClassMetadata::REFERENCE_STORE_AS_DB_REF;

lib/Doctrine/ODM/MongoDB/DocumentNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class DocumentNotFoundException extends MongoDBException
3333
public function __construct($message = "", $code = 0, Throwable $previous = null)
3434
{
3535
if (self::class !== static::class) {
36-
@trigger_error(sprintf('The class "%s" extends "%s" which will be final in MongoDB ODM 2.0.', static::class, self::class), E_USER_DEPRECATED);
36+
@trigger_error(sprintf('The class "%s" extends "%s" which will be final in doctrine/mongodb-odm 2.0.', static::class, self::class), E_USER_DEPRECATED);
3737
}
3838
parent::__construct($message, $code, $previous);
3939
}

0 commit comments

Comments
 (0)