Skip to content

Commit 120350d

Browse files
committed
PHPLIB-75: Use package BadMethodCallException for IndexInfo
Also change "read-only" language to "immutable".
1 parent ffa8de6 commit 120350d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace MongoDB\Exception;
4+
5+
class BadMethodCallException extends \BadMethodCallException implements Exception
6+
{
7+
}

src/Model/IndexInfo.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace MongoDB\Model;
44

5+
use MongoDB\Exception\BadMethodCallException;
56
use ArrayAccess;
6-
use BadMethodCallException;
77

88
/**
99
* Index information model class.
@@ -140,21 +140,21 @@ public function offsetGet($key)
140140
* Not supported.
141141
*
142142
* @see http://php.net/arrayaccess.offsetset
143-
* @throws BadMethodCallException IndexInfo is read-only
143+
* @throws BadMethodCallException IndexInfo is immutable
144144
*/
145145
public function offsetSet($key, $value)
146146
{
147-
throw new BadMethodCallException('IndexInfo is read-only');
147+
throw new BadMethodCallException('IndexInfo is immutable');
148148
}
149149

150150
/**
151151
* Not supported.
152152
*
153153
* @see http://php.net/arrayaccess.offsetunset
154-
* @throws BadMethodCallException IndexInfo is read-only
154+
* @throws BadMethodCallException IndexInfo is immutable
155155
*/
156156
public function offsetUnset($key)
157157
{
158-
throw new BadMethodCallException('IndexInfo is read-only');
158+
throw new BadMethodCallException('IndexInfo is immutable');
159159
}
160160
}

0 commit comments

Comments
 (0)