Skip to content

Commit

Permalink
Fix php version (#18)
Browse files Browse the repository at this point in the history
* Add basic Phan configuration

* Use the Digitalist namespace instead of 'vendor'

* Ensure we form the URI correctly

The version shoudl be v1 instead of 1.0.0 and the leading / in the path
caused guzzle to drop the v1 part, so remove that.

* Latest versions of all the openapi/swagger files from SDG

* Move all the generated code from the Vendor to Digitalist namespace

* Ignore vim cache files

* PHPStorm .idea directory at .gitignore

* Regenerate SDG client with lowercase startDate/endDate parameters as the API rejects the request otherwise

* Add the generated code for the feedback data.

Some multiline strings in the YAML-file needed to be quoted or jane
failed to parse them.

* Remove leading slashes from URIs as those break the guzzle calls

* Reduce duplication in SDGClient facade class

* Ensure we pass back helpful return values from calling
StatisticsInformation.

The generated class just returns null regardless of what the API
returns, which isn't great. This commit adds an override that returns
the status and body.

While we're adding overrides, might as well add one that strips of the
leading slash from the URI, meaning we don't need to drop that manually
after re-generation. Thus I'm also adding it back to the generated code.

* Pass in apiKey as an argument.

If we're doing reporting for several sites, we might need different api
keys in the same environment, so it's better to leave it up to the
caller where to get the api key.

* Set correct prod url

* Add method exposing the request body of StatisticsInformation requests.

* test

* Small note before open sourcing

* Create LICENSE.md

* Create LICENSE

* Prep composer file for packagist (#12)

* Prep composer file for packagist

* Remove old reference

* Update symfony/serializer 5.2.3 => 5.4.3

* Composer update.

* Update Jane-php

* Generate new files

* Remove unused License file and add PHP requirement

* Update Jane-php

* Generate new files

* Remove unused License file and add PHP requirement

* Composer update and gitignore

* Updated SDGClient and testfile

* Patched generated file becuase of some bug, check patch file for more info. Following issue queue for jane-php.

* Fixed guzzlehttp to correct version.

* Need to use same PHP as Matomo Composer Platform specifies

* Restore to a working version of sdg-php-client

* Restore composer.lock to working version

* No need for patch any more

* Add licence to files and update readme

Co-authored-by: Claes 'Letharion' Gyllensvärd <[email protected]>
Co-authored-by: Alfonso <[email protected]>
Co-authored-by: Toni Barberà Melià <[email protected]>
Co-authored-by: Toni Barberà <[email protected]>
Co-authored-by: Mikke Schirén <[email protected]>
  • Loading branch information
6 people authored May 16, 2022
1 parent d0cf2bb commit 265857d
Show file tree
Hide file tree
Showing 72 changed files with 956 additions and 2,185 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ This project is Open Source and you may use it and change it.

We are using this project to connect Matomo to SDG.

## How to use

Check out example file, run it like so:
```
$ php ./src/getUniqueId.php
```
6 changes: 6 additions & 0 deletions SDG-Api-build/janeconf-feedback-quality-survey.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php
/**
* Digitalist Sweden AB - GPL 3.0 or later
*
* @link https://digitalist.se
* @license https://github.com/digitalist-se/sdg-php-client/blob/main/LICENSE
*/

return [
'openapi-file' => __DIR__ . '/feedback-quality-survey.yml',
Expand Down
6 changes: 6 additions & 0 deletions SDG-Api-build/janeconf-feedback-quality.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php
/**
* Digitalist Sweden AB - GPL 3.0 or later
*
* @link https://digitalist.se
* @license https://github.com/digitalist-se/sdg-php-client/blob/main/LICENSE
*/

return [
'openapi-file' => __DIR__ . '/feedback-quality.yml',
Expand Down
6 changes: 6 additions & 0 deletions SDG-Api-build/janeconf-statistics-information.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php
/**
* Digitalist Sweden AB - GPL 3.0 or later
*
* @link https://digitalist.se
* @license https://github.com/digitalist-se/sdg-php-client/blob/main/LICENSE
*/

return [
'openapi-file' => __DIR__ . '/statistics-information.yml',
Expand Down
6 changes: 6 additions & 0 deletions SDG-Api-build/janeconf-unique-id.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php
/**
* Digitalist Sweden AB - GPL 3.0 or later
*
* @link https://digitalist.se
* @license https://github.com/digitalist-se/sdg-php-client/blob/main/LICENSE
*/

return [
'openapi-file' => __DIR__ . '/unique-id.yml',
Expand Down
15 changes: 11 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,21 @@
"role": "Product Lead"
}
],
"config": {
"platform": {
"php": "7.3"
},
"prepend-autoloader": false,
"sort-packages": true
},
"require": {
"php": ">=8.0",
"jane-php/open-api-runtime": "^7.2.2",
"guzzlehttp/guzzle": "^2.2.1",
"php": "^7.3",
"jane-php/open-api-runtime": "~6.1.0",
"guzzlehttp/guzzle": "^7.2",
"laminas/laminas-diactoros": "^2.5"
},
"require-dev": {
"jane-php/open-api-3": "^7.2.2",
"jane-php/open-api-3": "~6.1.0",
"phan/phan": "^3.2"
},
"extra": {
Expand Down
Loading

0 comments on commit 265857d

Please sign in to comment.