Skip to content

Commit e1735f8

Browse files
committed
remove nonobject provider
1 parent a30b8c6 commit e1735f8

File tree

3 files changed

+1
-66
lines changed

3 files changed

+1
-66
lines changed

src/Dont/Exception/NonStringableObject.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,10 @@ class NonStringableObject extends LogicException implements ExceptionInterface
1515
ERROR;
1616

1717
/**
18-
* @param object $object
19-
*
2018
* @return NonStringableObject
21-
*
22-
* @throws TypeError
2319
*/
24-
public static function fromAttemptedToString($object) : self
20+
public static function fromAttemptedToString(object $object) : self
2521
{
26-
if (! is_object($object)) {
27-
throw TypeError::fromNonObject($object);
28-
}
29-
3022
$className = get_class($object);
3123

3224
return new self(sprintf(

tests/DontTest/Exception/NonCallableObjectTest.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,33 +47,4 @@ public function objectProvider() : array
4747
[$this],
4848
];
4949
}
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-
7950
}

tests/DontTest/Exception/NonStringableObjectTest.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,4 @@ public function objectProvider() : array
4747
[$this],
4848
];
4949
}
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-
}
7850
}

0 commit comments

Comments
 (0)