Skip to content

Commit

Permalink
Merge pull request #2022 from alcaeus/use-package-name-in-deprecation
Browse files Browse the repository at this point in the history
Reword most deprecation notices
  • Loading branch information
alcaeus authored Apr 28, 2019
2 parents e443cf2 + 230021d commit a098025
Show file tree
Hide file tree
Showing 60 changed files with 149 additions and 149 deletions.
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function field($fieldName)
protected function ensureArray($expression)
{
if (self::class !== static::class) {
@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);
@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);
}

// Convert field names in expressions
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Bucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(Builder $builder, DocumentManager $documentManager,
protected function convertExpression($expression)
{
if (self::class !== static::class) {
@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);
@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);
}

if (is_array($expression)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Aggregation/Stage/BucketAuto.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(Builder $builder, DocumentManager $documentManager,
protected function convertExpression($expression)
{
if (self::class !== static::class) {
@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);
@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);
}

if (is_array($expression)) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GraphLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private function fromReference($fieldName)
protected function convertExpression($expression)
{
if (self::class !== static::class) {
@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);
@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);
}

if (is_array($expression)) {
Expand All @@ -171,7 +171,7 @@ protected function convertExpression($expression)
protected function convertTargetFieldName($fieldName)
{
if (self::class !== static::class) {
@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);
@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);
}

if (is_array($fieldName)) {
Expand Down
8 changes: 4 additions & 4 deletions lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Match.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function includesReferenceTo($document)
*/
public function debug($name = null)
{
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in MongoDB ODM 2.0.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in doctrine/mongodb-odm 2.0.', __METHOD__), E_USER_DEPRECATED);

return parent::debug($name);
}
Expand All @@ -71,7 +71,7 @@ public function debug($name = null)
public function geoWithinPolygon()
{
if (func_num_args() < 3) {
@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);
@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);
}

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

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

return parent::minDistance($minDistance);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Aggregation/Stage/ReplaceRoot.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(Builder $builder, DocumentManager $documentManager,
protected function convertExpression($expression)
{
if (self::class !== static::class) {
@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);
@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);
}

if (is_array($expression)) {
Expand Down
26 changes: 13 additions & 13 deletions lib/Doctrine/ODM/MongoDB/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,14 @@ public function setAutoGenerateProxyClasses($autoGenerateProxyClasses)
{
if (is_bool($autoGenerateProxyClasses)) {
@trigger_error(
sprintf('Passing boolean value to %s is deprecated, please use constants of %s instead.', __METHOD__, AbstractProxyFactory::class),
sprintf('Passing boolean value to "%s" is deprecated, please use constants of "%s" instead.', __METHOD__, AbstractProxyFactory::class),
E_USER_DEPRECATED
);
}

if ($autoGenerateProxyClasses === AbstractProxyFactory::AUTOGENERATE_ALWAYS || $autoGenerateProxyClasses === AbstractProxyFactory::AUTOGENERATE_NEVER) {
@trigger_error(
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".'),
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".'),
E_USER_DEPRECATED
);
}
Expand Down Expand Up @@ -326,7 +326,7 @@ public function setAutoGenerateHydratorClasses($bool)
{
if (is_bool($bool)) {
@trigger_error(
sprintf('Passing boolean value to %s is deprecated, please use AUTOGENERATE_* constants of %s instead.', __METHOD__, self::class),
sprintf('Passing boolean value to "%s" is deprecated, please use "AUTOGENERATE_*" constants of "%s" instead.', __METHOD__, self::class),
E_USER_DEPRECATED
);
}
Expand Down Expand Up @@ -545,7 +545,7 @@ public function getFilterParameters($name)
public function setDefaultRepositoryClassName($className)
{
@trigger_error(
sprintf('"%s" was deprecated in MongoDB ODM 1.2 and will be removed in 2.0. Please use "%s::setDefaultDocumentRepositoryClassName" instead.', __METHOD__, __CLASS__),
sprintf('"%s" was deprecated in doctrine/mongodb-odm 1.2 and will be removed in 2.0. Please use "%s::setDefaultDocumentRepositoryClassName" instead.', __METHOD__, __CLASS__),
E_USER_DEPRECATED
);
$this->setDefaultDocumentRepositoryClassName($className);
Expand All @@ -561,7 +561,7 @@ public function setDefaultRepositoryClassName($className)
public function getDefaultRepositoryClassName()
{
@trigger_error(
sprintf('"%s" was deprecated in MongoDB ODM 1.2 and will be removed in 2.0. Please use "%s::getDefaultDocumentRepositoryClassName" instead.', __METHOD__, __CLASS__),
sprintf('"%s" was deprecated in doctrine/mongodb-odm 1.2 and will be removed in 2.0. Please use "%s::getDefaultDocumentRepositoryClassName" instead.', __METHOD__, __CLASS__),
E_USER_DEPRECATED
);
return $this->getDefaultDocumentRepositoryClassName();
Expand Down Expand Up @@ -669,7 +669,7 @@ public function getPersistentCollectionGenerator()
*/
public function getLoggerCallable()
{
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in MongoDB ODM 2.0.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" method is deprecated and will be removed in doctrine/mongodb-odm 2.0.', __METHOD__), E_USER_DEPRECATED);

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

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

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

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

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

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

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

parent::setRetryQuery($retryQuery);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Cursor.php
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ public function slaveOkay($ok = true)
$ok = (boolean) $ok;
if ($ok) {
@trigger_error(
sprintf('%s was deprecated in version 1.2 - use setReadPreference on the query instead.', __METHOD__),
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__),
E_USER_DEPRECATED
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/DocumentManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ private function getDiscriminatorData(array $referenceMapping, ClassMetadata $cl
*/
public function createDBRef($document, array $referenceMapping = null)
{
@trigger_error('The ' . __METHOD__ . ' method has been deprecated and will be removed in ODM 2.0. Use createReference() instead.', E_USER_DEPRECATED);
@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);

if (!isset($referenceMapping['storeAs'])) {
$referenceMapping['storeAs'] = ClassMetadata::REFERENCE_STORE_AS_DB_REF;
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/DocumentNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class DocumentNotFoundException extends MongoDBException
public function __construct($message = "", $code = 0, Throwable $previous = null)
{
if (self::class !== static::class) {
@trigger_error(sprintf('The class "%s" extends "%s" which will be final in MongoDB ODM 2.0.', static::class, self::class), E_USER_DEPRECATED);
@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);
}
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/DocumentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use function trigger_error;

if (! class_exists(BaseDocumentRepository::class, false)) {
@trigger_error(sprintf('The "%s" class is deprecated and will be removed in 2.0. Use "%s" instead.', DocumentRepository::class, BaseDocumentRepository::class), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" class is deprecated and will be removed in doctrine/mongodb-odm 2.0. Use "%s" instead.', DocumentRepository::class, BaseDocumentRepository::class), E_USER_DEPRECATED);
}

class_alias(BaseDocumentRepository::class, DocumentRepository::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DocumentNotFoundEventArgs extends LifecycleEventArgs
public function __construct($document, DocumentManager $dm, $identifier)
{
if (self::class !== static::class) {
@trigger_error(sprintf('The class "%s" extends "%s" which will be final in MongoDB ODM 2.0.', static::class, self::class), E_USER_DEPRECATED);
@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);
}
parent::__construct($document, $dm);
$this->identifier = $identifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class LoadClassMetadataEventArgs extends BaseLoadClassMetadataEventArgs
public function __construct(ClassMetadata $classMetadata, ObjectManager $objectManager)
{
if (self::class !== static::class) {
@trigger_error(sprintf('The class "%s" extends "%s" which will be final in MongoDB ODM 2.0.', static::class, self::class), E_USER_DEPRECATED);
@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);
}
parent::__construct($classMetadata, $objectManager);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class OnClassMetadataNotFoundEventArgs extends ManagerEventArgs
public function __construct($className, DocumentManager $dm)
{
if (self::class !== static::class) {
@trigger_error(sprintf('The class "%s" extends "%s" which will be final in MongoDB ODM 2.0.', static::class, self::class), E_USER_DEPRECATED);
@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);
}
$this->className = (string) $className;

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Event/OnClearEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class OnClearEventArgs extends BaseOnClearEventArgs
public function __construct($objectManager, $entityClass = null)
{
if (self::class !== static::class) {
@trigger_error(sprintf('The class "%s" extends "%s" which will be final in MongoDB ODM 2.0.', static::class, self::class), E_USER_DEPRECATED);
@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);
}
parent::__construct($objectManager, $entityClass);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Event/OnFlushEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class OnFlushEventArgs extends ManagerEventArgs
public function __construct(ObjectManager $objectManager)
{
if (self::class !== static::class) {
@trigger_error(sprintf('The class "%s" extends "%s" which will be final in MongoDB ODM 2.0.', static::class, self::class), E_USER_DEPRECATED);
@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);
}
parent::__construct($objectManager);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PostCollectionLoadEventArgs extends ManagerEventArgs
public function __construct(PersistentCollectionInterface $collection, DocumentManager $dm)
{
if (self::class !== static::class) {
@trigger_error(sprintf('The class "%s" extends "%s" which will be final in MongoDB ODM 2.0.', static::class, self::class), E_USER_DEPRECATED);
@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);
}
parent::__construct($dm);
$this->collection = $collection;
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Event/PostFlushEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PostFlushEventArgs extends ManagerEventArgs
public function __construct(ObjectManager $objectManager)
{
if (self::class !== static::class) {
@trigger_error(sprintf('The class "%s" extends "%s" which will be final in MongoDB ODM 2.0.', static::class, self::class), E_USER_DEPRECATED);
@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);
}
parent::__construct($objectManager);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Event/PreFlushEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PreFlushEventArgs extends ManagerEventArgs
public function __construct(ObjectManager $objectManager)
{
if (self::class !== static::class) {
@trigger_error(sprintf('The class "%s" extends "%s" which will be final in MongoDB ODM 2.0.', static::class, self::class), E_USER_DEPRECATED);
@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);
}
parent::__construct($objectManager);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Event/PreLoadEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class PreLoadEventArgs extends LifecycleEventArgs
public function __construct($document, DocumentManager $dm, array &$data)
{
if (self::class !== static::class) {
@trigger_error(sprintf('The class "%s" extends "%s" which will be final in MongoDB ODM 2.0.', static::class, self::class), E_USER_DEPRECATED);
@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);
}
parent::__construct($document, $dm);
$this->data =& $data;
Expand Down
Loading

0 comments on commit a098025

Please sign in to comment.