{"repo":"nicoSWD/php-rule-parser","free":true,"listed":false,"github":"https://github.com/nicoSWD/php-rule-parser","clone":"git clone https://github.com/nicoSWD/php-rule-parser.git","description":"PHP Rule Engine - Parses & Evaluates JavaScript-like expressions","language":"PHP","stars":130,"topics":["evaluator","rule-engine","parser","rule-parser","rule-system","brms","business-rules","dsl","workflow","php-rule-engine"],"license":"MIT","category":"workflow-automation","readme_excerpt":"PHP Rule Engine [![Code Quality][Master quality image]][Master quality] A PHP library that parses and evaluates boolean expressions using a JavaScript-like syntax. It supports variables, comparison and logical operators, arithmetic, regular expressions, arrays, string methods, and function calls, all from plain text rules. Install Via Composer Usage Examples E-commerce: Validate coupon eligibility Access control: Check user permissions Pricing: Calculate order total with conditions Form validation: Check input constraints Notification routing: Target specific users Feature flags: Roll out features gradually String manipulation: Format user data Object method calls: Evaluate complex conditions Arithmetic: Operator precedence Arithmetic: Unary operators [!NOTE] For security reasons, PHP's magic methods like construct and destruct cannot be called from within rules. However, call will be invoked automatically if available, unless the called method is defined. Built-in Methods Name Example ----------- ------------------------ charAt \"foo\".charAt(2) === \"o\" concat \"foo\".concat(\"bar\", \"baz\") === \"foobarbaz\" endsWith \"foo\".endsWith(\"oo\") startsWith \"foo\".startsWith(\"fo\") indexOf \"foo\".indexOf(\"oo\") === 1 join [\"foo\", \"bar\"].join(\",\") === \"foo,bar\" replace \"foo\".replace(\"oo\", \"aa\") === \"faa\" split \"foo-bar\".split(\"-\") === [\"foo\", \"bar\"] substr \"foo\".substr(1) === \"oo\" test \"foo\".test(/oo$/) toLowerCase \"FOO\".toLowerCase() === \"foo\" toUpperCase \"foo\".toUpperCase() === \"FOO\" Built-in F","default_branch":null,"files":null,"tree":[],"storefront":"/r/nicoSWD","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/nicoSWD/php-rule-parser/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}