Returns next run dates for time expression
@param string $time
@param int $count
@return array
341197
public static function getRunDates($time, $count = 10)
    {
        try {
            $cron = CronExpression::factory($time);
            $dates = $cron->getMultipleRunDates($count);
        } catch (\Exception $e) {
            return array();
        }
        return $dates;
    }
870719
public static function repeatMinutelyForTotalCount($count, $minutes = 1)
    {
        if($count < 1) {
            throw new \InvalidArgumentException(sprintf('Total count of firings must be at least one! Given count: "%s"', $count));
        }

        return static::simpleSchedule()
            ->withIntervalInMinutes($minutes)
            ->withRepeatCount($count - 1);
    }
724756
public function stream_read($count)
    {
        $ret = substr($this->data, $this->position, $count);
        $this->position += strlen($ret);
        return $ret;
    }
1282502
public static function repeatSecondlyForTotalCount($count, $seconds = 1) {
        if($count < 1) {
            throw new \InvalidArgumentException(sprintf('Total count of firings must be at least one! Given count: "%s"', $count));
        }

        return static::simpleSchedule()
            ->withIntervalInSeconds($seconds)
            ->withRepeatCount($count - 1);
    }
1340011
private function readPoints($count)
    {
        $points = array();

        for ($i = 0; $i < $count; $i++) {
            $points[] = $this->point();
        }

        return $points;
    }
1173684
private function walk($count = 1)
    {
        $token = $nextToken = $this->lexer->token;

        for ($i = 0; ($i < $count) || ($token === $nextToken); ++$i) {
            $this->lexer->moveNext();
            $nextToken = $this->lexer->token;
        }

        return $nextToken;
    }
262243
public function listContents($time = 0)
    {
        $this->setUpList();
        return array_filter($this->idArray, function (Content $content) use ($time) {
            return $content->latestTime() >= $time;
        });
    }
1065692
public function getTimestampDifference($time = null)
    {
        $time = (is_null($time)) ? $this->getCurrentTimestamp() : $time;

        return ($time - $this->initialTimestamp);
    }
633341
public static function timeDiff($timestamp)
    {
        $dateRef = new \DateTime('@' . $timestamp);
        $dateNow = new \DateTime();

        $dateDiff = $dateNow->diff($dateRef);

        return [
        'past_time'  => $dateDiff->invert,
        'year'       => $dateDiff->y,
        'month'      => $dateDiff->m,
        'day'        => $dateDiff->d,
        'hour'       => $dateDiff->h,
        'minute'     => $dateDiff->i,
        'second'     => $dateDiff->s,
        'days_total' => $dateDiff->days,
        ];
    }
303062
public function skip($count = 1)
    {
        for ($i = $count; $this->valid() && $i > 0; $i--) {
            $this->next();
        }

        return $this->valid();
    }
1348150
public function getCellsList($offset, $count)
    {
        //check whether workshett name is set or not
        if ($this->worksheetName == '')
            throw new Exception('Worksheet name not specified');
        $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() .
            '/worksheets/' . $this->worksheetName . '/cells?offset=' .
            $offset . '&count=' . $count;
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
        $json = json_decode($responseStream);
        $listCells = array();
        foreach ($json->Cells->CellList as $cell) {
            $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() .
                '/worksheets/' . $this->worksheetName . '/cells' . $cell->link->Href;
            $signedURI = Utils::sign($strURI);
            $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
            $json = json_decode($responseStream);
            array_push($listCells, $json->Cell);
        }
        return $listCells;

    }
839384
public function getLogFiles($count = 20)
    {
        $files = glob(storage_path('logs/*'));
        $files = array_combine($files, array_map("filemtime", $files));
        arsort($files);

        $files = array_map('basename', array_keys($files));

        return array_slice($files, 0, $count);
    }
109497
private function generateCustomers($count)
    {
        $customers = [];

        for ($i = 0; $i < $count; ++$i) {
            /** @var CustomerInterface $customer */
            $customer = $this->customerFactory->createNew();
            $customer->setEmail(sprintf('john%s@doe.com', uniqid()));
            $customer->setFirstname('John');
            $customer->setLastname('Doe' . $i);

            $customers[] = $customer;

            $this->customerRepository->add($customer);
        }

        return $customers;
    }
362045
function sweep(int $time) {
        if($time <= 0) {
            $this->clear();
            return;
        }
        
        $amount = 0;
        foreach($this->data as $key => $msg) {
            if($msg->createdTimestamp > (\time() - $time)) {
                $this->delete($msg->id);
                unset($msg);
                
                $amount++;
            }
        }
        
        return $amount;
    }
1123919
public static function repeatHourlyForTotalCount($count, $hours = 1) {
        if($count < 1) {
            throw new \InvalidArgumentException(sprintf('Total count of firings must be at least one! Given count: "%s"', $count));
        }

        return static::simpleSchedule()
            ->withIntervalInHours($hours)
            ->withRepeatCount($count - 1);
    }
569818
public function read(int $count): string
    {
        $this->lastAccessed = time();
        return $this->content->read($count);
    }
930814
protected function getTokenCharacters($count = 1)
    {
        $result = '';
        for ($i = 0; $i < $count; $i++) {
            $result .= $this->tokenChars[mt_rand(0, count($this->tokenChars) - 1)];
        }
        return $result;
    }