-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration error on composer require #9
Comments
I think this could be more or less the content of the recipe.
{
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/"
},
"env": {
"TWITCH_ID": "",
"TWITCH_SECRET": "",
"TWITCH_REDIRECT_URI": "",
"TWITCH_WEBHOOK_SECRET": ""
}
}
simplystream_twitch_api:
twitch_id: '%env(TWITCH_ID)%'
twitch_secret: '%env(TWITCH_SECRET)%'
redirect_uri: '%env(TWITCH_REDIRECT_URI)%'
webhook:
secret: '%env(TWITCH_WEBHOOK_SECRET)%' |
Hey @enekochan, thanks for the advice, I'll look into it :) And thanks for the contribution btw! If you want to use the most recent updates, I've mostly worked on the |
Recipe has been merged to symfony/recipes-contrib |
I'm looking a little bit into |
Should be already in now, sorry if you already put some time into it :( But sure, any contribution is welcome! To minimize potential conflicts, I'm currently working on changing the way requests and responses work (or at least prototyping it). I think that the TwitchResponse in some ways is not that useful. For example when Twitch only returns a 204 (no content) statuscode, you receive nothing as a user of this package. Also in case of errors, you only get a generic exception with errors from the API. I'm thinking about adding the statuscode and an optional error attribute to the response. Also the request body might be changed into objects to prevent faulty data. You'll then have something like this: public function createCustomRewards(
string $broadcasterId,
CustomReward $body,
AccessTokenInterface $accessToken
): TwitchResponseInterface {
return $this->sendRequest(
path: self::BASE_PATH . '/custom_rewards',
query: [
'broadcaster_id' => $broadcasterId,
],
type: CustomReward::class . '[]',
body: $body,
accessToken: $accessToken,
);
} // ...
$channelPointsApi->createCustomRewards('1234', new CustomReward('some reward', 10, ...everythingElse), $accessToken); This will allow me to execute assertions on the CustomReward DTO and also gives the bundle user the assurance, that their data is most likely valid. But I'm still prototyping, if I like the way it works |
When installing with composer require it always gives an error because the configuration has not yet been done for the bundle.
This could be avoided now using Flex recipes. It's just a matter of adding the creation of the appropriate config file with env variables in the symfony/recipes-contrib repo. This is an example that could be helpfull to use as base:
https://github.com/symfony/recipes-contrib/tree/main/velhron/dadata-bundle/1.0
The text was updated successfully, but these errors were encountered: