source-class-Com.Tecnick.Unicode.Bidi.StepBase

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.
 1: <?php
 2: /**
 3:  * StepBase.php
 4:  *
 5:  * @since       2011-05-23
 6:  * @category    Library
 7:  * @package     Unicode
 8:  * @author      Nicola Asuni <info@tecnick.com>
 9:  * @copyright   2011-2015 Nicola Asuni - Tecnick.com LTD
10:  * @license     http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
11:  * @link        https://github.com/tecnickcom/tc-lib-unicode
12:  *
13:  * This file is part of tc-lib-unicode software library.
14:  */
15: 
16: namespace Com\Tecnick\Unicode\Bidi;
17: 
18: /**
19:  * Com\Tecnick\Unicode\Bidi\StepBase
20:  *
21:  * @since       2015-07-13
22:  * @category    Library
23:  * @package     Unicode
24:  * @author      Nicola Asuni <info@tecnick.com>
25:  * @copyright   2011-2015 Nicola Asuni - Tecnick.com LTD
26:  * @license     http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
27:  * @link        https://github.com/tecnickcom/tc-lib-unicode
28:  */
29: abstract class StepBase
30: {
31:     /**
32:      * Sequence to process and return
33:      *
34:      * @var array
35:      */
36:     protected $seq = array();
37: 
38:     /**
39:      * Initialize Sequence to process
40:      *
41:      * @param array $seq     Isolated Sequence array
42:      * @param bool  $process If false disable automatic processing (this is a testing flag)
43:      */
44:     public function __construct($seq, $process = true)
45:     {
46:         $this->seq = $seq;
47:         if ($process) {
48:             $this->process();
49:         }
50:     }
51: 
52:     /**
53:      * Returns the processed array
54:      *
55:      * @return array
56:      */
57:     public function getSequence()
58:     {
59:         return $this->seq;
60:     }
61: 
62:     /**
63:      * Process the current step
64:      */
65:     abstract protected function process();
66: 
67:     /**
68:      * Generic step
69:      *
70:      * @param string $method Processing methos
71:      */
72:     public function processStep($method)
73:     {
74:         for ($idx = 0; $idx < $this->seq['length']; ++$idx) {
75:             $this->$method($idx);
76:         }
77:     }
78: }
79: 
 

© 2004-2017 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy