Skip to content

Commit 7e36c8d

Browse files
committed
Merge branch 'master' of https://github.com/bobthecow/Ruler
2 parents 8fb555e + 37c6566 commit 7e36c8d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.markdown

+10-10
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Things you can do with your Ruler
7777
```php
7878
<?php
7979

80-
// These are variables. They'll be replaced by terminal values during Rule evaluation.
80+
// These are Variables. They'll be replaced by terminal values during Rule evaluation.
8181

8282
$a = $rb['a'];
8383
$b = $rb['b'];
@@ -98,18 +98,18 @@ $a->notEqualTo($b); // true if $a != $b
9898
```php
9999
<?php
100100

101-
// Create a rule with an $a == $b condition
101+
// Create a Rule with an $a == $b condition
102102
$aEqualsB = $rb->create($a->equalTo($b));
103103

104-
// Create another rule with an $a != $b condition
104+
// Create another Rule with an $a != $b condition
105105
$aDoesNotEqualB = $rb->create($a->notEqualTo($b));
106106

107107
// Now combine them for a tautology!
108108
// (Because Rules are also Propositions, they can be combined to make MEGARULES)
109109
$eitherOne = $rb->create($rb->logicalOr($aEqualsB, $aDoesNotEqualB));
110110

111111
// Just to mix things up, we'll populate our evaluation context with completely
112-
// random variables...
112+
// random values...
113113
$context = new Context(array(
114114
'a' => rand(),
115115
'b' => rand(),
@@ -187,27 +187,27 @@ $hiEveryoneElse = $rb->create(
187187

188188
$rules = new RuleSet(array($hiJustin, $hiJon, $hiEveryoneElse));
189189

190-
// Let's add one more rule, so non-authenticated users have a chance to log in
190+
// Let's add one more Rule, so non-authenticated users have a chance to log in
191191
$redirectForAuthentication = $rb->create($rb->logicalNot($userIsLoggedIn), function() {
192192
header('Location: /login');
193193
exit;
194194
});
195195

196196
$rules->addRule($redirectForAuthentication);
197197

198-
// Now execute() all true rules.
198+
// Now execute() all true Rules.
199199
//
200-
// In this case, all of our rules are mutually exclusive so at most one of them will execute...
200+
// In this case, all of our Rules are mutually exclusive so at most one of them will execute...
201201
$rules->executeRules($context);
202202
```
203203

204204

205205
Dynamically populate your evaluation Context
206206
--------------------------------------------
207207

208-
Several of our examples above use static values for the context variables. While
208+
Several of our examples above use static values for the context Variables. While
209209
that's good for examples, it's not as useful in the Real World. You'll probably
210-
want to evaluate rules based on all sorts of things...
210+
want to evaluate Rules based on all sorts of things...
211211

212212
You can think of the Context as a ViewModel for Rule evaluation. You provide the
213213
static values, or even code for lazily evaluating the Variables needed by your
@@ -242,7 +242,7 @@ $context['orderCount'] = function() use ($em, $context) {
242242
};
243243
```
244244

245-
Now you have all the information you need to make rules based on Order count or
245+
Now you have all the information you need to make Rules based on Order count or
246246
the current User, or any number of other crazy things. I dunno, maybe this is
247247
for a shipping price calculator?
248248

0 commit comments

Comments
 (0)