ILIAS  trunk Revision v11.0_alpha-1838-g59fc79e306b
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
IsExecutableTransformation.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Refinery;
22 
24 
29 {
31 
33  private $error = 'The value MUST specify an executable path.';
34 
35  public function __construct(private readonly Language $lng)
36  {
37  }
38 
39  public function accepts($value): bool
40  {
41  return is_string($value) && is_executable($value);
42  }
43 
44  public function getError()
45  {
46  return $this->error;
47  }
48 }
Validates that the given string is a valid and executable file path.
accepts($value)
Tells if the provided value complies.
A constraint encodes some resrtictions on values.
Definition: Constraint.php:31
trait DeriveTransformWithProblem
This trait is a convenience trait which uses DeriveApplyToFromTransform, DeriveInvokeFromTransform an...