Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroendesloovere committed Oct 9, 2016
1 parent 21135c7 commit 2b1277f
Show file tree
Hide file tree
Showing 12 changed files with 447 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/vendor
composer.lock
/.idea
.DS_Store
Thumbs.db
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- hhvm

sudo: false

before_script:
- composer self-update
- composer install --prefer-source --no-interaction --dev

script:
- phpunit --coverage-text

matrix:
allow_failures:
- php: hhvm
fast_finish: true
74 changes: 73 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,74 @@
# volleyadmin-php-api
# volleyadmin2-php-api
This PHP class can get the volleybal matches/calendar.

# VolleyAdmin2 PHP API
[![Latest Stable Version](http://img.shields.io/packagist/v/jeroendesloovere/volleyadmin2-php-api.svg)](https://packagist.org/packages/jeroendesloovere/volleyadmin2-php-api)
[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/jeroendesloovere/volleyadmin2-php-api/blob/master/LICENSE)
[![Build Status](http://img.shields.io/travis/jeroendesloovere/volleyadmin2-php-api.svg)](https://travis-ci.org/jeroendesloovere/volleyadmin2-php-api)

> This PHP class can get the volleybal matches/calendar.
## Usage

### Installation

``` json
{
"require": {
"jeroendesloovere/volleyadmin2-php-api": "1.0.*"
}
}
```
> Adding this code in your `composer.json` file will get the [latest volleyadmin2-php-api Packagist package](https://packagist.org/packages/jeroendesloovere/volleyadmin2-php-api) using [Composer](https://getcomposer.org).
### Example

``` php
use JeroenDesloovere\VolleyAdmin2;

$skeleton = new VolleyAdmin2();
echo $skeleton->echoPhrase('Hello, World!');

```
> [View all examples](/examples/example.php) or check [the VolleyAdmin2 class](/src/).
### Tests

``` bash
$ phpunit
```

## Documentation

The class is well documented inline. If you use a decent IDE you'll see that each method is documented with PHPDoc.

## Contributing

Contributions are **welcome** and will be fully **credited**.

### Pull Requests

> To add or update code
- **Coding Syntax** - Please keep the code syntax consistent with the rest of the package.
- **Add unit tests!** - Your patch won't be accepted if it doesn't have tests.
- **Document any change in behavior** - Make sure the README and any other relevant documentation are kept up-to-date.
- **Consider our release cycle** - We try to follow [semver](http://semver.org/). Randomly breaking public APIs is not an option.
- **Create topic branches** - Don't ask us to pull from your master branch.
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.

### Issues

> For bug reporting or code discussions.
More info on how to work with GitHub on help.github.com.

## Credits

- [:author_name](https://github.com/:author_username)
- [All Contributors](https://github.com/jeroendesloovere/volleyadmin2-php-api/contributors)

## License

The module is licensed under [MIT](./LICENSE.md). In short, this license allows you to do everything as long as the copyright statement stays present.
27 changes: 27 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "jeroendesloovere/package-skeleton",
"type": "library",
"description": "A skeleton package to use as a base",
"keywords": ["skeleton"],
"homepage": "https://github.com/jeroendesloovere/package-skeleton",
"license": "MIT",
"authors": [
{
"name": "Jeroen Desloovere",
"email": "info@jeroendesloovere.be",
"homepage": "http://jeroendesloovere.be",
"role": "Developer"
}
],
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"mockery/mockery": "dev-master@dev"
},
"autoload": {
"psr-4": {
"JeroenDesloovere\\VolleyAdmin2\\": "src/"
}
}
}
5 changes: 5 additions & 0 deletions examples/credentials.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

$clubNumber = 'W-1132';
$provinceId = 9;
$seriesId = '2 PDA'; // Tweede provinciale dames A
33 changes: 33 additions & 0 deletions examples/matches.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/**
* VolleyAdmin2
*
* This VolleyAdmin2 PHP Class connects to the VolleyAdmin2 API.
*
* @author Jeroen Desloovere <info@jeroendesloovere.be>
*/

// Add your own credentials in this file
require_once __DIR__ . '/credentials.php';

// Required to load (only when not using an autoloader)
require_once __DIR__ . '/../vendor/autoload.php';

use JeroenDesloovere\VolleyAdmin2\VolleyAdmin2;

// Init API
$api = new VolleyAdmin2();

// Define all matches
$matches = $api->getMatches(
$seriesId,
$provinceId,
$clubNumber
);

foreach ($matches as $match) {
var_dump($match);
echo '<br/>' . $match->t . ' ' . $match->Aanvangsuur . ': ' . $match->Thuis . ' - ' . $match->Bezoekers;
echo '<br/>Location: ' . $match->SporthalNaam;
}
27 changes: 27 additions & 0 deletions examples/series.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/**
* VolleyAdmin2
*
* This VolleyAdmin2 PHP Class connects to the VolleyAdmin2 API.
*
* @author Jeroen Desloovere <info@jeroendesloovere.be>
*/

// Add your own credentials in this file
require_once __DIR__ . '/credentials.php';

// Required to load (only when not using an autoloader)
require_once __DIR__ . '/../vendor/autoload.php';

use JeroenDesloovere\VolleyAdmin2\VolleyAdmin2;

// Init API
$api = new VolleyAdmin2();

// Define all series
$series = $api->getSeries($provinceId);

foreach ($series as $serie) {
echo '<br/>' . $serie->id . ' - ' . $serie->name . ' - ' . $serie->abbreviation;
}
29 changes: 29 additions & 0 deletions examples/standings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/**
* VolleyAdmin2
*
* This VolleyAdmin2 PHP Class connects to the VolleyAdmin2 API.
*
* @author Jeroen Desloovere <info@jeroendesloovere.be>
*/

// Add your own credentials in this file
require_once __DIR__ . '/credentials.php';

// Required to load (only when not using an autoloader)
require_once __DIR__ . '/../vendor/autoload.php';

use JeroenDesloovere\VolleyAdmin2\VolleyAdmin2;

// Init API
$api = new VolleyAdmin2();

$standings = $api->getStandings(
$seriesId,
$provinceId
);

foreach ($standings as $standing) {
echo '<br/>' . $standing->Ploegnaam . ' ' . $standing->AantalWedstrijden . '-' . $standing->AantalWedstrijdenGewonnen;
}
16 changes: 16 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="vendor/autoload.php"
colors="true"
verbose="true">
<testsuites>
<testsuite name="JeroenDesloovere Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
11 changes: 11 additions & 0 deletions src/Exception.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace JeroenDesloovere\VolleyAdmin2;

class Exception extends \Exception
{
public function getMessage(\Exception $e)
{
return $e->getMessage();
}
}

0 comments on commit 2b1277f

Please sign in to comment.