src/IteratorPipeline/Traits/TypeHandlingTrait.php
public function expectType($type, $error = null)
    {
        return $this->then(i\iterable_expect_type, $type, $error);
    }
public function expectType($type, $error = null)
    {
        return $this->then(i\iterable_expect_type, $type, $error);
    }
Validate that a value has a specific type.
@deprecated

@param string|string[]        $type
@param string|\Throwable|null $error
@return static