Skip to content

Commit

Permalink
Merge pull request #39 from jolicode/feature/jane-7.3-upgrade
Browse files Browse the repository at this point in the history
Upgrade to Jane 7.3
  • Loading branch information
xavierlacot authored Aug 4, 2022
2 parents a26cecf + 8ad91cd commit 25fceac
Show file tree
Hide file tree
Showing 400 changed files with 17,530 additions and 17,879 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
strategy:
max-parallel: 15
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0']
php-versions: ['7.4', '8.0', '8.1']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ composer.lock
composer.phar

# CS
.php_cs.cache
.php-cs-fixer.cache

# PHPUnit
.phpunit.result.cache

# Dependencies
Expand Down
35 changes: 18 additions & 17 deletions .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,35 @@
file that was distributed with this source code.
EOF;

return PhpCsFixer\Config::create()
$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude('doc')
;

return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'header_comment' => ['header' => $header],
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_unsets' => true,
'echo_tag_syntax' => ['format' => 'long'],
'header_comment' => ['header' => $header],
'heredoc_to_nowdoc' => true,
'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']],
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'heredoc_to_nowdoc' => true,
'php_unit_strict' => true,
'php_unit_construct' => true,
'php_unit_strict' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'strict_comparison' => true,
'strict_param' => true,
'no_extra_consecutive_blank_lines' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'],
'no_short_echo_tag' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'semicolon_after_instruction' => true,
'combine_consecutive_unsets' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('generated')
->exclude('vendor')
)
->setUsingCache(true)
->setFinder($finder)
;
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changes between versions

## 6.0.0 (2022-08-04)
 * upgrade to `janephp/open-api` 7.3
 * drop support for PHP <7.4
* updated the SDK based on the latest [spec updates](jolicode/harvest-openapi-generator#20)
* added `Company.currency_code_display` and `Company.currency_symbol_display`
* several fields of the `User` object have disappeared, due to the [API changes introduced in March](https://www.getharvest.com/blog/new-flexible-permissions#:~:text=The%20API%20has%20been%20updated%20to%20align%20with%20the%20new%20permissions%20features.).
## 5.2.0 (2022-01-10)

* upgraded `janephp/open-api` from 6.3 to 7.1 - thanks @jdrieghe
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
}
},
"require": {
"php": "^7.2 || ^8.0",
"jane-php/open-api-runtime": "^7.1",
"php": ">=7.4",
"jane-php/open-api-runtime": "^7.3",
"php-http/client-implementation": "*",
"php-http/client-common": "^1.7 || ^2.0"
"php-http/client-common": "^1.9 || ^2.0"
},
"require-dev": {
"jane-php/open-api-3": "^7.1",
"jane-php/open-api-3": "^7.3",
"symfony/http-client": "^5.4 || ^6.0",
"nyholm/psr7": "^1.3",
"friendsofphp/php-cs-fixer": "^2.18",
"friendsofphp/php-cs-fixer": "^3.2",
"symfony/phpunit-bridge": "^5.4 || ^6.0",
"symfony/yaml": "^5.4 || ^6.0"
}
Expand Down
19 changes: 16 additions & 3 deletions generated/Authentication/AccountAuthAuthentication.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
<?php

/*
* This file is part of JoliCode's Harvest 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 JoliCode\Harvest\Api\Authentication;

class AccountAuthAuthentication implements \Jane\Component\OpenApiRuntime\Client\AuthenticationPlugin
{
private $apiKey;

public function __construct(string $apiKey)
{
$this->{'apiKey'} = $apiKey;
}
public function authentication(\Psr\Http\Message\RequestInterface $request) : \Psr\Http\Message\RequestInterface

public function authentication(\Psr\Http\Message\RequestInterface $request): \Psr\Http\Message\RequestInterface
{
$request = $request->withHeader('Harvest-Account-Id', $this->{'apiKey'});

return $request;
}
public function getScope() : string

public function getScope(): string
{
return 'AccountAuth';
}
}
}
19 changes: 16 additions & 3 deletions generated/Authentication/BearerAuthAuthentication.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
<?php

/*
* This file is part of JoliCode's Harvest 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 JoliCode\Harvest\Api\Authentication;

class BearerAuthAuthentication implements \Jane\Component\OpenApiRuntime\Client\AuthenticationPlugin
{
private $apiKey;

public function __construct(string $apiKey)
{
$this->{'apiKey'} = $apiKey;
}
public function authentication(\Psr\Http\Message\RequestInterface $request) : \Psr\Http\Message\RequestInterface

public function authentication(\Psr\Http\Message\RequestInterface $request): \Psr\Http\Message\RequestInterface
{
$request = $request->withHeader('Authorization', $this->{'apiKey'});

return $request;
}
public function getScope() : string

public function getScope(): string
{
return 'BearerAuth';
}
}
}
Loading

0 comments on commit 25fceac

Please sign in to comment.