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 7
7
use Rector \DeadCode \Rector \ClassLike \RemoveAnnotationRector ;
8
8
use Rector \Php70 \Rector \StmtsAwareInterface \IfIssetToCoalescingRector ;
9
9
use Rector \Php71 \Rector \FuncCall \RemoveExtraParametersRector ;
10
+ use Rector \Php80 \Rector \Class_ \ClassPropertyAssignToConstructorPromotionRector ;
11
+ use Rector \Php80 \Rector \Class_ \StringableForToStringRector ;
10
12
use Rector \Php80 \Rector \Switch_ \ChangeSwitchToMatchRector ;
11
13
use Rector \Renaming \Rector \Cast \RenameCastRector ;
12
14
use Rector \Renaming \ValueObject \RenameCast ;
18
20
__DIR__ . '/tests ' ,
19
21
__DIR__ . '/tools ' ,
20
22
])
21
- ->withPhpSets (php74 : true )
23
+ ->withPhpSets (php80 : true )
22
24
->withComposerBased (phpunit: true )
23
- ->withRules ([
24
- ChangeSwitchToMatchRector::class,
25
- ])
26
25
// All classes are public API by default, unless marked with @internal.
27
26
->withConfiguredRule (RemoveAnnotationRector::class, ['api ' ])
28
27
// Fix PHP 8.5 deprecations
42
41
ChangeSwitchToMatchRector::class => [
43
42
__DIR__ . '/tests/SpecTests/Operation.php ' ,
44
43
],
44
+ ClassPropertyAssignToConstructorPromotionRector::class,
45
+ StringableForToStringRector::class => [
46
+ __DIR__ . '/src/Model/IndexInput.php ' ,
47
+ ],
45
48
])
46
49
// phpcs:enable
47
50
->withImportNames (importNames: false , removeUnusedImports: true );
Original file line number Diff line number Diff line change 47
47
use MongoDB \Operation \ListDatabases ;
48
48
use MongoDB \Operation \Watch ;
49
49
use stdClass ;
50
+ use Stringable ;
50
51
use Throwable ;
51
52
52
53
use function array_diff_key ;
53
54
use function is_array ;
54
55
use function is_string ;
55
56
56
- class Client
57
+ class Client implements Stringable
57
58
{
58
59
public const DEFAULT_URI = 'mongodb://127.0.0.1/ ' ;
59
60
Original file line number Diff line number Diff line change 69
69
use MongoDB \Operation \UpdateSearchIndex ;
70
70
use MongoDB \Operation \Watch ;
71
71
use stdClass ;
72
+ use Stringable ;
72
73
73
74
use function array_diff_key ;
74
75
use function array_intersect_key ;
78
79
use function is_bool ;
79
80
use function strlen ;
80
81
81
- class Collection
82
+ class Collection implements Stringable
82
83
{
83
84
private const DEFAULT_TYPE_MAP = [
84
85
'array ' => BSONArray::class,
Original file line number Diff line number Diff line change 51
51
use MongoDB \Operation \RenameCollection ;
52
52
use MongoDB \Operation \Watch ;
53
53
use stdClass ;
54
+ use Stringable ;
54
55
use Throwable ;
55
56
56
57
use function is_array ;
57
58
use function is_bool ;
58
59
use function strlen ;
59
60
60
- class Database
61
+ class Database implements Stringable
61
62
{
62
63
private const DEFAULT_TYPE_MAP = [
63
64
'array ' => BSONArray::class,
Original file line number Diff line number Diff line change 19
19
20
20
use ArrayAccess ;
21
21
use MongoDB \Exception \BadMethodCallException ;
22
+ use Stringable ;
22
23
23
24
use function array_key_exists ;
24
25
use function array_search ;
38
39
* @see https://mongodb.com/docs/manual/reference/method/db.collection.createIndex/
39
40
* @template-implements ArrayAccess<string, mixed>
40
41
*/
41
- class IndexInfo implements ArrayAccess
42
+ class IndexInfo implements ArrayAccess, Stringable
42
43
{
43
44
/** @param array $info Index info */
44
45
public function __construct (private array $ info )
Original file line number Diff line number Diff line change 20
20
use MongoDB \BSON \Serializable ;
21
21
use MongoDB \Exception \InvalidArgumentException ;
22
22
use stdClass ;
23
+ use Stringable ;
23
24
24
25
use function is_float ;
25
26
use function is_int ;
38
39
* @see https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.md
39
40
* @see https://mongodb.com/docs/manual/reference/method/db.collection.createIndex/
40
41
*/
41
- final class IndexInput implements Serializable
42
+ final class IndexInput implements Serializable, Stringable
42
43
{
43
44
/**
44
45
* @param array $index Index specification
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class BSONIteratorTest extends TestCase
19
19
#[DataProvider('provideTypeMapOptionsAndExpectedDocuments ' )]
20
20
public function testValidValues (?array $ typeMap , array $ expectedDocuments ): void
21
21
{
22
- $ binaryString = implode (array_map (
22
+ $ binaryString = implode ('' , array_map (
23
23
fn ($ input ) => (string ) Document::fromPHP ($ input ),
24
24
[
25
25
['_id ' => 1 , 'x ' => ['foo ' => 'bar ' ]],
You can’t perform that action at this time.
0 commit comments