Read a data of type $type in the file from the current position

@param mixed $type The data type to read

@return mixed The data that was read
350455
public function r($type) {
    switch ($type) {
      case self::uint8:
        return $this->readUInt8();
      case self::int8:
        return $this->readInt8();
      case self::uint16:
        return $this->readUInt16();
      case self::int16:
        return $this->readInt16();
      case self::uint32:
        return $this->readUInt32();
      case self::int32:
        return $this->readUInt32();
      case self::shortFrac:
        return $this->readFixed();
      case self::Fixed:
        return $this->readFixed();
      case self::FWord:
        return $this->readInt16();
      case self::uFWord:
        return $this->readUInt16();
      case self::F2Dot14:
        return $this->readInt16();
      case self::longDateTime:
        return $this->readLongDateTime();
      case self::char:
        return $this->read(1);
      default:
        if (is_array($type)) {
          if ($type[0] == self::char) {
            return $this->read($type[1]);
          }
          if ($type[0] == self::uint16) {
            return $this->readUInt16Many($type[1]);
          }
          if ($type[0] == self::int16) {
            return $this->readInt16Many($type[1]);
          }
          if ($type[0] == self::uint8) {
            return $this->readUInt8Many($type[1]);
          }
          if ($type[0] == self::int8) {
            return $this->readInt8Many($type[1]);
          }

          $ret = array();
          for ($i = 0; $i < $type[1]; $i++) {
            $ret[] = $this->r($type[0]);
          }

          return $ret;
        }

        return null;
    }
  }
941740
protected static function getConnection($type) {
    $mapper = self::getMapper($type);
    $conn = $mapper->getConnection();
    return $conn;
  }
537436
public function readSequenceToNext($type, $skipDelimiter = false)
	{
		$tokens = [];
		$delim = (array)$type;

		while($this->valid())
		{
			$token = $this->current();

			if($token->isOneOf($delim))
			{
				if(!$skipDelimiter)
				{
					$tokens[] = $token;
				}

				break;
			}

			$tokens[] = $token;

			$this->next();
		}

		return $this->createTokenSequence($tokens);
	}
1057816
public static function convertNumericType($type)
    {
        if (! isset(self::$types[$type])) {
            throw new \InvalidArgumentException('Unknown numeric read preference type: ' . $type);
        }

        return self::$types[$type];
    }
1218566
public function readImage( $file, $type) {
		switch ($type) {
			case 2:	//JPEG
			return(ImageCreateFromJPEG($file));
			break;
			
			case 3:	//PNG
			return(ImageCreateFromPNG($file));
			break;
			
			default:
			$this->errorMsg="File format not supported.";
			return(false);
		}
	}
1194423
public function type($type = null) {
		if ($type === false) {
			unset($this->headers['Content-Type']);
			$this->_type = false;
			return;
		}
		$media = $this->_classes['media'];

		if (!$type && $this->_type) {
			return $this->_type;
		}
		$headers = $this->headers + ['Content-Type' => null];
		$type = $type ?: $headers['Content-Type'];

		if (!$type) {
			return;
		}
		$header = $type;

		if (!$data = $media::type($type)) {
			$this->headers('Content-Type', $type);
			return ($this->_type = $type);
		}
		if (is_string($data)) {
			$type = $data;
		} elseif (!empty($data['content'])) {
			$header = is_string($data['content']) ? $data['content'] : reset($data['content']);
		}
		$this->headers('Content-Type', $header);
		return ($this->_type = $type);
	}
747894
public function type($type)
    {
        $type = strtoupper($type);
        if (!in_array($type, ['CURL', 'SOCKET', 'FILE'])) {
            $type = 'CURL';
        }
        $this->def['type'] = $type;
        return $this;
    }
473363
public function setType($type)
    {
        if ($type instanceof Type) {
            $this->setIndex($type->getIndex());
            $type = $type->getName();
        }

        return $this->setParam('_type', $type);
    }
1321784
public function getType($type)
    {
        if (!$this->hasType($type)) {
            $this->metaTypeList[$type] = new $type();
        }

        return $this->metaTypeList[$type];
    }
1164741
public function getNewFile($type = null)
    {
        $class = $this->getFileModelName($type);
        /** @var ModelFile $file */
        $file = new $class();
        $file->setModel($this);
        $file->setFilesystem($this->getFilesystemDisk());
        return $file;
    }
1266571
protected function read($file, $type = 'raw', array $data = [])
    {
        $type = strtolower($type);

        if ($type === 'include' || $type === 'require') {
            ob_start();

            extract($data);
            unset($data);

            if ($type === 'include') {
                include $file;
            } else {
                require $file;
            }

            return ob_get_clean();
        }

        $raw = is_readable($file) === true ? file_get_contents($file) : $file;

        if ($type === 'base64') {
            return base64_encode($raw);
        }

        return $raw;
    }
823734
public function getFiles($type)
	{
		$f = $type . 'Files';

		if (property_exists($this, $f))
		{
			return self::${$f};
		}

		$this->say('Missing Files: ' . $type);

		return "";
	}
242312
public static function getType($type)
    {
        $type = strtolower($type);

        if (!isset(static::$typeMapping[$type])) {
            return $type;
        }

        return static::$typeMapping[$type];
    }
76232
protected function getTypeByCode($type)
    {
        switch ($type) {
            case self::BOOLEAN:
                return 'boolean';
            case self::INT:
                return 'int';
            case self::FLOAT:
                return 'float';
            case self::STRING:
                return 'string';
            case self::DATE:
                return 'date';
            case self::OBJECT:
                return 'object';
            case self::XML:
                return 'xml';
            case self::DATA:
                return 'data';
            case self::DATA_ARRAY:
                return 'array';

            default:
                return null;
        }
    }
1075642
private function readData()
    {
        switch ($this->fileType) {
            case self::TYPE_JSON :
                $data = json_decode(file_get_contents($this->readPath), true);
                break;
            default : $data = require $this->readPath;
        }
        return $data;
    }
726582
public function getAttribute($type)
    {
        $value = null;

        if (is_array($this->attributesReceived)) {
            foreach($this->attributesReceived as $attr) {
                if (intval($type) == $attr[0]) {
                    $value = $attr[1];
                    break;
                }
            }
        }

        return $value;
    }
1121802
protected static function getPositionerInstance($type)
    {
        if (!isset(self::$_positioners[$type])) {
            $class = '\\Dompdf\\Positioner\\'.$type;
            self::$_positioners[$type] = new $class();
        }
        return self::$_positioners[$type];
    }