src/Collection/Traits/ItemTypeMethods.php
protected function itemTypeError(string $method, $item): string
    {
        $itemType = is_object($item) ? get_class($item) : gettype($item);

        return sprintf(
            '%s::%s expects item type (%s); received (%s) %s',
            static::class,
            $method,
            $this->itemType(),
            $itemType,
            VarPrinter::toString($item)
        );
    }
protected function itemTypeError(string $method, $item): string
    {
        $itemType = is_object($item) ? get_class($item) : gettype($item);

        return sprintf(
            '%s::%s expects item type (%s); received (%s) %s',
            static::class,
            $method,
            $this->itemType(),
            $itemType,
            VarPrinter::toString($item)
        );
    }
protected function itemTypeError ( string $ method , $ item ) : string { $ itemType = is_object ( $ item ) ? get_class ( $ item ) : gettype ( $ item ) ; return sprintf ( '%s::%s expects item type (%s); received (%s) %s' , static :: class , $ method , $ this -> itemType ( ) , $ itemType , VarPrinter :: toString ( $ item ) ) ; }
Retrieves the item type error message

@param string $method The calling method
@param mixed  $item   The item

@return string
Retrieves the item type error message