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

Feature request: Unmark Context as internal #29

Closed
jakubboucek opened this issue Oct 21, 2020 · 0 comments
Closed

Feature request: Unmark Context as internal #29

jakubboucek opened this issue Oct 21, 2020 · 0 comments

Comments

@jakubboucek
Copy link

Class \Nette\Schema\Context is marked as @internal.

/**
* @internal
*/
final class Context

It causes that I cannot make custom validator object because the ->normalize() method requires Context instance in argument declared by \Nette\Schema\Schema interface.

PhpStorm is here firing inspection warning:

Class 'Context' is marked as @internal  
Inspection info: Reports the usages of the entities that are marked as @internal.
In most cases, such usages should be removed or replaced with other constructs.

In addition Context is not fully internal, because custom validators need it for for collecting validation errors. I didn't found possibility to do it with more clean way.

Example of use:
https://github.com/redbitcz/subreg-api-php/blob/60f377ac68f3c1871b926eca336f5eb8d3368455/src/Schema/DateTime.php#L44-L64

Suggest to feature

Unmark \Nette\Schema\Context as internal.

I understand the Context class has currently too open public interface which is potentially sensitive. Maybe move collecting errors to more specifics object which will not be @internal marked.

@dg dg closed this as completed in c6536e2 Dec 15, 2020
dg added a commit that referenced this issue Dec 17, 2020
jakubboucek added a commit to redbitcz/subreg-api-php that referenced this issue Dec 21, 2020
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

No branches or pull requests

1 participant