Skip to content

Commit

Permalink
fix typo, add cache recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobBruening committed Jun 30, 2021
1 parent 240d948 commit 8366b17
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Immobilienscout 24 API
# ImmobilienScout24 API

[![Software License](https://img.shields.io/badge/license-GPLv3-brightgreen.svg?style=flat-square)](LICENSE.md)

Expand All @@ -15,7 +15,7 @@ composer require jakobbruening/immobilienscout24
- [Attachments](docs/Attachments.md)
- [Contacts](docs/Contact.md)

API documentation: [Immoscout 24](https://api.immobilienscout24.de/)
API documentation: [ImmoScout24](https://api.immobilienscout24.de/)


## Copyright and license
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "jakobbruening/immobilienscout24",
"description": "Simple package for the ImmobilienScout24 API",
"description": "Simple package to work with the ImmobilienScout24 API",
"type": "library",
"license": "GPL-3.0",
"keywords": [
"immobilienscout",
"immobilienscout24",
"immoscout24",
"api"
],
"authors": [
Expand All @@ -26,6 +27,5 @@
},
"require-dev": {
"symfony/var-dumper": "^5.2"
},
"minimum-stability": "dev"
}
}
1 change: 1 addition & 0 deletions docs/RealEstate.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ $realEstate->getAll(?int $page = null);
```php
$realEstate->getAllWithDetails();
```
*We highly recommend caching this result.*

## Get a real estate by id
````php
Expand Down
9 changes: 4 additions & 5 deletions src/Immoscout/ApiRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public function __construct(?array $auth = null)
$this->prepareClient($auth);
}

/**
* Authenticate and prepare GuzzleHttp client
*/
private function prepareClient(?array $authData = null): void
{
$key = $authData['consumer_key'] ?? $_ENV['IMSC_CONSUMER_KEY'] ?? null;
Expand Down Expand Up @@ -55,11 +58,7 @@ private function prepareClient(?array $authData = null): void
}

/**
* @param string $url
* @param string $method
*
* @return array
* @throws \Immoscout\Exceptions\ApiException
* Sends the api request to ImmoScout24
*/
protected function request(string $url, string $method = 'GET'): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Immoscout/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Contact extends ApiRequest
*/
public function getAll(): array
{
return $this->request('user/me/contact/');
return $this->request('user/me/contact');
}

/**
Expand Down

0 comments on commit 8366b17

Please sign in to comment.