Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dk/json api initialization #4002

Closed
wants to merge 51 commits into from
Closed

Dk/json api initialization #4002

wants to merge 51 commits into from

Conversation

luceos
Copy link
Member

@luceos luceos commented Jun 18, 2024

fix: json api instantiation fails

Currently the JsonApi is heavily used with methods forEndpoint and
forResource, these method set their respective properties, which have
no value initially. When instantiating the class, an "cannot access
before initialization" error because there's no default.

Typed property Flarum\Api\JsonApi::$endpointName must not be accessed before initialization

SychO9 and others added 21 commits March 8, 2024 14:39
# Conflicts:
#	extensions/likes/tests/integration/api/ListPostsTest.php
#	extensions/mentions/tests/integration/api/ListPostsTest.php
#	framework/core/src/Api/routes.php
#	framework/core/src/Discussion/UserState.php
#	framework/core/src/Extend/Settings.php
#	framework/core/tests/integration/extenders/ApiControllerTest.php
#	framework/core/tests/integration/extenders/ModelTest.php
#	framework/core/tests/integration/policy/DiscussionPolicyTest.php
Currently the JsonApi is heavily used with methods `forEndpoint` and
`forResource`, these method set their respective properties, which have
no value initially. When instantiating the class, an "cannot access
before initialization" error because there's no default.

```
Typed property Flarum\Api\JsonApi::$endpointName must not be accessed before initialization
```
@luceos luceos requested a review from SychO9 June 18, 2024 17:17
@luceos luceos requested a review from a team as a code owner June 18, 2024 17:17
@luceos luceos changed the base branch from 2.x to sm/json-api-server June 18, 2024 17:18
Base automatically changed from sm/json-api-server to 2.x June 21, 2024 08:36
@luceos luceos closed this Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants