Skip to content

Commit

Permalink
Merge pull request #24 from jolicode/feat/jane-7.6-upgrade
Browse files Browse the repository at this point in the history
Upgrade to Jane 7.6
  • Loading branch information
xavierlacot authored Mar 29, 2024
2 parents 63addf1 + a26144b commit ee45e5c
Show file tree
Hide file tree
Showing 172 changed files with 10,770 additions and 3,988 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@ jobs:
uses: actions/checkout@v2

- name: Cache composer
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.composer/cache/
key: composer-ubuntu-${{ github.sha }}

- name: Setup
uses: shivammathur/setup-php@2.9.0
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.3
extensions: mbstring, fileinfo, json, intl, dom
tools: castor

- name: Run composer install
run: composer install -n --prefer-dist

- name: 'php-cs-fixer check'
run: 'vendor/bin/php-cs-fixer fix --dry-run --diff'
env:
PHP_CS_FIXER_IGNORE_ENV: 1
- name: Install qa tooling
run: castor qa:update

- name: Check coding standards
run: castor qa:cs --dry-run
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Castor
/.castor.stub.php

# Composer
composer.lock
composer.phar
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changes between versions

## 7.0.0 (2024-03-29)

* upgrade to `janephp/open-api` 7.6
* drop support for PHP <8.1
* switch to [Castor](https://castor.jolicode.com/) for the project tooling

## 6.0.1 (2022-10-06)

* fixed the `updated_by_id` property name in the `Assignment` model (see https://github.com/jolicode/forecast-php-api/pull/23)

## 6.0.0 (2022-08-03)

* upgrade to `janephp/open-api` 7.3
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Use [PHP CS fixer](http://cs.sensiolabs.org/) to make your code compliant with
our coding standards:

```shell
make cs
castor qa:cs
```

## Keeping your fork up-to-date
Expand Down
17 changes: 0 additions & 17 deletions Makefile

This file was deleted.

35 changes: 35 additions & 0 deletions castor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

/*
* This file is part of JoliCode's Forecast PHP API project.
*
* (c) JoliCode <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace sdk;

use Castor\Attribute\AsTask;

use function Castor\exit_code;
use function Castor\import;
use function Castor\io;

import(__DIR__.'/tools/php-cs-fixer/castor.php');

#[AsTask(description: 'Re-generates the SDK using the local specification')]
function generate(): int
{
io()->comment('Generating the SDK using Jane OpenAPI...');
$result = exit_code('./vendor/bin/jane-openapi generate -c .jane-openapi.php');

if (0 !== $result) {
io()->error('An error occurred while generating the SDK.');
} else {
io()->success('Successfully generated the SDK');
}

return $result;
}
16 changes: 10 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@
}
},
"require": {
"php": ">=7.4",
"jane-php/open-api-runtime": "^7.1",
"php": ">=8.1",
"jane-php/open-api-runtime": "^7.6",
"php-http/client-implementation": "*",
"php-http/client-common": "^1.9 || ^2.0"
},
"require-dev": {
"jane-php/open-api-3": "^7.1",
"symfony/http-client": "^5.4 || ^6.0",
"nyholm/psr7": "^1.3",
"friendsofphp/php-cs-fixer": "^3.2"
"jane-php/open-api-3": "^7.6",
"symfony/http-client": "^5.4 || ^6.0|| ^7.0",
"nyholm/psr7": "^1.6"
},
"config": {
"allow-plugins": {
"php-http/discovery": true
}
}
}
7 changes: 6 additions & 1 deletion doc/updating-sdk.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Updating the SDK

> [!NOTE]
> The tooling for this project uses [Castor](https://castor.jolicode.com/),
> a full-featured PHP task runner. In order to install Castor, see the
> [installation instructions](https://castor.jolicode.com/getting-started/installation/).
## Edit the API specification

First, edit the [Forecast OpenAPI specification](../Resources/forecast-openapi.yaml).
Expand All @@ -11,7 +16,7 @@ If you are uncomfortable with OpenAPI, please read
When the OpenAPI specification has been updated, please regenerate the SDK code:

```bash
make update_sdk
castor generate
```

Please do not change manually code in the `generated` folder, as this would
Expand Down
Loading

0 comments on commit ee45e5c

Please sign in to comment.