ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Refinery\IsExecutableTransformation Class Reference

Validates that the given string is a valid and executable file path. More...

+ Inheritance diagram for ILIAS\Refinery\IsExecutableTransformation:
+ Collaboration diagram for ILIAS\Refinery\IsExecutableTransformation:

Public Member Functions

 __construct (private readonly Language $lng)
 
 accepts ($value)
 Tells if the provided value complies. More...
 
 getError ()
 
- Public Member Functions inherited from ILIAS\AdvancedMetaData\Services\ObjectModes\Custom\Custom\Constraint
 __construct (callable $is_ok, $error, Data\Factory $data_factory, \ILIAS\Language\Language $lng)
 If $error is a callable it needs to take two parameters: More...
 
 check ($value)
 
 accepts ($value)
 
 problemWith ($value)
 
 applyTo (Result $result)
 
- Public Member Functions inherited from ILIAS\Refinery\Constraint
 withProblemBuilder (callable $builder)
 Get a constraint like this one with a builder for a custom error message. More...
 
- Public Member Functions inherited from ILIAS\Refinery\Transformation
 transform ($from)
 Perform the transformation. More...
 
 __invoke ($from)
 Transformations should be callable. More...
 

Private Attributes

 $error = 'The value MUST specify an executable path.'
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\AdvancedMetaData\Services\ObjectModes\Custom\Custom\Constraint
 getError ()
 
- Protected Attributes inherited from ILIAS\AdvancedMetaData\Services\ObjectModes\Custom\Custom\Constraint
Data Factory $data_factory
 
ILIAS Language Language $lng
 
 $is_ok
 
 $error
 

Detailed Description

Validates that the given string is a valid and executable file path.

Definition at line 28 of file IsExecutableTransformation.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Refinery\IsExecutableTransformation::__construct ( private readonly Language  $lng)

Definition at line 35 of file IsExecutableTransformation.php.

36  {
37  }

Member Function Documentation

◆ accepts()

ILIAS\Refinery\IsExecutableTransformation::accepts (   $value)

Tells if the provided value complies.

Parameters
mixed$value
Returns
bool

Implements ILIAS\Refinery\Constraint.

Definition at line 39 of file IsExecutableTransformation.php.

39  : bool
40  {
41  return is_string($value) && is_executable($value);
42  }

◆ getError()

ILIAS\Refinery\IsExecutableTransformation::getError ( )

Field Documentation

◆ $error

ILIAS\Refinery\IsExecutableTransformation::$error = 'The value MUST specify an executable path.'
private

The documentation for this class was generated from the following file: