Take the Type of the Downloads (total, monthly or daily).

@param string $type

@return string
514682
public function getPackageDownloads($type)
    {
        $statsType = 'get' . ucfirst($type);
        if (($download = $this->getDownloads()) && $download instanceof \Packagist\Api\Result\Package\Downloads) {
            return $download->{$statsType}();
        }
    }
355795
protected function getPhpType(Type $type): string
    {
        switch ($builtinType = $type->getBuiltinType()) {
            case Type::BUILTIN_TYPE_ARRAY:
            case Type::BUILTIN_TYPE_INT:
            case Type::BUILTIN_TYPE_FLOAT:
            case Type::BUILTIN_TYPE_BOOL:
            case Type::BUILTIN_TYPE_STRING:
                return $builtinType;
            case Type::BUILTIN_TYPE_OBJECT:
                if (null !== ($className = $type->getClassName()) && is_a($className, \DateTimeInterface::class, true)) {
                    return \DateTimeInterface::class;
                }

            // no break
            default:
                return 'string';
        }
    }
528208
public function getType($type)
    {
        $aliases = array(
            'int'    => 'integer',
            'bool'   => 'boolean',
            'double' => 'float',
            'object' => '\\stdClass'
        );
        $default = array(
            'integer', 'boolean', 'float', '\\stdClass', 'callable', 'string', 'resource', 'void', 'mixed'
        );
        $typeHintEnabled = false;

        if (isset($aliases[$type])) {
            $type = $aliases[$type];
        }

        if (!in_array($type, $default)) {
            $typeHintEnabled = true;
        }

        return array(
            'name' => $type,
            'hint' => $typeHintEnabled
        );
    }
743531
public function get($type)
    {
        if ($type != 'request_token' && $type != 'access_token') {
            throw new \Dropbox\Exception("Expected a type of either 'request_token' or 'access_token', got '$type'");
        } else {
            if (isset($_SESSION[$this->namespace][$this->userID][$type])) {
                $token = $this->decrypt($_SESSION[$this->namespace][$this->userID][$type]);
                return $token;
            }
            return false;
        }
    }
629994
public function isOfType($type)
    {
        $types = static::parseTypes($type);

        // Add the unsure type when applicable.
        if (array_intersect([PhoneNumberType::FIXED_LINE, PhoneNumberType::MOBILE], $types)) {
            $types[] = PhoneNumberType::FIXED_LINE_OR_MOBILE;
        }

        return in_array($this->getType(true), $types, true);
    }
359806
public function sampleData($type)
    {
        switch (strtolower($type)) {
            case 'boolean':
                return 'false';
            case 'integer':
            case 'double':
            case 'int':
                return rand();
            case 'tinyint':
                return rand(0, 9);
            case 'string':
            case 'text':
            case 'varchar':
            case 'character varying':
            case 'tinytext':
            case 'longtext':
                return $this->quoteOrNot(sprintf("behat-test-string-%s", time()));
            case 'char':
                return "'f'";
            case 'timestamp':
            case 'timestamp with time zone':
                return 'NOW()';
            case 'null':
                return null;
            default:
                return $this->quoteOrNot(sprintf("behat-test-string-%s", time()));
        }
    }
1070472
private function getTypeFamily($type) {
		if (is_array($type)) {
			$r=[];
			foreach($type as $key=>$t) {
				$r[$key]=$this->getTypeFamily($t);
			}
		} else {
			switch (1 == 1) {
				case (strpos($this->STRARR, $type) !== false):
					$r = 1; // string
					break;
				case (strpos($this->DATARR, $type) !== false):
					$r = 2; // date
					break;
				case ($type == 'boolean'):
					$r = 3; // boolean
					break;
				case ($type == 'file'):
					$r = 4; // file
					break;
				default:
					$r = 0; // number
			}
		}
		return $r;
	}
1116790
static public function getReadableType( $type )
    {
        switch ( $type )
        {
            case self::TYPE_GOOGLE:     return 'google';
            case self::TYPE_FACEBOOK:   return 'facebook';
            case self::TYPE_YAHOO:      return 'yahoo';
            case self::TYPE_TWITTER:    return 'twitter';
        }
    }
745815
protected function filterByType(string $type)
    {
        if (!$this->files) {
            return new Sequence();
        }

        return new Sequence(
            array_filter(
                $this->files,
                function (StatusFile $statusFile) use ($type) {
                    return $type === $statusFile->getIndexStatus();
                }
            )
        );
    }
886923
private function getReferenceType($type)
    {
        switch ($type) {
            case 'absolute':
                return UrlGeneratorInterface::ABSOLUTE_PATH;
            case 'url':
                return UrlGeneratorInterface::ABSOLUTE_URL;
            case 'relative':
                return UrlGeneratorInterface::RELATIVE_PATH;
            case 'network':
                return UrlGeneratorInterface::NETWORK_PATH;
            default:
                return UrlGeneratorInterface::ABSOLUTE_PATH;
        }
    }
806502
private function converType($type) {
        switch (strtolower($type)) {
            case 'd':
                $typeSum = 'day';
                break;
            case 'm':
                $typeSum = 'month';
                break;
            case 'y':
                $typeSum = 'year';
                break;
            case 'h':
                $typeSum = 'hour';
                break;
            case 'i':
                $typeSum = 'minute';
                break;
            case 's':
                $typeSum = 'second';
                break;
        }
        return $typeSum;
    }
1167186
public static function getPhpType($type)
    {
        switch ($type) {
            case self::TYPE_DOUBLE:
            case self::TYPE_FLOAT:
                return 'float';
            case self::TYPE_INT64:
            case self::TYPE_UINT64:
            case self::TYPE_INT32:
            case self::TYPE_FIXED64:
            case self::TYPE_FIXED32:
            case self::TYPE_UINT32:
            case self::TYPE_SFIXED32:
            case self::TYPE_SFIXED64:
            case self::TYPE_SINT32:
            case self::TYPE_SINT64:
                return 'int';
            case self::TYPE_BOOL:
                return 'bool';
            case self::TYPE_STRING:
                return 'string';
            case self::TYPE_BYTES:
                return '\Protobuf\Stream';
            default:
                return null;
        }
    }
84421
private function getLongTypeFromType(string $type): string
    {
        $reflection = new \ReflectionObject($this);
        foreach ($reflection->getConstants() as $const => $value) {
            if (0 === strpos($const, 'TYPE_')) {
                if ($type === $value) {
                    return strtolower(substr($const, 5));
                }
            }
        }

        return 'info';
    }
15428
protected function typeToPDOParamType($type)
    {
        switch ($type) {
        case "boolean":
            return PDO::PARAM_BOOL;
        case "integer":
            return PDO::PARAM_STR;
        case "NULL":
            return PDO::PARAM_NULL;
        case "resource":
            return PDO::PARAM_LOB;
        case "double":
        case "string":
        default:
            return PDO::PARAM_STR;
        }
    }
102546
public static function getSubType($type)
    {
        if (preg_match('/^(.+)\[\]$/', $type, $matches) || preg_match('/^_(.+)$/', $type, $matches)) {
            return $matches[1];
        }

        return $type;
    }
237582
public static function get($type)
    {
        if (\is_string($type))
        {
            if (\defined(static::class . '::' . $type))
            {
                return \constant(static::class . '::' . $type);
            }

            if (\defined($type))
            {
                return \constant($type);
            }

            return \T_STRING;
        }

        foreach (static::constants() as $name => $value)
        {
            if ($value === $type)
            {
                return $name;
            }
        }

        $token = \token_name($type);

        if ($token === 'UNKNOWN')
        {
            return 'T_STRING';
        }

        return $token;
    }
525023
public function getParentOfType($type)
    {
        if (is_a($this, $type)) {
            return $this;
        }
        
        if ($this->parent !== null) {
            return $this->parent->getParentOfType($type);
        }
        
        return false;
    }