Skip to content

Commit 7c7d8fc

Browse files
committed
complete rewrite
1 parent f09add9 commit 7c7d8fc

File tree

143 files changed

+5820
-5821
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+5820
-5821
lines changed

.gitattributes

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/docs export-ignore
2+
/tests export-ignore
3+
/.gitattributes export-ignore
4+
/.gitignore export-ignore
5+
/.php_cs.dist export-ignore
16
/.travis.yml export-ignore
7+
/phpstan.neon export-ignore
28
/phpunit.xml.dist export-ignore
3-
/tests export-ignore

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
/vendor
22
/.build
3-
/phpunit.xml
4-
composer.lock
5-
/coverage.xml

.php_cs.dist

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
$finder = PhpCsFixer\Finder::create()
3+
->in(__DIR__)
4+
->exclude('vendor')
5+
->exclude('.build')
6+
;
7+
return PhpCsFixer\Config::create()
8+
->setFinder($finder)
9+
->setRules([
10+
'@Symfony' => true,
11+
'declare_strict_types' => true,
12+
]);

.travis.yml

+10-17
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
language: php
2-
sudo: false
32

4-
cache:
5-
directories:
6-
- $HOME/.composer/cache/files
3+
php:
4+
- "7.3"
75

8-
matrix:
9-
fast_finish: true
10-
include:
11-
- php: 7.2
12-
13-
before_install:
14-
- composer self-update
15-
16-
install:
17-
- composer install
6+
before_script:
7+
- echo 'date.timezone = "Europe/Copenhagen"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
8+
- travis_retry composer self-update
9+
- travis_retry composer install --no-interaction
1810

1911
script:
20-
- composer test
12+
- composer test
13+
- vendor/bin/simple-phpunit --coverage-clover clover.xml
2114

22-
after_success:
23-
- travis_retry bash <(curl -s https://codecov.io/bash)
15+
after_script:
16+
- bash <(curl -s https://codecov.io/bash)

README.md

+10-24
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,22 @@ PHP wrapper for Rejseplanen.dk API
1010

1111
`composer require lsv/rejseplan-php-api`
1212

13-
or add it to your `composer.json` file
13+
### Usages
1414

15-
```json
16-
"require": {
17-
"lsv/rejseplan-php-api": "^1.0"
18-
}
19-
```
20-
21-
### Usage
22-
23-
For finding stops nearby a location you can do this
24-
25-
```php
26-
$baseurl = 'https://your-base-url.dk';
27-
$xcoordinate = 55.442952;
28-
$ycoordinate = 11.791372;
29-
$coordinate = new \RejseplanApi\Coordinate($xcoordinate, $ycoordinate);
30-
$nearby = new \RejseplanApi\Services\NearbyStops($baseurl);
31-
$nearby->setCoordinate($coordinate);
32-
$response = $nearby->call();
33-
// Response will now be a array with \RejseplanApi\Response\StopLocationResponse
34-
```
35-
36-
More details in the [documentation](docs/index.md)
15+
| Request | Description |
16+
| --- | --- |
17+
| [ArrivalBoard](ArrivalBoard.md) | To get arrival board for a station |
18+
| [DepartureBoard](DepartureBoard.md) | To get departure board for a station |
19+
| [Journey](Journey.md) | This will get you a full journey report for a vehicle |
20+
| [Location](Location.md) | With this you can find stops, POI or addresses from a user input |
21+
| [NearbyStops](NearbyStops.md) | This will deliver all stops within a radius of a given coordinate. |
22+
| [Trip](Trip.md) | With this you can calculate a trip |
3723

3824
### License
3925

4026
The MIT License (MIT)
4127

42-
Copyright (c) 2016 Martin Aarhof [email protected]
28+
Copyright (c) 2019 Martin Aarhof [email protected]
4329

4430
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4531

composer.json

+47-46
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,50 @@
11
{
2-
"name": "lsv/rejseplan-php-api",
3-
"description": "PHP wrapper for Rejseplanen.dk API",
4-
"type": "library",
5-
"license": "MIT",
6-
"authors": [
7-
{
8-
"name": "Martin Aarhof",
9-
"email": "[email protected]"
10-
}
11-
],
12-
"require": {
13-
"php": "^7.2",
14-
"guzzlehttp/guzzle": "^6.0",
15-
"symfony/options-resolver": "^4.0",
16-
"jms/serializer": "^1.9|^2.0"
17-
},
18-
"autoload": {
19-
"psr-4": {
20-
"RejseplanApi\\": "src"
21-
}
22-
},
23-
"require-dev": {
24-
"phpunit/phpunit": "^7.1",
25-
"symplify/easy-coding-standard": "^4.2",
26-
"phpstan/phpstan": "^0.9.2"
27-
},
28-
"autoload-dev": {
29-
"psr-4": {
30-
"RejseplanApiTest\\": "tests"
31-
}
32-
},
33-
"scripts": {
34-
"fix": [
35-
"composer validate --strict",
36-
"./vendor/bin/phpunit --coverage-html=.build --coverage-text --colors=never",
37-
"./vendor/bin/ecs check -q src --level psr12 --fix",
38-
"./vendor/bin/ecs check -q tests --level psr12 --fix",
39-
"./vendor/bin/phpstan analyze src --level 7 --no-progress"
40-
],
41-
"test": [
42-
"composer validate --strict",
43-
"./vendor/bin/phpunit --coverage-clover=coverage.xml",
44-
"./vendor/bin/ecs check src --level psr12",
45-
"./vendor/bin/ecs check tests --level psr12",
46-
"./vendor/bin/phpstan analyze src --level 7 --no-progress"
47-
]
2+
"name": "lsv/rejseplan-php-api",
3+
"description": "PHP wrapper for Rejseplanen.dk API",
4+
"type": "library",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Martin Aarhof",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"autoload": {
13+
"psr-4": {
14+
"Lsv\\Rejseplan\\": "src"
4815
}
16+
},
17+
"require": {
18+
"ext-json": "*",
19+
"php": "^7.3",
20+
"symfony/http-client": "^4.3",
21+
"symfony/options-resolver": "^4.3",
22+
"symfony/serializer": "^4.3",
23+
"symfony/property-access": "^4.3",
24+
"symfony/property-info": "^4.3",
25+
"phpdocumentor/reflection-docblock": "^4.3"
26+
},
27+
"autoload-dev": {
28+
"psr-4": {
29+
"Lsv\\RejseplanTest\\": "tests"
30+
}
31+
},
32+
"require-dev": {
33+
"symfony/phpunit-bridge": "^4.0"
34+
},
35+
"scripts": {
36+
"fix": [
37+
"curl -OL https://get.sensiolabs.org/security-checker.phar && php security-checker.phar security:check composer.lock && rm security-checker.phar",
38+
"curl -OL https://cs.sensiolabs.org/download/php-cs-fixer-v2.phar && php php-cs-fixer-v2.phar fix --using-cache false --allow-risky=yes && rm php-cs-fixer-v2.phar",
39+
"curl -OL https://phar.phpunit.de/phpcpd.phar && php phpcpd.phar src/ --min-lines=50 && rm phpcpd.phar",
40+
"curl -o phpstan.phar -OL https://phpstan-downloader.aarhof.eu && php phpstan.phar analyse src -l 7 && rm phpstan.phar",
41+
"vendor/bin/simple-phpunit"
42+
],
43+
"test": [
44+
"curl -OL https://get.sensiolabs.org/security-checker.phar && php security-checker.phar security:check composer.lock && rm security-checker.phar",
45+
"curl -OL https://cs.sensiolabs.org/download/php-cs-fixer-v2.phar && php php-cs-fixer-v2.phar fix --dry-run --using-cache false --diff --allow-risky=yes && rm php-cs-fixer-v2.phar",
46+
"curl -OL https://phar.phpunit.de/phpcpd.phar && php phpcpd.phar src/ --min-lines=50 && rm phpcpd.phar",
47+
"curl -o phpstan.phar -OL https://phpstan-downloader.aarhof.eu && php phpstan.phar analyse src -l 7 && rm phpstan.phar"
48+
]
49+
}
4950
}

0 commit comments

Comments
 (0)