Skip to content

Commit e2b925c

Browse files
committed
- Fix namespace
- Extend the README
1 parent 97623e9 commit e2b925c

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
# Informat API Wrapper
22
PHP client library for the Informat school software API. This client allows you to
33
- Fetch students
4-
- Fetch registration
4+
- Fetch registrations
55
- Create new preregistrations
66

7+
## Installation
8+
You can simply install the library through composer:
9+
```
10+
composer require koba/informat-php-client
11+
```
12+
The library also requires a PSR-17 and PSR-18 implementation. If these are not yet included in your project, you can install Guzzle 7 to meet this requirement (although any other implementation will work fine):
13+
```
14+
composer require guzzlehttp/guzzle
15+
```
16+
717
## Usage
818
The library is built on 3 main 'layers':
919
- The `Informat` class, which is instantiated with your client ID and secret.
10-
- Directories, which are logical groups of api calls. These can be obtained by function calls on the `Informat` class.
11-
- API calls, these can be instantiated by function calls on the directories.
20+
- Directories, which are logical groups of api calls. These can be obtained by using the provided methods on the `Informat` class.
21+
- API calls, these can be instantiated by using the provided methods on the directories.
1222

1323
The code below is a quick example of how you can fetch students
1424
```php
@@ -29,15 +39,15 @@ $informat = new Informat(
2939
This will return an array of `Student` objects, which has typed (and documented) properties.
3040

3141
### Scopes
32-
Creating the `Informat` object can be done fairly easily as demonstrated above. The scopes paramete might need some extra explanation.
42+
Creating the `Informat` object can be done fairly easily as demonstrated above. The scopes parameter might need some extra explanation.
3343

3444
In the example above you see we pass an `AllScopesStrategy` object to the constructor. This is a way to let the API client know which scopes we want to request, which directly impacts which API calls you will be authorized to execute. The library supplies the `AllScopesStrategy`, which will request all possible scopes and the `SpecificScopesStrategy`, which allows you to specify the scopes that will be requested. Both require you to pass the institute numbers for all schools you wnat to access as parameters. The latter might be desirable if your client isn't authorized for all scopes or you want to limit the functionality for security reasons.
3545

3646
You can also create your own scope strategy by implementing the `ScopeStrategyInterface`.
3747

3848
### Calls
3949
There are a couple of 'rules' that should be followed when managing calls
40-
- When creating a call using a function on a directory, all required parameters for the API call need to be passed to the function. The institute number will always be the first parameter as it is required for all API calls.
50+
- When creating a call using a method on a directory, all required parameters for the API call need to be passed to the function. The institute number will always be the first parameter as it is required for all API calls.
4151
- All optional paremeters can be set using setters on the API call.
4252
- Setters on the API calls returns the call itself, which means you can easily chain them together.
4353
- An API call will always be executed with the `send` method.
@@ -55,4 +65,4 @@ $informat
5565
```
5666

5767
### Advanced
58-
The `Informat` object has some advanced setup options. You can pass an `AccessTokenManagerInterface` object, which allows you to implement your own access token caching solution. The rest of the constructor can be used to pass a [psr-18](https://www.php-fig.org/psr/psr-18/) client interface and [psr-17](https://www.php-fig.org/psr/psr-17/) HTTP response factories. If these options are omitted, the library will autodiscover any suitable implementations. If your project doesn't currently have one, you could take a look at [Guzzle 7](https://docs.guzzlephp.org/en/stable/).
68+
The `Informat` object has some advanced setup options. You can pass an `AccessTokenManagerInterface` object, which allows you to implement your own access token caching solution. The rest of the constructor can be used to pass a [psr-18](https://www.php-fig.org/psr/psr-18/) client interface and [psr-17](https://www.php-fig.org/psr/psr-17/) HTTP response factories. If these options are omitted, the library will autodiscover any suitable implementations.

src/Informat/Directories/Preregistrations/DeletePreregistration/DeletePreregistrationCall.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Koba\Informat\Directories\Preregistrations;
3+
namespace Koba\Informat\Directories\Preregistrations\DeletePreregistration;
44

55
use Koba\Informat\Call\CallInterface;
66
use Koba\Informat\Call\CallProcessor;

0 commit comments

Comments
 (0)