Download the PHP package gathercontent/config-value-object without Composer
On this page you can find all versions of the php package gathercontent/config-value-object. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gathercontent/config-value-object
More information about gathercontent/config-value-object
Files in gathercontent/config-value-object
Package config-value-object
Short Description Validate item config for GatherContent
License
Informations about the package config-value-object
Config Value Object
Ensure the config adheres to the rules.
Requirements
- PHP 5.3.0 or later (recommend at least PHP 7.1)
Installation
Run the following command inside your repository:
Usage
The code above will throw ConfigValueException
if the config does not adhere to the rules.
The rules
The config is an array of tabs. It must have at least one tab.
An example of valid config:
Tab structure:
Must be an object. All attributes are required. No additional attributes are allowed.
Element structure
Allowed element types:
text
files
section
choice_radio
choice_checkbox
All elements must be objects. All attributes are required. No additional attributes are allowed.
Type text
:
Type files
:
Type section
:
Type choice_radio
:
At least two options required if other_option
is true
.
Type choice_checkbox
:
Option structure
All options must be objects. All attributes are required. No additional attributes are allowed.
Most options will look like this:
The only exception is the last option for choice_radio
element if the other_option
attribute is true
:
The value
attribute for "other" option must be empty if the option is not selected.
choice_radio
must not have more than one option selected.
Testing
Run unit tests:
Test compliance with PSR2 coding style guide: