generated from ccuffs/template-english
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,21 @@ | |
namespace CCUFFS\Text; | ||
|
||
/** | ||
* | ||
* Class to parse semi-structured text into structured-data that can be used to build questionnaires (forms). | ||
* The main goal is to allow end users to build dynamic forms, e.g. Google Forms, using plain text like they | ||
* would if the forms were to be printed on paper. | ||
* | ||
* @author Fernando Bevilacqua <[email protected]> | ||
* @license MIT | ||
*/ | ||
class PollFromText | ||
{ | ||
/** | ||
* @param mixed $text text to be parsed into a questionnaire | ||
* @param array $config specific configuration for this parsing, e.g. allow multiline questions. | ||
* | ||
* @return array associative array containing the structured questionnaire. | ||
*/ | ||
public static function make($text, array $config = []) { | ||
return (new PollFromText())->parse($text, $config); | ||
} | ||
|