File tree Expand file tree Collapse file tree 7 files changed +18
-10
lines changed Expand file tree Collapse file tree 7 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 77use Rector \DeadCode \Rector \ClassLike \RemoveAnnotationRector ;
88use Rector \Php70 \Rector \StmtsAwareInterface \IfIssetToCoalescingRector ;
99use Rector \Php71 \Rector \FuncCall \RemoveExtraParametersRector ;
10+ use Rector \Php80 \Rector \Class_ \ClassPropertyAssignToConstructorPromotionRector ;
11+ use Rector \Php80 \Rector \Class_ \StringableForToStringRector ;
1012use Rector \Php80 \Rector \Switch_ \ChangeSwitchToMatchRector ;
1113use Rector \Renaming \Rector \Cast \RenameCastRector ;
1214use Rector \Renaming \ValueObject \RenameCast ;
1820 __DIR__ . '/tests ' ,
1921 __DIR__ . '/tools ' ,
2022 ])
21- ->withPhpSets (php74 : true )
23+ ->withPhpSets (php80 : true )
2224 ->withComposerBased (phpunit: true )
23- ->withRules ([
24- ChangeSwitchToMatchRector::class,
25- ])
2625 // All classes are public API by default, unless marked with @internal.
2726 ->withConfiguredRule (RemoveAnnotationRector::class, ['api ' ])
2827 // Fix PHP 8.5 deprecations
4241 ChangeSwitchToMatchRector::class => [
4342 __DIR__ . '/tests/SpecTests/Operation.php ' ,
4443 ],
44+ ClassPropertyAssignToConstructorPromotionRector::class,
45+ StringableForToStringRector::class => [
46+ __DIR__ . '/src/Model/IndexInput.php ' ,
47+ ],
4548 ])
4649 // phpcs:enable
4750 ->withImportNames (importNames: false , removeUnusedImports: true );
Original file line number Diff line number Diff line change 4747use MongoDB \Operation \ListDatabases ;
4848use MongoDB \Operation \Watch ;
4949use stdClass ;
50+ use Stringable ;
5051use Throwable ;
5152
5253use function array_diff_key ;
5354use function is_array ;
5455use function is_string ;
5556
56- class Client
57+ class Client implements Stringable
5758{
5859 public const DEFAULT_URI = 'mongodb://127.0.0.1/ ' ;
5960
Original file line number Diff line number Diff line change 6969use MongoDB \Operation \UpdateSearchIndex ;
7070use MongoDB \Operation \Watch ;
7171use stdClass ;
72+ use Stringable ;
7273
7374use function array_diff_key ;
7475use function array_intersect_key ;
7879use function is_bool ;
7980use function strlen ;
8081
81- class Collection
82+ class Collection implements Stringable
8283{
8384 private const DEFAULT_TYPE_MAP = [
8485 'array ' => BSONArray::class,
Original file line number Diff line number Diff line change 5151use MongoDB \Operation \RenameCollection ;
5252use MongoDB \Operation \Watch ;
5353use stdClass ;
54+ use Stringable ;
5455use Throwable ;
5556
5657use function is_array ;
5758use function is_bool ;
5859use function strlen ;
5960
60- class Database
61+ class Database implements Stringable
6162{
6263 private const DEFAULT_TYPE_MAP = [
6364 'array ' => BSONArray::class,
Original file line number Diff line number Diff line change 1919
2020use ArrayAccess ;
2121use MongoDB \Exception \BadMethodCallException ;
22+ use Stringable ;
2223
2324use function array_key_exists ;
2425use function array_search ;
3839 * @see https://mongodb.com/docs/manual/reference/method/db.collection.createIndex/
3940 * @template-implements ArrayAccess<string, mixed>
4041 */
41- class IndexInfo implements ArrayAccess
42+ class IndexInfo implements ArrayAccess, Stringable
4243{
4344 /** @param array $info Index info */
4445 public function __construct (private array $ info )
Original file line number Diff line number Diff line change 2020use MongoDB \BSON \Serializable ;
2121use MongoDB \Exception \InvalidArgumentException ;
2222use stdClass ;
23+ use Stringable ;
2324
2425use function is_float ;
2526use function is_int ;
3839 * @see https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.md
3940 * @see https://mongodb.com/docs/manual/reference/method/db.collection.createIndex/
4041 */
41- final class IndexInput implements Serializable
42+ final class IndexInput implements Serializable, Stringable
4243{
4344 /**
4445 * @param array $index Index specification
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class BSONIteratorTest extends TestCase
1919 #[DataProvider('provideTypeMapOptionsAndExpectedDocuments ' )]
2020 public function testValidValues (?array $ typeMap , array $ expectedDocuments ): void
2121 {
22- $ binaryString = implode (array_map (
22+ $ binaryString = implode ('' , array_map (
2323 fn ($ input ) => (string ) Document::fromPHP ($ input ),
2424 [
2525 ['_id ' => 1 , 'x ' => ['foo ' => 'bar ' ]],
You can’t perform that action at this time.
0 commit comments