punch / nevobo-bundle
A Symfony bundle to query the Nevobo v1 API
Installs: 163
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.0
- symfony/cache: ^5.3|^6.0
- symfony/config: ^5.3|^6.0
- symfony/dependency-injection: ^5.3|^6.0
- symfony/http-kernel: ^5.3|^6.0
- symfony/serializer: ^5.3|^6.0
Requires (Dev)
- symfony/phpunit-bridge: ^5.3
This package is auto-updated.
Last update: 2024-04-15 01:20:53 UTC
README
A Symfony Bundle to help you query the Nevobo v1 Api
Inspired by Nevobo-js
Installation
composer require punch/nevobo-bundle
The bundle does not use Symfony Flex (yet), so manually register it in config/bundles/php
<?php return [ // ... Punch\NevoboBundle\PunchNevoboBundle::class => ['all' => true], ]
And add the config in config/packages/punch_nevobo.yaml
:
punch_nevobo: cache_duration: 86400 # 1 day
You can change how long you want to cache the results, use 0 to disable caching entirely.
Usage
use Punch\NevoboBundle\Service\NevoboClient; class YourController extends AbstractController { #[Route(path: '/', name: 'some_route')] public function index(NevoboClient $client): Response { $client->getVereniging('ckl9m4l'); $client->getTeamsForVereniging('ckl9m4l'); $client->getSporthallenForVereniging('ckl9m4l'); $client->getWedstrijdenForVereniging('ckl9m4l'); $client->getWedstrijdResultaatForVereniging('ckl9m4l'); $client->getWedstrijdProgrammaForVereniging('ckl9m4l'); $client->getTeam('ckl9m4l-hs-4'); $client->getPouleIndelingen('regio-west-h1f-7'); $client->getWedstrijdenForPoule('regio-west-h1f-7'); } }
FAQ
Q: Why is the codebase a mix of Dutch and English?
A: All variables and classes follow the names from the Nevobo API, blame them.
Q: I just want the rankings for a specific team?
A: First use getPoules(<teamId>)
, then use getPouleIndelingen(<pouleId>)
to get the standings.