-
Notifications
You must be signed in to change notification settings - Fork 665
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
Allow to implement custom taint type classes #10736
base: 5.x
Are you sure you want to change the base?
Conversation
402317b
to
d464f6a
Compare
The failing BC tests are handled code-wise in those methods
|
d464f6a
to
4a86f64
Compare
src/Psalm/Issue/TaintTypeFactory.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps move it out of Psalm/Issue
namespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm undecided here... TaintTypeFactory
creates those TaintedInput
instances and probably should stay in the same namespace. However, the TaintTypeRegistry
is closer to Psalm\Config
and might be moved up as Psalm\TaintTypeRegistry
. What do you think?
4a86f64
to
9766b44
Compare
6eb590e
to
208566f
Compare
cc0e23c
to
c558108
Compare
Instead of just having a generic `TaintedCustom` for custom taint - this change allows plugins/extensions to register their own custom taint type classes. Examples ``` $registry = Config::getInstance()->taint_kind_registry; $registry->defineKinds([ 'mine' => \Example\Package\TaintedMine::class, 'yours' => \Example\Package\TaintedYours::class, ], TaintKindGroup::GROUP_INPUT); $registry->defineGroup('my-input', 'html', 'sql', 'shell'); $registry->defineGroupProxy('input-sql', 'input', [ 'sql' => \Example\Package\TaintedSqlSecondOrder::class, ]); $registry->getKind('html'); // returns TaintedHtml::class; $registry->getGroupKinds('input'); // returns ['html', 'sql', ...] ```
c558108
to
126a4b8
Compare
Instead of just having a generic
TaintedCustom
for custom taint - this change allows plugins/extensions to register their own custom taint type classes.Examples
Fixes: #9186
TODO
input
inTaintKindGroup