File tree Expand file tree Collapse file tree 3 files changed +1
-66
lines changed Expand file tree Collapse file tree 3 files changed +1
-66
lines changed Original file line number Diff line number Diff line change @@ -15,18 +15,10 @@ class NonStringableObject extends LogicException implements ExceptionInterface
15
15
ERROR;
16
16
17
17
/**
18
- * @param object $object
19
- *
20
18
* @return NonStringableObject
21
- *
22
- * @throws TypeError
23
19
*/
24
- public static function fromAttemptedToString ($ object ) : self
20
+ public static function fromAttemptedToString (object $ object ) : self
25
21
{
26
- if (! is_object ($ object )) {
27
- throw TypeError::fromNonObject ($ object );
28
- }
29
-
30
22
$ className = get_class ($ object );
31
23
32
24
return new self (sprintf (
Original file line number Diff line number Diff line change @@ -47,33 +47,4 @@ public function objectProvider() : array
47
47
[$ this ],
48
48
];
49
49
}
50
-
51
- /**
52
- * @dataProvider nonObjectProvider
53
- *
54
- * @param mixed $nonObject
55
- */
56
- public function testWillThrowOnNonObject ($ nonObject ) : void
57
- {
58
- $ this ->expectException (TypeError::class);
59
-
60
- NonCallableObject::fromAttemptedCall ($ nonObject , 'propertyName ' );
61
- }
62
-
63
- /**
64
- * @return mixed[][]
65
- */
66
- public function nonObjectProvider () : array
67
- {
68
- return [
69
- [null ],
70
- [true ],
71
- [123 ],
72
- [12.3 ],
73
- ['foo ' ],
74
- [[]],
75
- [STDERR ],
76
- ];
77
- }
78
-
79
50
}
Original file line number Diff line number Diff line change @@ -47,32 +47,4 @@ public function objectProvider() : array
47
47
[$ this ],
48
48
];
49
49
}
50
-
51
- /**
52
- * @dataProvider nonObjectProvider
53
- *
54
- * @param mixed $nonObject
55
- */
56
- public function testWillThrowOnNonObject ($ nonObject ) : void
57
- {
58
- $ this ->expectException (TypeError::class);
59
-
60
- NonStringableObject::fromAttemptedToString ($ nonObject );
61
- }
62
-
63
- /**
64
- * @return mixed[][]
65
- */
66
- public function nonObjectProvider () : array
67
- {
68
- return [
69
- [null ],
70
- [true ],
71
- [123 ],
72
- [12.3 ],
73
- ['foo ' ],
74
- [[]],
75
- [STDERR ],
76
- ];
77
- }
78
50
}
You can’t perform that action at this time.
0 commit comments