Skip to content

Commit 66f76dd

Browse files
committed
Mark other exception factories as internal
1 parent edcbc58 commit 66f76dd

File tree

6 files changed

+21
-1
lines changed

6 files changed

+21
-1
lines changed

src/Exception/BadMethodCallException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class BadMethodCallException extends BaseBadMethodCallException implements Excep
2828
*
2929
* @param string $class Class name
3030
* @return self
31+
* @internal
3132
*/
3233
public static function classIsImmutable(string $class)
3334
{
@@ -39,6 +40,7 @@ public static function classIsImmutable(string $class)
3940
*
4041
* @param string $method Method name
4142
* @return self
43+
* @internal
4244
*/
4345
public static function unacknowledgedWriteResultAccess(string $method)
4446
{

src/Exception/InvalidArgumentException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
class InvalidArgumentException extends DriverInvalidArgumentException implements Exception
3131
{
32+
/** @internal */
3233
public static function cannotCombineCodecAndTypeMap(): self
3334
{
3435
return new self('Cannot provide both "codec" and "typeMap" options');
@@ -39,6 +40,7 @@ public static function cannotCombineCodecAndTypeMap(): self
3940
*
4041
* @param string $name Name of the argument or option
4142
* @param mixed $value Actual value (used to derive the type)
43+
* @internal
4244
*/
4345
public static function expectedDocumentType(string $name, mixed $value): self
4446
{
@@ -52,6 +54,7 @@ public static function expectedDocumentType(string $name, mixed $value): self
5254
* @param mixed $value Actual value (used to derive the type)
5355
* @param string|list<string> $expectedType Expected type as a string or an array containing one or more strings
5456
* @return self
57+
* @internal
5558
*/
5659
public static function invalidType(string $name, mixed $value, string|array $expectedType)
5760
{

src/Exception/ResumeTokenException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class ResumeTokenException extends RuntimeException
2727
*
2828
* @param mixed $value Actual value (used to derive the type)
2929
* @return self
30+
* @internal
3031
*/
3132
public static function invalidType(mixed $value)
3233
{
@@ -37,6 +38,7 @@ public static function invalidType(mixed $value)
3738
* Thrown when a resume token is not found in a change document.
3839
*
3940
* @return self
41+
* @internal
4042
*/
4143
public static function notFound()
4244
{

src/GridFS/Exception/CorruptFileException.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class CorruptFileException extends RuntimeException
2525
{
2626
/**
2727
* Thrown when a chunk doesn't contain valid data.
28+
*
29+
* @internal
2830
*/
2931
public static function invalidChunkData(int $chunkIndex): self
3032
{
@@ -36,6 +38,7 @@ public static function invalidChunkData(int $chunkIndex): self
3638
*
3739
* @param integer $expectedIndex Expected index number
3840
* @return self
41+
* @internal
3942
*/
4043
public static function missingChunk(int $expectedIndex)
4144
{
@@ -48,6 +51,7 @@ public static function missingChunk(int $expectedIndex)
4851
* @param integer $index Actual index number (i.e. "n" field)
4952
* @param integer $expectedIndex Expected index number
5053
* @return self
54+
* @internal
5155
*/
5256
public static function unexpectedIndex(int $index, int $expectedIndex)
5357
{
@@ -60,6 +64,7 @@ public static function unexpectedIndex(int $index, int $expectedIndex)
6064
* @param integer $size Actual size (i.e. "data" field length)
6165
* @param integer $expectedSize Expected size
6266
* @return self
67+
* @internal
6368
*/
6469
public static function unexpectedSize(int $size, int $expectedSize)
6570
{

src/GridFS/Exception/FileNotFoundException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class FileNotFoundException extends RuntimeException
2929
*
3030
* @param string $filename Filename
3131
* @return self
32+
* @internal
3233
*/
3334
public static function byFilename(string $filename)
3435
{
@@ -42,6 +43,7 @@ public static function byFilename(string $filename)
4243
* @param integer $revision Revision
4344
* @param string $namespace Namespace for the files collection
4445
* @return self
46+
* @internal
4547
*/
4648
public static function byFilenameAndRevision(string $filename, int $revision, string $namespace)
4749
{
@@ -54,6 +56,7 @@ public static function byFilenameAndRevision(string $filename, int $revision, st
5456
* @param mixed $id File ID
5557
* @param string $namespace Namespace for the files collection
5658
* @return self
59+
* @internal
5760
*/
5861
public static function byId(mixed $id, string $namespace)
5962
{

src/GridFS/Exception/StreamException.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class StreamException extends RuntimeException
1313
/**
1414
* @param resource $source
1515
* @param resource $destination
16+
* @internal
1617
*/
1718
public static function downloadFromFilenameFailed(string $filename, $source, $destination): self
1819
{
@@ -25,6 +26,7 @@ public static function downloadFromFilenameFailed(string $filename, $source, $de
2526
/**
2627
* @param resource $source
2728
* @param resource $destination
29+
* @internal
2830
*/
2931
public static function downloadFromIdFailed(mixed $id, $source, $destination): self
3032
{
@@ -35,7 +37,10 @@ public static function downloadFromIdFailed(mixed $id, $source, $destination): s
3537
return new self(sprintf('Downloading file from "%s" to "%s" failed. GridFS identifier: "%s"', $sourceMetadata['uri'], $destinationMetadata['uri'], $idString));
3638
}
3739

38-
/** @param resource $source */
40+
/**
41+
* @param resource $source
42+
* @internal
43+
*/
3944
public static function uploadFailed(string $filename, $source, string $destinationUri): self
4045
{
4146
$sourceMetadata = stream_get_meta_data($source);

0 commit comments

Comments
 (0)