LimeSurvey: master 7000f506

Author Committer Branch Timestamp Parent
twilllig GitHub master 2024-02-28 10:20 master b080dc3f
Changeset

QE-775 add validation options to transformer (QE-588) (#3757)

    • moved validation to validateOperation function and return errors in response
    • moved validation to validateOperation function and return errors in response
  • fixed failing unit tests

  • fixed number of lines in function

  • fixed psalm issues

  • fixed more psalm issues

  • fixed more psalm issues

  • fixed more psalm issues

  • added unit tests for opHandler validation

  • throw NotFoundException for empty props + removed stacktrace from response

  • add user friendly message to response, rename ErronousOperation to ExceptionError

  • fix codeformat

  • added unit test for structure of response

  • QE-777 - add field name to the validation response

  • add basic registry in DI

  • add basic registry in DI

  • added first batch of validators

  • fixed unit tests

  • refactored normaliseConfig to respective validation classes

  • inject ValidatorRegistry with DI annotations

  • rename function

  • numerical validation

  • regex validation

  • handle psalm issue

  • DateValidator

  • Fix unit test and psalm issue

  • Formatters are now part of the registry

  • fix code style

  • fix psalm issues

  • allow simple validation as array value instead of key in config

  • add Filter class

  • codestyle fixes

  • psalm issues

  • psalm issues

  • psalm issues

  • psalm issues

  • added validation config to answer transformers

  • added validation config to question transformer

  • all remaining transformers

  • fix unit test after merge

  • unit tests for validators

  • unit tests for remaining formatter and filter

  • Refactor normalise function calls into formatters and validators

  • psalm issue

  • psalm issue

  • psalm issues

  • psalm issues

  • Rename namespace and validator classes, reorganize use statements

  • cleanup interfaces for formatter and validator

  • psalm issues

  • psalm issues

  • moved formatting and filtering out of registry class

  • moved validating out of registry class

  • psalm issues

  • line lengths and naming convention

  • Dev: Fix code.length config in Transformer/Input/TransformerInputAnswer


Co-authored-by: Kevin Foster kevin.foster.uk@gmail.com

mod - .gitignore Diff File
mod - application/libraries/Api/Command/V1/SurveyPatch/Response/ExceptionErrorItem.php Diff File
mod - application/libraries/Api/Command/V1/SurveyPatch/Response/ValidationErrorItem.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Input/TransformerInputAnswer.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Input/TransformerInputAnswerL10ns.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Input/TransformerInputQuestion.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Input/TransformerInputQuestionAggregate.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Input/TransformerInputQuestionGroup.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Input/TransformerInputQuestionGroupAggregate.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Input/TransformerInputQuestionGroupReorder.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Input/TransformerInputQuestionL10ns.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Input/TransformerInputSubQuestion.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Input/TransformerInputSubQuestionAggregate.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Input/TransformerInputSubQuestionL10ns.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Input/TransformerInputSurvey.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Input/TransformerInputSurveyLanguageSettings.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputQuestion.php Diff File
mod - application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputSurvey.php Diff File
add - application/libraries/Api/Transformer/Filter/Filter.php Diff File
mod - application/libraries/Api/Transformer/Formatter/FormatterDateTimeToJson.php Diff File
mod - application/libraries/Api/Transformer/Formatter/FormatterIntToBool.php Diff File
mod - application/libraries/Api/Transformer/Formatter/FormatterInterface.php Diff File
mod - application/libraries/Api/Transformer/Formatter/FormatterMandatory.php Diff File
mod - application/libraries/Api/Transformer/Formatter/FormatterYnToBool.php Diff File
add - application/libraries/Api/Transformer/Registry/Registry.php Diff File
mod - application/libraries/Api/Transformer/Transformer.php Diff File
add - application/libraries/Api/Transformer/Validator/ValidatorDate.php Diff File
add - application/libraries/Api/Transformer/Validator/ValidatorEmpty.php Diff File
add - application/libraries/Api/Transformer/Validator/ValidatorInterface.php Diff File
add - application/libraries/Api/Transformer/Validator/ValidatorLength.php Diff File
add - application/libraries/Api/Transformer/Validator/ValidatorNull.php Diff File
add - application/libraries/Api/Transformer/Validator/ValidatorNumerical.php Diff File
add - application/libraries/Api/Transformer/Validator/ValidatorRange.php Diff File
add - application/libraries/Api/Transformer/Validator/ValidatorRegex.php Diff File
add - application/libraries/Api/Transformer/Validator/ValidatorRequired.php Diff File
mod - application/libraries/DI.php Diff File
mod - composer.json Diff File
mod - tests/unit/api/opHandlers/OpHandlerLanguageSettingsTest.php Diff File
mod - tests/unit/api/opHandlers/OpHandlerQuestionAttributeUpdateTest.php Diff File
mod - tests/unit/api/opHandlers/OpHandlerQuestionCreateTest.php Diff File
mod - tests/unit/api/opHandlers/OpHandlerQuestionGroupL10nTest.php Diff File
mod - tests/unit/api/opHandlers/OpHandlerQuestionGroupReorderTest.php Diff File
mod - tests/unit/api/opHandlers/OpHandlerQuestionGroupTest.php Diff File
mod - tests/unit/api/opHandlers/OpHandlerQuestionL10nTest.php Diff File
mod - tests/unit/api/opHandlers/OpHandlerQuestionUpdateTest.php Diff File
mod - tests/unit/api/opHandlers/OpHandlerSubquestionUpdateTest.php Diff File
mod - tests/unit/api/opHandlers/OpHandlerSurveyUpdateTest.php Diff File
mod - tests/unit/api/transformer/TransformerInputQuestionGroupReorderTest.php Diff File
mod - tests/unit/api/transformer/TransformerTest.php Diff File
add - tests/unit/api/transformer/filter/FilterTest.php Diff File
add - tests/unit/api/transformer/formatter/FormatterDateTest.php Diff File
mod - tests/unit/api/transformer/formatter/FormatterIntToBoolTest.php Diff File
add - tests/unit/api/transformer/formatter/FormatterMandatoryTest.php Diff File
mod - tests/unit/api/transformer/formatter/FormatterYnToBoolTest.php Diff File
add - tests/unit/api/transformer/validators/ValidatorDateTest.php Diff File
add - tests/unit/api/transformer/validators/ValidatorEmptyTest.php Diff File
add - tests/unit/api/transformer/validators/ValidatorLengthTest.php Diff File
add - tests/unit/api/transformer/validators/ValidatorNullTest.php Diff File
add - tests/unit/api/transformer/validators/ValidatorNumericalTest.php Diff File
add - tests/unit/api/transformer/validators/ValidatorRangeTest.php Diff File
add - tests/unit/api/transformer/validators/ValidatorRegexTest.php Diff File
add - tests/unit/api/transformer/validators/ValidatorRequiredTest.php Diff File
mod - vendor/composer/autoload_psr4.php Diff File
mod - vendor/composer/autoload_static.php Diff File
mod - vendor/composer/include_paths.php Diff File
mod - vendor/composer/installed.php Diff File
add - vendor/doctrine/annotations/LICENSE Diff File
add - vendor/doctrine/annotations/composer.json Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attributes.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/NamedArgumentConstructor.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Required.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Target.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/NamedArgumentConstructorAnnotation.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PhpParser.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php Diff File
add - vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php Diff File
add - vendor/doctrine/annotations/psalm.xml Diff File
add - vendor/doctrine/deprecations/LICENSE Diff File
add - vendor/doctrine/deprecations/composer.json Diff File
add - vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php Diff File
add - vendor/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php Diff File
add - vendor/doctrine/lexer/LICENSE Diff File
add - vendor/doctrine/lexer/composer.json Diff File
add - vendor/doctrine/lexer/src/AbstractLexer.php Diff File
add - vendor/doctrine/lexer/src/Token.php Diff File