Hey Yury,

The docs here where already updated a little:
https://github.com/wikimedia/mediawiki-extensions-Validator/#implementation-structure

> saw a lot of interesting fields in SMWParamFormat

Do not use SMWParamFormat as an example, its using highly deprecated code.
Try to stick to using the array definition syntax. Creating actual
instances of ParamDefinition is discouraged. Deriving from ParamDefinition
(as SMWParamFormat does) should not be done in new code.

The array definition schema currently does not support specifying
validation callbacks. Validation is typically done by specifying a
parameter type, such as integer, which then makes sure the values is valid
for that type.

You can define your own parameter types, see
Validator/config/DefaultConfig.php, which allows specifying a validation
callback per type. If the validation is not actually validation but making
sure the value can be interpreted, and thus part of the parsing process,
then you should specify a parser instead.

The basic array definition format is not going to break, and neither is the
result object structure you get back from the processor. Other things might
well be broken as ParamProcessor moves towards a better (and more stable to
the outside) design. So only do the more advanced things if you really need
to.

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to