febius / surveyjs-php-sdk
Survey Js JSON schema parser and modelling sdk
Installs: 26 049
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 2
Open Issues: 0
Requires
- php: >=7.1.0
- ext-json: *
Requires (Dev)
- phpstan/phpstan: ^0.9.1
- phpunit/php-code-coverage: ^5.3
- phpunit/phpunit: ^6.5
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2025-05-05 20:07:58 UTC
README
SurveyJS PHP SDK
Provides a way to model through PHP the JSON created by SurveyJS.
Installation
You can install the library and its dependencies using composer
running:
$ composer require febius/surveyjs-php-sdk
Usage
The library allows to return a model per each Survey element (comment, checkbox, etc...).
Example
The following snippet is extracted from the example/sample.php file and shows how parsing a JSON
// [Add comment]
[Add Code]
Survey Element(s)
A RatingElement instance allows to map a single Rating element and to return information as follows:
[Add snippet] TDB
Development
The environment requires phpunit, that has been already included in the dev-dependencies
of the
composer.json
.
Dependencies
To install all modules you just need to run following command:
$ composer install
Testing
Tests files are created in dedicates folders that replicate the src structure as follows:
.
+-- src
| +-- [folder-name]
| | +-- [file-name].php
| ...
+-- tests
| +-- [folder-name]
| | +-- [file-name]Test.php
Execute following command to run the tests suite:
$ composer test
Run what follows to see the code coverage:
$ composer coverage
License
This package is released under the MIT license.