Skip to content

Commit e6ed966

Browse files
Merge branch 'master' into latest-codegen-master
2 parents df68ed6 + e81186f commit e6ed966

File tree

6 files changed

+40
-12
lines changed

6 files changed

+40
-12
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
php-cs-fixer:
2323
name: PHP-CS-Fixer
2424

25-
runs-on: ubuntu-latest
25+
runs-on: "ubuntu-24.04"
2626

2727
steps:
2828
- uses: actions/checkout@v3
@@ -35,7 +35,7 @@ jobs:
3535
phpstan:
3636
name: PHPStan
3737

38-
runs-on: ubuntu-latest
38+
runs-on: "ubuntu-24.04"
3939

4040
steps:
4141
- uses: extractions/setup-just@v2
@@ -68,7 +68,7 @@ jobs:
6868
run: just lint
6969

7070
tests:
71-
runs-on: ubuntu-latest
71+
runs-on: "ubuntu-24.04"
7272

7373
strategy:
7474
fail-fast: false
@@ -132,7 +132,7 @@ jobs:
132132
(github.event_name == 'workflow_dispatch' || github.event_name == 'push') &&
133133
startsWith(github.ref, 'refs/tags/v') &&
134134
endsWith(github.actor, '-stripe')
135-
runs-on: ubuntu-latest
135+
runs-on: "ubuntu-24.04"
136136
steps:
137137
- uses: actions/checkout@v2
138138
- uses: stripe/openapi/actions/notify-release@master

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
# Contributing
3+
4+
We welcome bug reports, feature requests, and code contributions in a pull request.
5+
6+
For most pull requests, we request that you identify or create an associated issue that has the necessary context. We use these issues to reach agreement on an approach and save the PR author from having to redo work. Fixing typos or documentation issues likely do not need an issue; for any issue that introduces substantial code changes, changes the public interface, or if you aren't sure, please find or [create an issue](https://www.github.com/stripe/stripe-php/issues/new/choose).
7+
8+
## Contributor License Agreement
9+
10+
All contributors must sign the Contributor License Agreement (CLA) before we can accept their contribution. If you have not yet signed the agreement, you will be given an option to do so when you open a pull request. You can then sign by clicking on the badge in the comment from @CLAassistant.
11+
12+
## Generated code
13+
14+
This project has a combination of manually maintained code and code generated from our private code generator. If your contribution involves changes to generated code, please call this out in the issue or pull request as we will likely need to make a change to our code generator before accepting the contribution.
15+
16+
To identify files with purely generated code, look for the comment `File generated from our OpenAPI spec.` at the start of the file. Generated blocks of code within hand-written files will be between comments that say `The beginning of the section generated from our OpenAPI spec` and `The end of the section generated from our OpenAPI spec`.
17+
18+
## Compatibility with supported language and runtime versions
19+
20+
This project supports [many different langauge and runtime versions](README.md#requirements) and we are unable to accept any contribution that does not work on _all_ supported versions. If, after discussing the approach in the associated issue, your change must use an API / feature that isn't available in all supported versions, please call this out explicitly in the issue or pull request so we can help figure out the best way forward.
21+
22+
## Set up your dev environment
23+
24+
Please refer to this project's [README.md](README.md#development) for instructions on how to set up your development environment.
25+

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ New features and bug fixes are released on the latest major version of the Strip
248248

249249
## Development
250250

251+
[Contribution guidelines for this project](CONTRIBUTING.md)
252+
251253
We use [just](https://github.com/casey/just) for conveniently running development tasks. You can use them directly, or copy the commands out of the `justfile`. To our help docs, run `just`.
252254

253255
To get started, install [Composer][composer]. For example, on Mac OS:

justfile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import? '../sdk-codegen/justfile'
2-
31
set quiet
42

3+
import? '../sdk-codegen/utils.just'
4+
55
# make vendored executables callable directly
66
export PATH := "vendor/bin:" + env_var('PATH')
77

@@ -26,10 +26,6 @@ ci-test autoload:
2626
format *args: install
2727
PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix -v --using-cache=no {{ args }}
2828

29-
# for backwards compatibility; ideally removed later
30-
[private]
31-
alias codegen-format := format
32-
3329
# check formatting for, but don't modify, files
3430
format-check: (format "--dry-run")
3531

lib/Util/Util.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static function convertToStripeObject($resp, $opts, $apiMode = 'v1')
6464
if (\array_key_exists('type', $resp) && \array_key_exists($resp['type'], $eventTypes)) {
6565
$class = $eventTypes[$resp['type']];
6666
} else {
67-
$class = \Stripe\StripeObject::class;
67+
$class = \Stripe\V2\Event::class;
6868
}
6969
}
7070
} elseif (\array_key_exists('data', $resp) && \array_key_exists('next_page_url', $resp)) {

lib/V2/Event.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@
33
namespace Stripe\V2;
44

55
/**
6+
* Base class for V2 events.
7+
*
8+
* This is concrete for use in our generated tests. Events returned from the \Stripe\V2\Core\EventService
9+
* will be a subtype of \Stripe\V2\Event.
10+
*
611
* @property string $id Unique identifier for the event.
712
* @property string $object String representing the object's type. Objects of the same type share the same value of the object field.
813
* @property int $created Time at which the object was created.
914
* @property \Stripe\StripeObject $reason Reason for the event.
1015
* @property string $type The type of the event.
1116
* @property null|string $context The Stripe account of the event
1217
*/
13-
abstract class Event extends \Stripe\ApiResource
18+
class Event extends \Stripe\ApiResource
1419
{
1520
const OBJECT_NAME = 'v2.core.event';
1621
}

0 commit comments

Comments
 (0)