@param array $array
@param int   $maxSize
@param int   $minSize

@throws \Kerox\Messenger\Exception\InvalidArrayException
514884
protected function isValidArray(array $array, int $maxSize, ?int $minSize = null): void
    {
        $countArray = \count($array);
        if ($minSize !== null && $countArray < $minSize) {
            throw new InvalidArrayException(sprintf('The minimum number of items for this array is %d.', $minSize));
        }
        if ($countArray > $maxSize) {
            throw new InvalidArrayException(sprintf('The maximum number of items for this array is %d.', $maxSize));
        }
    }
1055075
public static function size($val, $min = null, $max = null): bool
    {
        if (!\is_int($val)) {
            if (\is_string($val)) {
                $val = Helper::strlen(\trim($val));
            } elseif (\is_array($val)) {
                $val = \count($val);
            } else {
                return false;
            }
        }

        return self::integer($val, $min, $max);
    }
171207
protected function enrichFrequentSearchesInfo(array $frequentSearchTerms, $minimumSize, $maximumSize)
    {
        $frequentSearches = [];
        if (count($frequentSearchTerms)) {
            $maximumHits = max(array_values($frequentSearchTerms));
            $minimumHits = min(array_values($frequentSearchTerms));
            $spread = $maximumHits - $minimumHits;
            $step = ($spread == 0) ? 1 : ($maximumSize - $minimumSize) / $spread;

            foreach ($frequentSearchTerms as $term => $hits) {
                $size = round($minimumSize + (($hits - $minimumHits) * $step));
                $frequentSearches[] = ['q' => htmlspecialchars_decode($term), 'hits' => $hits, 'style' => 'font-size: ' . $size . 'px', 'class' => 'tx-solr-frequent-term-' . $size, 'size' => $size];
            }
        }

        return $frequentSearches;
    }
65294
private void expandArray(int maxSize)
    {
        int curSize = getBaseArraySize();
        if (curSize > maxSize)
        {
            return;
        }
        if (maxSize >= LEAF_BIT)
        {
            throw new RuntimeException("Double Array Trie size exceeds absolute threshold");
        }
        for (int i = curSize; i <= maxSize; ++i)
        {
            this.base.append(0);
            this.check.append(0);
            addFreeLink(i);
        }
    }
1203782
void resizeArray(int newArraySize) {
		long[] newArray = new long[newArraySize];
		System.arraycopy(this.arrayOfBits, 0, newArray, 0,
				Math.min(this.arrayOfBits.length, newArraySize));
		this.arrayOfBits = newArray;
	}
351960
public function setFontSize($min, $max = null) {

		if(false === ('-' . intval($min) == '-' . $min)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($min)), E_USER_ERROR);
		}

		if(null !== $max && false === ('-' . intval($max) == '-' . $max)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($max)), E_USER_ERROR);
		}

		$this -> fontsize = ['min' => $min, 'max' => ($max !== null ? $max : $min)];

		return $this;
	}
1032295
public function copyFromArray(array &$array)
    {
        parent::copyFromArray($array);

        // action
        $this->setAction(
            TokenAction::valueOf(
                LanguageUtility::getFromArray('action', $array)));

        // responseContent
        $this->setResponseContent(
            LanguageUtility::getFromArray('responseContent', $array));

        // username
        $this->setUsername(
            LanguageUtility::getFromArray('username', $array));

        // password
        $this->setPassword(
            LanguageUtility::getFromArray('password', $array));

        // ticket
        $this->setTicket(
            LanguageUtility::getFromArray('ticket', $array));

        // accessToken
        $this->setAccessToken(
            LanguageUtility::getFromArray('accessToken', $array));

        // accessTokenExpiresAt
        $this->setAccessTokenExpiresAt(
            LanguageUtility::getFromArray('accessTokenExpiresAt', $array));

        // accessTokenDuration
        $this->setAccessTokenDuration(
            LanguageUtility::getFromArray('accessTokenDuration', $array));

        // refreshToken
        $this->setRefreshToken(
            LanguageUtility::getFromArray('refreshToken', $array));

        // refreshTokenExpiresAt
        $this->setRefreshTokenExpiresAt(
            LanguageUtility::getFromArray('refreshTokenExpiresAt', $array));

        // refreshTokenDuration
        $this->setRefreshTokenDuration(
            LanguageUtility::getFromArray('refreshTokenDuration', $array));

        // idToken
        $this->setIdToken(
            LanguageUtility::getFromArray('idToken', $array));

        // grantType
        $this->setGrantType(
            GrantType::valueOf(
                LanguageUtility::getFromArray('grantType', $array)));

        // clientId
        $this->setClientId(
            LanguageUtility::getFromArray('clientId', $array));

        // clientIdAlias
        $this->setClientIdAlias(
            LanguageUtility::getFromArray('clientIdAlias', $array));

        // clientIdAliasUsed
        $this->setClientIdAliasUsed(
            LanguageUtility::getFromArrayAsBoolean('clientIdAlias', $array));

        // subject
        $this->setSubject(
            LanguageUtility::getFromArray('subject', $array));

        // scopes
        $this->setScopes(
            LanguageUtility::getFromArray('scopes', $array));

        // properties
        $properties = LanguageUtility::getFromArray('properties', $array);
        $this->setProperties(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $properties, __NAMESPACE__ . '\Property'));
    }
277621
public void setDimension(double min, double max) {
        this.minx = min;
        this.maxx = max;
        this.miny = min;
        this.maxy = max;
        this.minz = min;
        this.maxz = max;
    }
823731
public void init(String st, int minsize, int maxsize) {
        super.init(check(st), minsize, maxsize);
    }
361128
@SuppressWarnings("unchecked")
  protected final void initialize(int maxSize) {
    size = 0;
    int heapSize = maxSize + 1;
    heap = (T[]) new Object[heapSize];
    this.maxSize = maxSize;
  }
904712
public function setLevel($min = null, $max = null)
    {
        // Null for default allows easier calling to set
        // a maximum level only
        if (!$min || !Logger::isLogLevel($min)) {
            $min = LogLevel::DEBUG;
        }

        if (!$max || !Logger::isLogLevel($max)) {
            $max = LogLevel::EMERGENCY;
        }

        $this->minimumLevel = Logger::$levels[$min];
        $this->maximumLevel = Logger::$levels[$max];
    }
1035717
public void setMaxSize(long maxSize) {
		// if the new maxSize is <= 0, clear keyLRUList
		if (maxSize <= 0) {
			keyLRUList.clear();
		} else if (maxSize > 0 && this.maxSize <= 0) {
			// if the new maxSize > 0 and the old is <= 0, fill in LRU list -
			// order will be meaningless for now
			Iterator keys = cacheLineTable.keySet().iterator();

			while (keys.hasNext()) {
				keyLRUList.add(keys.next());
			}
		}

		// if the new maxSize is less than the current cache size, shrink the
		// cache.
		if (maxSize > 0 && cacheLineTable.size() > maxSize) {
			while (cacheLineTable.size() > maxSize) {
				Object lastKey = keyLRUList.getLast();

				removeObject(lastKey);
			}
		}

		this.maxSize = maxSize;
	}
579589
public function setRange($min, $max)
	{
		$min = filter_var($min, FILTER_VALIDATE_INT);
		$max = filter_var($max, FILTER_VALIDATE_INT);

		if ($min === false)
		{
			throw new InvalidArgumentException('Argument 1 passed to ' . __METHOD__ . ' must be an integer');
		}

		if ($max === false)
		{
			throw new InvalidArgumentException('Argument 2 passed to ' . __METHOD__ . ' must be an integer');
		}

		if ($min > $max)
		{
			throw new InvalidArgumentException('Invalid range: min (' . $min . ') > max (' . $max . ')');
		}

		$this->vars['min'] = $min;
		$this->vars['max'] = $max;
	}
1311737
public function copyFromArray(array &$array)
    {
        parent::copyFromArray($array);

        // action
        $this->setAction(
            TokenIssueAction::valueOf(
                LanguageUtility::getFromArray('action', $array)));

        // responseContent
        $this->setResponseContent(
            LanguageUtility::getFromArray('responseContent', $array));

        // accessToken
        $this->setAccessToken(
            LanguageUtility::getFromArray('accessToken', $array));

        // accessTokenExpiresAt
        $this->setAccessTokenExpiresAt(
            LanguageUtility::getFromArray('accessTokenExpiresAt', $array));

        // accessTokenDuration
        $this->setAccessTokenDuration(
            LanguageUtility::getFromArray('accessTokenDuration', $array));

        // refreshToken
        $this->setRefreshToken(
            LanguageUtility::getFromArray('refreshToken', $array));

        // refreshTokenExpiresAt
        $this->setRefreshTokenExpiresAt(
            LanguageUtility::getFromArray('refreshTokenExpiresAt', $array));

        // refreshTokenDuration
        $this->setRefreshTokenDuration(
            LanguageUtility::getFromArray('refreshTokenDuration', $array));

        // clientId
        $this->setClientId(
            LanguageUtility::getFromArray('clientId', $array));

        // clientIdAlias
        $this->setClientIdAlias(
            LanguageUtility::getFromArray('clientIdAlias', $array));

        // subject
        $this->setSubject(
            LanguageUtility::getFromArray('subject', $array));

        // scopes
        $this->setScopes(
            LanguageUtility::getFromArray('scopes', $array));

        // properties
        $properties = LanguageUtility::getFromArray('properties', $array);
        $this->setProperties(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $properties, __NAMESPACE__ . '\Property'));
    }
501373
protected function sizeMin($key, $lengthValue, $min, $not = true)
    {
        if ($lengthValue < $min && $not) {
            $this->addReturn($key, 'must', [ ':min' => $min ]);
        } elseif (!($lengthValue < $min) && !$not) {
            $this->addReturn($key, 'not', [ ':min' => $min ]);
        }
    }
348416
private void ensureCapacity(int minCapacity) {
		long currentCapacity = data.length;

		if (minCapacity <= currentCapacity) {
			return;
		}

		// increase capacity by at least ~50%
		long expandedCapacity = Math.max(minCapacity, currentCapacity + (currentCapacity >> 1));
		int newCapacity = (int) Math.min(MAX_ARRAY_SIZE, expandedCapacity);

		if (newCapacity < minCapacity) {
			// throw exception as unbounded arrays are not expected to fill
			throw new RuntimeException("Requested array size " + minCapacity + " exceeds limit of " + MAX_ARRAY_SIZE);
		}

		data = Arrays.copyOf(data, newCapacity);
	}
867297
public static function int($min, $max)
    {
        $int = self::php7Int($min, $max);
        if (! isset($int)) {
            $int = self::bytesToInt($min, $max);
        }
        return $int;
    }