4343class StepX
4444{
4545 /**
46- * Maximum embeding level
46+ * Maximum embedding level
4747 */
4848 public const MAX_DEPTH = 125 ;
4949
@@ -81,7 +81,7 @@ class StepX
8181 * Explicit Levels and Directions
8282 *
8383 * @param array<int> $ordarr Array of UTF-8 codepoints
84- * @param int $pel Paragraph embeding level
84+ * @param int $pel Paragraph embedding level
8585 */
8686 public function __construct (
8787 /**
@@ -90,7 +90,7 @@ public function __construct(
9090 protected array $ ordarr ,
9191 int $ pel
9292 ) {
93- // - Push onto the stack an entry consisting of the paragraph embeding level,
93+ // - Push onto the stack an entry consisting of the paragraph embedding level,
9494 // a neutral directional override status, and a false directional isolate status.
9595 $ this ->dss [] = [
9696 'ord ' => -1 , // dummy value, not used
@@ -99,9 +99,9 @@ public function __construct(
9999 'dis ' => false ,
100100 ];
101101 // - Process each character iteratively, applying rules X2 through X8.
102- // Only embeding levels from 0 through max_depth are valid in this phase.
102+ // Only embedding levels from 0 through max_depth are valid in this phase.
103103 // (Note that in the resolution of levels in rules I1 and I2,
104- // the maximum embeding level of max_depth+1 can be reached.)
104+ // the maximum embedding level of max_depth+1 can be reached.)
105105 $ this ->processX ();
106106 }
107107
@@ -226,14 +226,14 @@ protected function setDss(
226226 int $ ivic = 0
227227 ): void {
228228 // X2 to X5
229- // - Compute the least odd|even embeding level greater than the embeding level of the last entry
229+ // - Compute the least odd|even embedding level greater than the embedding level of the last entry
230230 // on the directional status stack.
231- // - If this new level would be valid, and the overflow isolate count and overflow embeding
232- // count are both zero, then this RLE is valid. Push an entry consisting of the new embeding
231+ // - If this new level would be valid, and the overflow isolate count and overflow embedding
232+ // count are both zero, then this RLE is valid. Push an entry consisting of the new embedding
233233 // level, neutral|left|right directional override status, and false directional isolate status onto the
234234 // directional status stack.
235235 // - Otherwise, this is an overflow RLE. If the overflow isolate count is zero, increment the
236- // overflow embeding |isolate count by one. Leave all other variables unchanged.
236+ // overflow embedding |isolate count by one. Leave all other variables unchanged.
237237 if (($ cel >= self ::MAX_DEPTH ) || ($ this ->oic != 0 ) || ($ this ->oec != 0 )) {
238238 if ($ isolate ) {
239239 ++$ this ->oic ;
@@ -285,7 +285,7 @@ protected function pushChar(int $pos, int $ord, array $edss): void
285285 protected function processChar (int $ pos , int $ ord , array $ edss ): void
286286 {
287287 // X6. For all types besides B, BN, RLE, LRE, RLO, LRO, PDF, RLI, LRI, FSI, and PDI:
288- // - Set the current character’s embeding level to the embeding level
288+ // - Set the current character’s embedding level to the embedding level
289289 // of the last entry on the directional status stack.
290290 // - Whenever the directional override status of the last entry on the directional status stack
291291 // is not neutral, reset the current character type according to the directional override
@@ -307,14 +307,14 @@ protected function processPdfCase(array $edss): void
307307 // X7. With each PDF, perform the following steps:
308308 // - If the overflow isolate count is greater than zero, do nothing. (This PDF is within the
309309 // scope of an overflow isolate initiator. It either matches and terminates the scope of an
310- // overflow embeding initiator within that overflow isolate, or does not match any
311- // embeding initiator.)
310+ // overflow embedding initiator within that overflow isolate, or does not match any
311+ // embedding initiator.)
312312 if ($ this ->oic > 0 ) {
313313 return ;
314314 }
315315
316- // - Otherwise, if the overflow embeding count is greater than zero, decrement it by one.
317- // (This PDF matches and terminates the scope of an overflow embeding initiator that is not
316+ // - Otherwise, if the overflow embedding count is greater than zero, decrement it by one.
317+ // (This PDF matches and terminates the scope of an overflow embedding initiator that is not
318318 // within the scope of an overflow isolate initiator.)
319319 if ($ this ->oec > 0 ) {
320320 --$ this ->oec ;
@@ -324,13 +324,13 @@ protected function processPdfCase(array $edss): void
324324 // - Otherwise, if the directional isolate status of the last entry on the directional status
325325 // stack is false, and the directional status stack contains at least two entries, pop the
326326 // last entry from the directional status stack. (This PDF matches and terminates the scope
327- // of a valid embeding initiator. Since the stack has at least two entries, this pop does
327+ // of a valid embedding initiator. Since the stack has at least two entries, this pop does
328328 // not leave the stack empty.)
329329 if (($ edss ['dis ' ] === false ) && (\count ($ this ->dss ) > 1 )) {
330330 \array_pop ($ this ->dss );
331331 }
332332
333- // - Otherwise, do nothing. (This PDF does not match any embeding initiator.)
333+ // - Otherwise, do nothing. (This PDF does not match any embedding initiator.)
334334 }
335335
336336 /**
@@ -357,13 +357,13 @@ protected function processPdiCase(int $pos, int $ord, array $edss): void
357357 }
358358
359359 // - Otherwise, this PDI matches a valid isolate initiator. Perform the following steps:
360- // - Reset the overflow embeding count to zero. (This terminates the scope of those overflow
361- // embeding initiators within the scope of the matched isolate initiator whose scopes have
360+ // - Reset the overflow embedding count to zero. (This terminates the scope of those overflow
361+ // embedding initiators within the scope of the matched isolate initiator whose scopes have
362362 // not been terminated by a matching PDF, and which thus lack a matching PDF.)
363363 $ this ->oec = 0 ;
364364 // - While the directional isolate status of the last entry on the stack is false, pop the
365365 // last entry from the directional status stack. (This terminates the scope of those valid
366- // embeding initiators within the scope of the matched isolate initiator whose scopes have
366+ // embedding initiators within the scope of the matched isolate initiator whose scopes have
367367 // not been terminated by a matching PDF, and which thus lack a matching PDF. Given that the
368368 // valid isolate count is non-zero, the directional status stack before this step is
369369 // executed must contain an entry with directional isolate status true, and thus after this
@@ -395,7 +395,7 @@ protected function processPdiCase(int $pos, int $ord, array $edss): void
395395
396396 // - In all cases, look up the last entry on the directional status stack left after the
397397 // steps above and:
398- // - Set the PDI’s level to the entry's embeding level.
398+ // - Set the PDI’s level to the entry's embedding level.
399399 // - If the entry's directional override status is not neutral, reset the current character type
400400 // from PDI to L if the override status is left-to-right, and to R if the override status is
401401 // right-to-left.
@@ -412,7 +412,7 @@ protected function processFsiCase(int $pos, array $edss): void
412412 {
413413 // X5c. With each FSI, apply rules P2 and P3 to the sequence of characters between the FSI and its
414414 // matching PDI, or if there is no matching PDI, the end of the paragraph, as if this sequence
415- // of characters were a paragraph. If these rules decide on paragraph embeding level 1, treat
415+ // of characters were a paragraph. If these rules decide on paragraph embedding level 1, treat
416416 // the FSI as an RLI in rule X5a. Otherwise, treat it as an LRI in rule X5b.
417417 $ stepp = new StepP (\array_slice ($ this ->ordarr , $ pos ));
418418 if ($ stepp ->getPel () == 0 ) {
0 commit comments