febius/surveyjs-php-sdk

Survey Js JSON schema parser and modelling sdk

2.1.4 2020-11-05 09:00 UTC

README

Build Status Latest Stable Version License

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.