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

@internal marked classes is inaccessible from another namespaces #1655

Closed
russelomua opened this issue Dec 4, 2023 · 4 comments
Closed

@internal marked classes is inaccessible from another namespaces #1655

russelomua opened this issue Dec 4, 2023 · 4 comments

Comments

@russelomua
Copy link

How do you use Sentry?

Sentry SaaS (sentry.io)

SDK version

4.0+

Steps to reproduce

Creating client with ClientBuilder::create([]) is failing psalm inspection with error InternalClass.

Also try to create implementations by myself and is fail too because PayloadSerializer, HttpClient and HttpTransport also maked as @internal

$options = new Options([]);
$client = new Client(
    options: $options,
    transport: new HttpTransport(
        options: $options,
        httpClient: new HttpClient(Client::SDK_IDENTIFIER, CLient::SDK_VERSION),
        payloadSerializer: new PayloadSerializer($options),
        logger: $logger,
    ),
    logger: $logger,
);
$hub = new Hub($client);

Please give an alternative way to create a client for framework agnostic or custom frameworks projects without using singleton pattern via\Sentry\init([])

Expected result

Psaml inspection completes without errors

Actual result

ERROR: InternalClass - {projectClass}.php - Sentry\ClientBuilder is internal to Sentry but called from {projectClass} (see https://psalm.dev/174)
@cleptric
Copy link
Member

cleptric commented Dec 4, 2023

You can ignore these in your local psalm config https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#suppressing-issues.

@nicolashohm
Copy link

nicolashohm commented Dec 15, 2023

We have the same problem. Can you please explain why ClientBuilder is now @internal?

@cleptric
Copy link
Member

#1661

@cleptric
Copy link
Member

Shipped in 4.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants