Skip to content

Commit 42ef726

Browse files
committed
PHPLIB-499: Deprecate IndexInfo::getNamespace
1 parent 22db448 commit 42ef726

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Model/IndexInfo.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
use MongoDB\Exception\BadMethodCallException;
2222
use function array_key_exists;
2323
use function array_search;
24+
use function sprintf;
25+
use function trigger_error;
2426

2527
/**
2628
* Index information model class.
@@ -95,9 +97,12 @@ public function getName()
9597
* Return the index namespace (e.g. "db.collection").
9698
*
9799
* @return string
100+
* @deprecated Deprecated in 1.7.0
98101
*/
99102
public function getNamespace()
100103
{
104+
@trigger_error(sprintf('The "%s" method is deprecated since mongodb/mongodb 1.7 and will be dropped in 2.0.', __METHOD__));
105+
101106
return (string) $this->info['ns'];
102107
}
103108

0 commit comments

Comments
 (0)