@param $number

@return bool
166011
public static function isPrime($number): bool
    {
        preg_match('/^1?$|^(11+?)\1+$/', implode(1, array_fill(0, $number, null)), $matches);

        return isset($matches[1]);
    }
1180974
private static function valid_checksum($number)
  {
      $map = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 4, 6, 8, 1, 3, 5, 7, 9);
      $sum = 0;
      $last = strlen($number) - 1;
      for ($i = 0; $i <= $last; ++$i) {
          $sum += $map[$number[$last - $i] + ($i & 1) * 10];
      }

      return ($sum % 10 == 0);
  }
1352609
public function question_number($number) {
        if (is_numeric($number)) {
            $number = html_writer::span(get_string('question'), 'accesshide') . ' ' . $number;
        }
        return html_writer::tag('span', $number, array('class' => 'slotnumber'));
    }
1669
public function isInteger($number, int $min = null, int $max = null): bool
    {
        return isset($min) || isset($max)
            ? filter_var($number, FILTER_VALIDATE_INT, $this->getIntegerOptionsBetween($min, $max))
            : filter_var($number, FILTER_VALIDATE_INT);
    }
48326
function internalNumber( $number )
    {
        if ( preg_match( '/^(['.$this->PositiveSymbol.']|['.$this->NegativeSymbol.'])?([0-9]*|[0-9]{1,3}(['.$this->ThousandsSeparator.'][0-9]{3,3})*)(['.$this->DecimalSymbol.'][0-9]+)?$/', trim( $number ) ) )
        {
            $number = str_replace( ' ', '', $number );
            if ( $this->PositiveSymbol )
                $number = str_replace( $this->PositiveSymbol, '', $number );
            $number = str_replace( $this->NegativeSymbol, '-', $number );
            $number = str_replace( $this->ThousandsSeparator, '', $number );
            $number = str_replace( $this->DecimalSymbol, '.', $number );
        }
        return $number;
    }
550487
public function setNumber($number)
    {
        if (!is_numeric($number) && $number != null)
        {
            throw new InvalidArgumentException("Number is not numeric.");
        }
        $this->number = preg_replace('/\D/', '', $number);
    }
1168252
private static function checksum(string $number) : int
    {
        $number = strrev($number);
        $length = strlen($number);

        $sum = 0;

        for ($i = 0; $i < $length; $i++) {
            $value = $number[$i] * ($i % 2 + 1);
            $sum += ($value >= 10 ? $value - 9 : $value);
        }

        return $sum % 10;
    }
1240179
public function setNumber($number)
    {
        $this->number = $number;
        $this->factors = $this->getFactors($this->getNumber());
    }
1044321
private static function getNum125($number) {
		/** @var int $result */
		/** @var int $n100 */
		$n100 = $number % 100;
		/** @var int $n100 */
		$n10 = $number % 10;
		if (($n100 > 10) && ($n100 < 20)) {
			$result = self::NUMBER_FORM_5;
		}
		else if ($n10 === 1) {
			$result = self::NUMBER_FORM_1;
		}
		else if (($n10 >= 2) && ($n10 <= 4)) {
			$result = self::NUMBER_FORM_2;
		}
		else {
			$result = self::NUMBER_FORM_5;
		}
		return $result;
	}
927103
function formatNumber( $number )
    {
        $neg = $number < 0;
        $num = $neg ? -$number : $number;
        $text = number_format( $num, $this->FractDigits, $this->DecimalSymbol, $this->ThousandsSeparator );
        return ( $neg ? $this->NegativeSymbol : $this->PositiveSymbol ) . $text;
    }
76075
protected static function validateInputNumber($number)
    {
        if ($number instanceof static) {
            return $number->getNumber();
        }

        $number = trim($number);
        if (!static::isNumber($number)) {
            throw new \InvalidArgumentException('Argument number is not valid');
        }

        return $number;
    }
242049
public function revokeNumberAsyncWithHttpInfo($number)
    {
        $returnType = '';
        $request = $this->revokeNumberRequest($number);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
385618
public function lookupTimeZonesForNumber(PhoneNumber $number)
    {
        $phonePrefix = $number->getCountryCode() . PhoneNumberUtil::getInstance()->getNationalSignificantNumber(
                $number
            );

        return $this->lookupTimeZonesForNumberKey($phonePrefix);
    }
705925
public function Compare( $number, $scale = false )
	{
		if ( ! is_numeric( $number ) )
		{
			if ( ! $number instanceof DecimalValue && ! $number instanceof Integer )
			{
				return false;
			}

			$number = $number->getValue();
		}

		if ( $scale === false )
		{
			$scale = max( $this->getScale(), $this->scale( $number ) );
		}

		return bccomp( $this->_value, $number, $scale );
	}
1166204
public function setNumber($number)
    {
        if (!is_string($number) && !is_null($number)) {
            throw new \InvalidArgumentException(__CLASS__ . ' ' . __METHOD__ . ': Not a string');
        }

        $this->number = $number;

        return $this;
    }
1026010
public function setNumber($number)
    {
      if(!is_string($number) || strlen(trim($number)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid number, must be a non empty string');

      $this->number = $number;
    }
252644
public static function ordinal($number)
    {
        $test_c = abs($number) % 10;
        $ext = ((abs($number) % 100 < 21 && abs($number) % 100 > 4) ? 'th' : (($test_c < 4) ? ($test_c < 3) ? ($test_c < 2) ? ($test_c < 1) ? 'th' : 'st' : 'nd' : 'rd' : 'th'));

        return $number . $ext;
    }