Skip to content

Commit 8e71976

Browse files
committed
missing mixed parameter types
1 parent b3017ba commit 8e71976

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ObjectAsserter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function property($name, $matcher = null): self
9090
/**
9191
* @param Matcher|mixed $matcher use a Matchers:: matcher to check against the value of the property. If this is a string equalTo() is assumed
9292
*/
93-
public function is($matcher): self
93+
public function is(mixed $matcher): self
9494
{
9595
$matcher = $this->castMatcher($matcher);
9696

@@ -288,7 +288,7 @@ private function assertThat(string $messagePart, mixed $value, Matcher $matcher)
288288
* @param Matcher|mixed $matcher
289289
* @return Matcher
290290
*/
291-
protected function castMatcher($matcher): Matcher
291+
protected function castMatcher(mixed $matcher): Matcher
292292
{
293293
if ($matcher instanceof \PHPUnit\Framework\Constraint\Constraint) {
294294
throw new InvalidArgumentException('Hey there, sorry that you are still stuck with phpunit. Please use hamcrest matchers. Used: ' . get_class($matcher));
@@ -308,7 +308,7 @@ protected function castMatcher($matcher): Matcher
308308
* @param Matcher|mixed $matcher
309309
* @param string[] $indexes
310310
*/
311-
public function properties(array $indexes, $matcher): self
311+
public function properties(array $indexes, mixed $matcher): self
312312
{
313313
$matcher = $this->castMatcher($matcher);
314314

@@ -326,8 +326,8 @@ public function equals8601Date(\DateTimeInterface $expected): self
326326
$this->object,
327327
Matchers::isNonEmptyString()
328328
);
329+
assert(is_string($this->object), 'phpstan does not interpret the Hamcrest matcher before correctly');
329330

330-
assert(is_string($this->object));
331331
$date = \DateTime::createFromFormat('Y-m-d', $this->object);
332332

333333
if ($date === false) {

0 commit comments

Comments
 (0)