PHP code example of digicomp / settingvalidator

1. Go to this page and download the library: Download digicomp/settingvalidator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

digicomp / settingvalidator example snippets


/**
 * @Flow\Validate(type="DigiComp.SettingValidator:Settings", options={"name"="MyNamedValidator"})
 * @var MyObject
 */
protected MyObject $myObject;

/**
 * @Flow\Validate(type="DigiComp.SettingValidator:Settings")
 * @var MyObject
 */
protected MyObject $myObject;

/**
 * @Flow\Validate(type="My.Package:SomeValidator", options={"myOption"="myOptionValue"})
 * @Flow\Validate(type="My.Package:SomeOtherValidator")
 * @var MyObject
 */
protected MyObject $myObject;

/**
 * @Flow\Validate(type="DigiComp.SettingValidator:Settings", options={"name"="MyNamedValidator"})
 * @var MyObject
 */
protected MyObject $myObject;

/**
 * @Flow\Validate(argumentName="myObject", type="My.Package:SomeValidator", options={"myOption"="myOptionValue"})
 * @Flow\Validate(argumentName="myObject", type="My.Package:SomeOtherValidator")
 * @param MyObject $myObject
 */
public function myAction(MyObject $myObject)
{
    ...
}

/**
 * @Flow\Validate(argumentName="myObject", type="DigiComp.SettingValidator:Settings", options={"name"="MyNamedValidator"})
 * @param MyObject $myObject
 */
public function myAction(MyObject $myObject)
{
    ...
}

/**
 * @Flow\Validate(argumentName="myObject", type="DigiComp.SettingValidator:Settings", options={"name"="MyNamedValidator"})
 * @param MyObject $myObject
 */
public function myAction(MyObject $myObject)
{
    ...
}