protected function isCorrectType($item)
    {
        if (is_null($this->type)) {
            return true;
        }

        if ($this->type !== 'object' && is_object($item)) {
            return $item instanceof $this->type;
        }

        return gettype($item) === $this->type;
    }