isBlock

@param mixed $type
@param mixed $value
@return bool
359025
private function isBlock($type, $value = NULL)
    {
        return $this->_current == $type
        && (NULL === $value ? true : $this->_blocks[$this->_pos][3] == $value);
    }
550953
public function isFiltered($condition, $value, $type)
    {
        $isFiltered = true;
        switch ($condition[1]) {
        case '=':
        case '==':
        case 'equal':
            if ($type === 'string' && is_string($value) && is_string($condition[2])) {
                $isFiltered = strcmp($value, $condition[2]) == 0;
            } else {
                $isFiltered = $value == $condition[2];
            }

            break;
        case '!=':
        case 'notEqual':
            if ($type === 'string' && is_string($value) && is_string($condition[2])) {
                $isFiltered = strcmp($value, $condition[2]) != 0;
            } else {
                $isFiltered = $value != $condition[2];
            }

            break;
        case '>':
        case 'gt':
            if ($type === 'string') {
                $isFiltered = strcmp($value, $condition[2]) > 0;
            } else {
                $isFiltered = $value > $condition[2];
            }

            break;
        case '>=':
            if ($type === 'string') {
                $isFiltered = strcmp($value, $condition[2]) >= 0;
            } else {
                $isFiltered = $value >= $condition[2];
            }

            break;
        case '<':
        case 'lt':
            if ($type === 'string') {
                $isFiltered = strcmp($value, $condition[2]) < 0;
            } else {
                $isFiltered = $value < $condition[2];
            }

            break;
        case '<=':
            if ($type === 'string') {
                $isFiltered = strcmp($value, $condition[2]) <= 0;
            } else {
                $isFiltered = $value <= $condition[2];
            }

            break;
        case 'contain':
        case 'contains':
            $isFiltered = strpos(strtolower($value), strtolower($condition[2])) !== false;
            break;
        case 'notContain':
        case 'notContains':
            $isFiltered = strpos(strtolower($value), strtolower($condition[2])) === false;
            break;
        case 'startWith':
        case 'startsWith':
            $isFiltered = strpos(strtolower($value), strtolower($condition[2])) === 0;
            break;
        case 'notStartWith':
        case 'notStartsWith':
            $isFiltered = strpos(strtolower($value), strtolower($condition[2])) !== 0;
            break;
        case 'endWith':
        case 'endsWith':
            $isFiltered = strpos(strrev(strtolower($value)), strrev(strtolower($condition[2]))) === 0;
            break;
        case 'notEndWith':
        case 'notEndsWith':
            $isFiltered = strpos(strrev(strtolower($value)), strrev(strtolower($condition[2]))) !== 0;
            break;
        case 'between':
            $isFiltered = $value > $condition[2] && $value < $condition[3];
            break;
        case 'notBetween':
            $isFiltered = !($value > $condition[2] && $value < $condition[3]);
            break;
        case "in":
            if (!is_array($condition[2])) {
                $condition[2] = array($condition[2]);
            }

            $isFiltered = in_array($value, $condition[2]);
            break;
        case "notIn":
            if (!is_array($condition[2])) {
                $condition[2] = array($condition[2]);
            }

            $isFiltered = !in_array($value, $condition[2]);
            break;
        default:
            break;
        }
        return $isFiltered;
    }
961298
protected function isObjectOfSameType($type, $value)
    {
        if (false === is_object($value)) {
            return false;
        }

        return is_a($value, $type);
    }
849786
public static function isValueType($value)
    {
        if (is_scalar($value) || $value === null) {
            return true;
        } elseif (is_array($value)) {
            $isScalar = true;
            array_walk_recursive($value,
                    function ($value) use (&$isScalar) {
                        if ($isScalar && !(is_scalar($value) || $value === null)) {
                            $isScalar = false;
                        }
                    });

            return $isScalar;
        } else {
            return false;
        }
    }
1298974
public function expect(int $type, $value = null) : bool
    {
        if (!$this->accept($type, $value)) {
            $this->syntaxError('Expected '.Token::getStringRepresentation($type, $value).' got '.$this->getCurrentToken());
        }

        return true;
    }
754978
public function has($type = null)
    {
        if ($type === null) {
            return !empty($this->session[$this->prefix]);
        }

        foreach ($this->session[$this->prefix] as $message) {
            if ($message['type'] === $type) {
                return true;
            }
        }

        return false;
    }
1040290
public function nextTokenIf($type, $value = null)
    {
        if ($this->next->test($type, $value)) {
            return $this->next();
        }

        return false;
    }
723219
public function skip(int $type, $value = null) : bool
    {
        if ($this->accept($type, $value)) {
            $this->advance();

            return true;
        }

        return false;
    }
408190
public function equals($type, $value = null)
    {
        return $this->is($type) && $value === $this->value;
    }
128398
public function isIn($block): bool
    {
        if (!$block instanceof IPBlock) {
            $block = new static($block);
        }

        return $block->containsBlock($this);
    }
1162151
protected function isValid($value) {

		if(!($value instanceof PersistentResource)) {
			$this->addError('Given value is no Flow Resource', 1433344498);
		}

		$fileMimeType = $value->getMediaType();

		if(!\in_array($fileMimeType, $this->options['allowedMimeTypes'], true)) {
			$this->addError(
				'The given asset was not of type %1$s but is of type %2$s',
				1433343575,
				array(
					implode(', ', $this->options['allowedMimeTypes']),
					$fileMimeType
				)
		);
		}

	}
1213362
public static function IsDerivedSubtype( $value )
	{
		if ( $value instanceof Integer )
	        return true;

	    switch ( Type::FromValue( $value )->getTypeCode() )
	    {
	        case TypeCode::SByte:
	        case TypeCode::Int16:
	        case TypeCode::Int32:
	        case TypeCode::Int64:
	        case TypeCode::Byte:
	        case TypeCode::UInt16:
	        case TypeCode::UInt32:
	        case TypeCode::UInt64:
	            return true;

	        default:
	            return false;
	    }
	}
1210167
public boolean isBlock() {
		if (permissions != null
				&& (permissions.longValue() & SftpFileAttributes.S_IFBLK) == SftpFileAttributes.S_IFBLK) {
			return true;
		}
		return false;
	}
1114225
public function isSameTypeAs($value): bool
    {
        if (!is_array($value) && !$value instanceof Traversable) {
            return false;
        }

        foreach ($value as $key => $val) {
            if (!($this->key->isSameTypeAs($key) && $this->value->isSameTypeAs($val))) {
                return false;
            }
        }

        return true;
    }
79741
public function isBlockInStack()
    {
        $co = $this->getBlockCollectionObject();
        if (is_object($co)) {
            if ($co->getPageTypeHandle() == STACKS_PAGE_TYPE) {
                return true;
            }
        }

        return false;
    }
142546
public static function isValid($value)
    {
        if (is_string($value)) {
            $value = [ $value ];
        }
        
        if (!is_array($value) || count($value) === 0) {
            return false;
        }

        foreach ($value as $ep) {
            if (!is_string($ep)) {
                return false;
            }
            $type = self::getType($ep);

            if ($type === null) {
                return false;
            }
        }
        return true;
    }
37397
protected function isValid($value): bool
    {
        $type = gettype($value);
        switch ($type) {
            case 'string':
            case 'integer':
            case 'double':
            case 'boolean':
            case 'NULL':
                return true;
                break;
            case 'array':
                return ArrayCollection::create($value)->every(function ($v) {
                    return $this->isValid($v);
                });
                break;
            default:
                break;
        }

        return false;
    }