File manager - Edit - /var/www/payraty/helpdesk/app/Services/Triggers/Conditions/PrimitiveValuesComparator.php
Back
<?php namespace App\Services\Triggers\Conditions; use Illuminate\Support\Str; class PrimitiveValuesComparator { /** * Compare string haystack and needle using specified operator. */ public function compare(mixed $haystack, mixed $needle, string $operator): bool { return match ($operator) { 'contains' => Str::contains($haystack, $needle), 'not_contains' => ! Str::contains($haystack, $needle), 'starts_with' => Str::startsWith($haystack, $needle), 'ends_with' => Str::endsWith($haystack, $needle), 'equals', 'is' => $haystack === $needle, 'not_equals', 'not' => $haystack !== $needle, 'more' => $haystack > $needle, 'less' => $haystack < $needle, 'matches_regex' => (bool) preg_match("/$needle/", $haystack), default => false, }; } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings