Giter VIP home page Giter VIP logo

challongephp's People

Contributors

apfelwurm avatar clamburger avatar dependabot[bot] avatar kylekz avatar xkairu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

challongephp's Issues

Library is not compatible with all PSR-18 clients

The following lines in ClientWrapper.php use a Guzzle-specific call that does not work with a standard PSR-18 client:

$response = $this->client->request($method, $base_uri, [
'query' => ['api_key' => $this->getKey()],
'form_params' => $content,
'headers' => $this->buildHeaders(),
'http_errors' => false,
'verify' => false,
]);

For example, when used with the Symfony HTTP client, I receive this error:
Attempted to call an undefined method named "request" of class "Symfony\Component\HttpClient\Psr18Client".

The best approach would be to pass down a RequestFactoryInterface (as defined in PSR-17) in order to construct a PSR-7 request. This might require a breaking change to the Challonge class, so an alternative option could be to add a dependency on a specific PSR-7 implementation and construct the request object directly. In both cases, you would then pass that request object to $this->client->sendRequest().

Timeouts?

Hi,

My dev site is working fine, however having network level issue on production, timeout permanent error.

anyone else having issues with connecting to api?

yes i have contacted support a few months back

Spatie\DataTransferObject\DataTransferObjectError

I couldn't get this to work until i added

public ?string $team_size_range; public ?string $toxic; public ?string $use_new_style; public array $optional_display_data;
to vendor\team-reflex\challonge-php\src\Challonge\DTO\Tournament.php

Is it just me or does challonge not lock api versions?
I feel like this will break often in the future..

version 3.0.3

Please add a simple use case

A quick glance of your source suggests that it is in working order, but a simple source would be appreciated, just to give an entry point and perhaps a warning about how not to use it.

bulkAddParticipant

bulkAddParticipant

what is the syntax for this ? this is what i have tried:

        $postSquads[] = $comp->addParticipant(['participant[name]' => $team->name, 'participant[seed]' => $key + 1, 'participant[misc]' => $team->id]);


        // 'participant[][name]'=>1, 'participant[][seed]'=>1, 'participant[][misc]'=>'team_id', 'participant[][email]'=>'[email protected]',


    // $postSquads = $comp->bulkAddParticipant([
    // 'participant[][name]'=>1, 'participant[][seed]'=>1, 'participant[][misc]'=>'team_id', 'participant[][email]'=>'[email protected]',
    // 	// 'participant[][name]'=>2, 'participant[][seed]'=>2, 'participant[][misc]'=>'team_id',
    // 	// 'participant[][name]'=>3, 'participant[][seed]'=>3, 'participant[][misc]'=>'team_id',
    // 	// 'participant[][name]'=>4, 'participant[][seed]'=>4, 'participant[][misc]'=>'team_id',
    // 	// 'participant[][name]'=>5, 'participant[][seed]'=>5, 'participant[][misc]'=>'team_id',
    // 	// 'participant[][name]'=>6, 'participant[][seed]'=>6, 'participant[][misc]'=>'team_id',
    // 	// 'participant[][name]'=>7, 'participant[][seed]'=>7, 'participant[][misc]'=>'team_id'
    // ]);

any examples?

/**
 * Bulk add participants to a tournament (up until it is started).
 * @param array $options
 * @return Collection
 * @throws \JsonException
 * @throws \Reflex\Challonge\Exceptions\InvalidFormatException
 * @throws \Reflex\Challonge\Exceptions\NotFoundException
 * @throws \Reflex\Challonge\Exceptions\ServerException
 * @throws \Reflex\Challonge\Exceptions\UnauthorizedException
 * @throws \Reflex\Challonge\Exceptions\UnexpectedErrorException
 * @throws \Reflex\Challonge\Exceptions\ValidationException
 */
public function bulkAddParticipant(array $options = []): Collection
{
    $response = $this->client->request('POST', "tournaments/{$this->id}/participants/bulk_add", $this->client->mapOptions($options, 'participant'));
    return Collection::make($response)
        ->map(fn (array $participant) => Participant::fromResponse($this->client, $participant['participant']));
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.