Get src located between two tokens.

@param int $startID
@param int $endID

@return string
558622
private function getSource(int $startID, int $endID): string
    {
        $result = '';
        for ($tokenID = $startID; $tokenID <= $endID; ++$tokenID) {
            //Collecting function usage src
            $result .= $this->tokens[$tokenID][self::TOKEN_CODE];
        }

        return $result;
    }
1169333
protected function endpoint($resId = null)
    {
        return $resId === null ? $this->endpoint : $this->endpoint . '/' . $resId;
    }
501903
public function getIdSavePath($userId)
    {
        $id = sprintf("%09d", $userId);
        $dir1 = substr($id, 0, 3);
        $dir2 = substr($id, 3, 2);
        $dir3 = substr($id, 5, 2);
        return $dir1 . '/' . $dir2 . '/' . $dir3 . '/';
    }
261529
public function getRecord($openid, $starttime, $endtime, $pageindex = 1, $pagesize = 1000)
    {
        $params = array();
        /**
         * openid 否 普通用户的标识，对当前公众号唯一
         * starttime 是 查询开始时间，UNIX时间戳
         * endtime 是 查询结束时间，UNIX时间戳，每次查询不能跨日查询
         * pagesize 是 每页大小，每页最多拉取1000条
         * pageindex 是 查询第几页，从1开始
         */
        if ($openid) {
            $params['openid'] = $openid;
        }
        $params['starttime'] = $starttime;
        $params['endtime'] = $endtime;
        $params['pageindex'] = $pageindex;
        $params['pagesize'] = $pagesize;
        
        // $rst = $this->_request->post($this->_url . 'customservice/getrecord', $params);
        $rst = $this->_request->post($this->_url2 . 'customservice/msgrecord/getrecord', $params);
        return $this->_client->rst($rst);
    }
113727
public function getBetweenReverse($content, $start, $end)
    {
        $endIndex = strrpos($content, $end);
        $startIndex = strrpos($content, $start, -1 * (strlen($content) - $endIndex)) + strlen($start);
        return substr($content, $startIndex, $endIndex - $startIndex);
    }
1236106
public function getRangeUrls($start,$end){

        $urls = Array();

        if($end > $this->totalPages){
            $end = $this->totalPages;
        }//if

        if($start < 1){
            $start = 1;
        }//if

        for($i = $start; $i <= $end; $i++){
            $urls[] = $this->getPageUrl($i);
        }//for

        return $urls;
       
    }
1130520
public static function match(string $str, string $start, string $end) {
		$start = preg_quote($start);
		$end = preg_quote($end);
		if (preg_match('/' . $start . '(.*)' . $end . '/', $str, $matches)) {
			return $matches[1] . '';
		}
		return false;
	}
1076549
public function getStringsBetween($string, $start, $end)
    {
        $lastPos   = 0;
        $positions = array();

        while (($lastPos = strpos($string, $start, $lastPos)) !== false) {
            $positions[] = $lastPos;
            $lastPos     += strlen($start);
        }
        $lastPos      = 0;
        $positionsEnd = array();
        while (($lastPos      = strpos($string, $end, $lastPos)) !== false) {
            $positionsEnd[] = $lastPos;
            $lastPos        += strlen($end);
        }
        $return = [];
        foreach ($positions as $index => $position) {
            $return[] = str_replace([$start, $end], '', substr($string, $position, $positionsEnd[$index] - $position));
        }
        return $return;
    }
336257
public static function stringCute($string, $start = 0, $end = null): string
    {
        if (!\is_string($string)) {
            return '';
        }

        // $length    = Helper::strlen($string);
        return self::subStr($string, $start, $end);
    }
983245
public function substr(int $start, int $end): string
    {
        return $this->handle->getRange($this->name, $start, $end);
    }
1154676
public function periodByStardDateByEndDateByFiscalYearAndByOrganizationId($startDate, $endDate, $fiscalYearId, $organizationId)
  {
    $Period = $this->Period->selectRaw('id, end_date, min(month) as month')
      ->where('start_date', '=', $startDate)
      ->where('end_date', '=', $endDate)
      ->where('fiscal_year_id', '=', $fiscalYearId)
      ->where('organization_id', '=', $organizationId)
      ->first();

    return $Period;
  }
1158037
public function readToken($start)
    {
        $length = $this->source->getLength();
        $position = $this->positionAfterWhitespace($start);

        if ($position >= $length) {
            return new Token(Token::EOF_TYPE, $length, $length);
        }

        $code = $this->charCodeAt($position);

        switch ($code) {
            // !
            case 33:
                return new Token(Token::BANG_TYPE, $position, $position + 1);
            // $
            case 36:
                return new Token(Token::DOLLAR_TYPE, $position, $position + 1);
            // (
            case 40:
                return new Token(Token::PAREN_L_TYPE, $position, $position + 1);
            // )
            case 41:
                return new Token(Token::PAREN_R_TYPE, $position, $position + 1);
            // .
            case 46:
                if ($this->charCodeAt($position + 1) === 46 && $this->charCodeAt($position + 2) === 46) {
                    return new Token(Token::SPREAD_TYPE, $position, $position + 3);
                }
                break;
            // :
            case 58:
                return new Token(Token::COLON_TYPE, $position, $position + 1);
            // =
            case 61:
                return new Token(Token::EQUALS_TYPE, $position, $position + 1);
            // @
            case 64:
                return new Token(Token::AT_TYPE, $position, $position + 1);
            // [
            case 91:
                return new Token(Token::BRACKET_L_TYPE, $position, $position + 1);
            // ]
            case 93:
                return new Token(Token::BRACKET_R_TYPE, $position, $position + 1);
            // {
            case 123:
                return new Token(Token::BRACE_L_TYPE, $position, $position + 1);
            // |
            case 124:
                return new Token(Token::PIPE_TYPE, $position, $position + 1);
            // }
            case 125:
                return new Token(Token::BRACE_R_TYPE, $position, $position + 1);
            // A-Z
            case 65: case 66: case 67: case 68: case 69: case 70: case 71: case 72:
            case 73: case 74: case 75: case 76: case 77: case 78: case 79: case 80:
            case 81: case 82: case 83: case 84: case 85: case 86: case 87: case 88:
            case 89: case 90:
            // _
            case 95:
            // a-z
            case 97: case 98: case 99: case 100: case 101: case 102: case 103: case 104:
            case 105: case 106: case 107: case 108: case 109: case 110: case 111:
            case 112: case 113: case 114: case 115: case 116: case 117: case 118:
            case 119: case 120: case 121: case 122:
                return $this->readName($position);
            // -
            case 45:
            // 0-9
            case 48: case 49: case 50: case 51: case 52:
            case 53: case 54: case 55: case 56: case 57:
                return $this->readNumber($position, $code);
            // "
            case 34:
                return $this->readString($position);
        }

        // @todo Throw proper exception.
        throw new \Exception('Unexpected character.');
    }
64224
public function substring($start, $end = null) {
		$length = $this->length();
		if ($end < 0) {
			$end = $length + $end;
		}
		$end = $end !== null ? min($end, $length) : $length;
		$start = min($start, $end);
		$end = max($start, $end);
		$end = $end - $start;

		return new Text(mb_substr($this->string, $start, $end, $this->encoding), $this->encoding);
	}
86458
public static function getSource($filename, $start_line = 1, $length = null)
    {
        if (!$filename || !\file_exists($filename) || !\is_readable($filename)) {
            return null;
        }

        $source = \preg_split("/\r\n|\n|\r/", \file_get_contents($filename));
        $source = \array_combine(\range(1, \count($source)), $source);
        $source = \array_slice($source, $start_line - 1, $length, true);

        return $source;
    }
1097636
public static function parseDocString($startToken, $str)
    {
        // strip last newline (thanks tokenizer for sticking it into the string!)
        $str = preg_replace('~(\r\n|\n|\r)$~', '', $str);

        // nowdoc string
        if (false !== strpos($startToken, '\'')) {
            return $str;
        }

        return self::parseEscapeSequences($str, null);
    }
1003330
public static function iterateDir( $startPath )
    {
        foreach( new \DirectoryIterator( $startPath ) as $objItem ) {
            if( $objItem->isLink( ) ) {
                Self::$arrSymlinks[] = $objItem->getPath( ) . '/' . $objItem->getFilename( );
                continue;
            }
            if($objItem->isDir( ) ) {
                if( !$objItem->isDot( ) ) Self::iterateDir( $objItem->getPathname(), $arrResult );
                continue;
            }
            if( $objItem->isLink() ) Self::$arrSymlinks[] = $objItem->getPath( ) . '/' . $objItem->getFilename( );
        }
        return;
    }
495221
public function getUrl($file_id){
        $path=$this->config['base_path'].DIRECTORY_SEPARATOR;
        return $this->config['cdn'].$path.$file_id;
    }