List comments in a repository

@link https://developer.github.com/v3/issues/comments/#list-comments-in-a-repository

@param string $sort
@param string $direction
@param string $since

@return array
11722
public function listRepositoryComments(string $sort = AbstractApi::SORT_CREATED,
                                           string $direction = AbstractApi::DIRECTION_DESC,
                                           string $since = 'now'): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/comments?:args',
            $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), http_build_query([
                'sort'      => $sort,
                'direction' => $direction,
                'since'     => $since
            ])));
    }
811779
public function getRepliesTo(DataObject $to, $sortBy = 'ID', $since = 0, $before = false, $topLevelOnly = false, $tags = array(), $offset = 0, $number = 100) {
		$filter = array(
			'ParentID'			=> $to->ID, 
		);
		return $this->microPostList($filter, $sortBy, $since, $before, $topLevelOnly, $tags, $offset, $number);
	}
153601
public function getPostcodesByCoordinates($latitude, $longitude, $sort = self::POSTCODES_SORT_DISTANCE)
    {
        return $this->get('/postcodes/', [
            'coords' => [
                'latitude' => $latitude,
                'longitude' => $longitude
            ],
            'sort' => $sort
        ]);
    }
949845
private function generateSortByPropertyClosure( $property, $direction = SORT_ASC )
    {

        if( $direction === SORT_DESC ) {
            $aLTb = 1;
            $aGTb = -1;
        } else {
            $aLTb = -1;
            $aGTb = 1;
        }

        $mapper = $this->getPropertyMapper($property);

        return function ( $a, $b ) use ( $mapper, $aLTb, $aGTb ) {
            $propertyA = $mapper->get($a);
            $propertyB = $mapper->get($b);
            if( $propertyA === $propertyB ) {
                return 0;
            }
            return ( $propertyA < $propertyB ) ? $aLTb : $aGTb;
        };

    }
479716
private function processOrderByParams($sort)
    {
        $direction       = (substr($sort, 0, 1) == '-') ? 'DESC' : 'ASC';
        $field           = (substr($sort, 0, 1) == '-') ? substr($sort, 1) : $sort;
        $this->orderBy[] = [
            snake_case($field),
            $direction
        ];
    }
737241
public function orderBy(string $field, int $direction = self::ASCENDING): DocumentSelector
    {
        return $this->sortBy($this->sortBy + [$field => $direction]);
    }
1017147
public static function sortKeys(array $array, string $direction = 'ASC')
    {
        $direction = (strtolower($direction) === 'desc') ? SORT_DESC : SORT_ASC;
        if ($direction === SORT_ASC) {
            ksort($array);
        } else {
            krsort($array);
        }

        return $array;
    }
1236402
public function getList($since = 0)
	{
		// Build the request path.
		$uri = new Uri($this->fetchUrl('/users'));

		if ($since)
		{
			$uri->setVar('since', $since);
		}

		// Send the request.
		return $this->processResponse($this->client->get($uri));
	}
8414
public function sortBy(string $field, string $direction = 'asc'): self
    {
        $this->sortBy = [$field, $direction];

        return $this;
    }
381569
public function comments(int $start = 0, int $count = 10, string $sort = 'ASC') : array
    {
        $returnComments = [];

        if ($this->commentCount() === 0) return $returnComments;

        $comments = $this->get(sprintf(self::ACTIVITY_ENDPOINT . 'v1/users/%s/stories/%s/comments', $this->user()->onlineIdParameter(), $this->storyId()), [
            'start' => $start,
            'count' => $count,
            'sort' => $sort
        ]);

        foreach ($comments->userComments as $comment) {
            $returnComments[] = new Comment($this->client, $comment, $this);
        }
        
        return $returnComments;
    }
1243154
public function getFileErrors($order = 'error.counter', $direction = 'DESC')
    {
        $this->getAll(true);

        /** @var QueryBuilder $qb */
        $qb = $this->qb;

        return $qb
            ->andWhere('error.type = :type')
            ->setParameter('type', HttpError::TYPE_FILE)
            ->orderBy($order, $direction);
    }
187446
public static function create(array $properties, Direction $direction = null) : Sort
    {
        if ($direction === null) {
            $direction = Direction::$ASC;
        }
        $orders = [];
        foreach ($properties as $property) {
            $orders[] = new Order($direction, $property);
        }
        return new self($orders);
    }
506428
public function orderBy(
        string $cypher,
        string $direction = 'ASC'
    ): self {
        $direction = \strtolower($direction);

        $query = new self;
        $query->clauses = $this->clauses->add(
            Clause\OrderByClause::$direction($cypher)
        );

        return $query;
    }
933269
public function getHeaders( $sort = SORTDATE, $reverse = TRUE, $limit = 0, $offset = 0 )
	{
		$list	= array();
		$sort	= imap_sort( $this->connection->getStream(), $sort, (int) $reverse, SE_UID );
		$sort	= array_slice( $sort, $offset, $limit );
		foreach( $sort as $uid )
		{
			$list[$uid]	= $this->getHeadersByUid( $uid );
		}
		return $list;
	}
366972
public function getQueryPagination(ModuleActionsInterface $entity, $sort, $direction)
    {

        $queryBuilder = $this->createQueryBuilder('m');

        $data = [
            'name' => $entity->getName(),
            'identifier' => $entity->getIdentifier(),
            'module'     => !is_null($entity->getModule()) ? $entity->getModule() :  '',
            'id' => $entity->getId(),
        ];

        if (!empty($entity->getModule())) {
            $queryBuilder
                ->andWhere($queryBuilder->expr()->eq('m.module', ':module'))
                ->setParameter('module', $data['module'])
            ;
        }

        if (!empty($data['id'])) {
            $queryBuilder
                ->andWhere($queryBuilder->expr()->eq('m.id', ':id'))
                ->setParameter('id', $data['id'])
            ;
        }

        if (!empty($data['name'])) {
            $queryBuilder
                ->andWhere($queryBuilder->expr()->like('m.name', ':name'))
                ->setParameter('name', "%{$data['name']}%")
            ;
        }

        if (!empty($data['identifier'])) {
            $queryBuilder
                ->andWhere($queryBuilder->expr()->like('m.identifier', ':identifier'))
                ->setParameter('identifier', "%{$data['identifier']}%")
            ;
        }

        return $queryBuilder
            ->orderBy('m.'.$sort, $direction)
            ->getQuery()
            ;
    }
914130
private Sort withDirection(final Direction direction) {

    return Sort.by(orders.stream().map(it -> new Order(direction, it.getProperty()))
        .collect(Collectors.toList()));
  }
941018
public function sortBy($column, $direction = 'asc')
    {
        $this->sortBy = $column;
        if (in_array(strtolower($direction), array('asc', 'desc'))) {
            $this->sortByDirection = $direction;
        } else {
            $this->sortByDirection = 'asc';
        }
    }