@@ -144,7 +144,7 @@ public function __construct($name = "")
144144     * 
145145     * @return TplBlock For chaining. 
146146     */ 
147-     public  function  addVars (array  $ vars
147+     public  function  addVars (array  $ vars : TplBlock 
148148    {
149149        $ this vars  = array_merge ($ this vars , $ vars
150150        return  $ this 
@@ -157,7 +157,7 @@ public function addVars(array $vars)
157157     * 
158158     * @return TplBlock For chaining. 
159159     */ 
160-     public  function  addSubBlock (TplBlock $ bloc
160+     public  function  addSubBlock (TplBlock $ bloc : TplBlock 
161161    {
162162        // An unnamed block cannot be a sub block. 
163163        if  ($ blocname  === "" ) {
@@ -171,19 +171,21 @@ public function addSubBlock(TplBlock $bloc)
171171        return  $ this 
172172    }
173173
174-     public  static  function  is_assoc ($ arr
174+     public  static  function  is_assoc ($ arrbool 
175+     {
175176        if (!is_array ($ arr
176177            return  false ;
177178        }
178179        return  array_keys ($ arrrange (0 , count ($ arr1 );
179180    }
181+     
180182    /** 
181183     * Automatically add subs blocs and sub sub blocs ..., and vars 
182184     * directly from an associative array 
183185     * @param $subBlocsDefinitions the associative array 
184186     * @return TplBlock For chaining. 
185187     */ 
186-     public  function  addSubBlocsDefinitions ($ subBlocsDefinitions
188+     public  function  addSubBlocsDefinitions ($ subBlocsDefinitions: TplBlock 
187189    {
188190
189191        foreach ($ subBlocsDefinitionsas  $ itemKey$ itemValue
@@ -219,7 +221,7 @@ public function addSubBlocsDefinitions($subBlocsDefinitions)
219221     * 
220222     * @return string The regex. 
221223     */ 
222-     private  function  subBlockRegex ($ prefix$ blocName
224+     private  function  subBlockRegex (string   $ prefixstring   $ blocName : string 
223225    {
224226        return  '/ ' 
225227             . self ::BLOCKSTARTSTART 
@@ -243,7 +245,7 @@ private function subBlockRegex($prefix, $blocName)
243245     * 
244246     * @return string The processed output. 
245247     */ 
246-     public  function  applyTplStr ($ str$ subBlocsPath"" )
248+     public  function  applyTplStr (string   $ strstring   $ subBlocsPath"" ): string 
247249    {
248250        // Replace all simple vars. 
249251        $ prefix$ subBlocsPath""  ? ""  : $ subBlocsPath". " ;
@@ -305,7 +307,7 @@ function ($m) use ($blocName, $blocsArr, $prefix) {
305307     * 
306308     * @return string The processed output. 
307309     */ 
308-     public  function  applyTplFile ($ file
310+     public  function  applyTplFile (string   $ file : string 
309311    {
310312        if  (! $ tplStrfile_get_contents ($ file
311313            throw  new  \UnexpectedValueException ("Cannot read given file  $ file );
@@ -319,7 +321,7 @@ public function applyTplFile($file)
319321     * 
320322     * @return TplBlock For chaining. 
321323     */ 
322-     public  function  doTrim ()
324+     public  function  doTrim () : TplBlock 
323325    {
324326        $ this trim  = true ;
325327        return  $ this 
@@ -330,7 +332,7 @@ public function doTrim()
330332     * 
331333     * @return TplBlock For chaining. 
332334     */ 
333-     public  function  dontTrim ()
335+     public  function  dontTrim () : TplBlock 
334336    {
335337        $ this trim  = false ;
336338        return  $ this 
@@ -341,7 +343,7 @@ public function dontTrim()
341343     * 
342344     * @return TplBlock For chaining. 
343345     */ 
344-     public  function  doReplaceNonGivenVars ()
346+     public  function  doReplaceNonGivenVars () : TplBlock 
345347    {
346348      $ this replaceNonGivenVars  = true ;
347349      return  $ this 
@@ -353,7 +355,7 @@ public function doReplaceNonGivenVars()
353355     * 
354356     * @return TplBlock For chaining. 
355357     */ 
356-     public  function  dontReplaceNonGivenVars ()
358+     public  function  dontReplaceNonGivenVars () : TplBlock 
357359    {
358360      $ this replaceNonGivenVars  = false ;
359361      return  $ this 
@@ -366,7 +368,7 @@ public function dontReplaceNonGivenVars()
366368     *  
367369     * @return TplBlock For chaining. 
368370     */ 
369-     public  function  doStrictMode ()
371+     public  function  doStrictMode () : TplBlock 
370372    {
371373        $ this strictMode  = true ;
372374        return  $ this 
@@ -378,7 +380,8 @@ public function doStrictMode()
378380     *  
379381     * @return TplBlock For chaining. 
380382     */ 
381-     public  function  dontStrictMode (){
383+     public  function  dontStrictMode () :TplBlock 
384+     {
382385        $ this strictMode  = false ;
383386        return  $ this 
384387
0 commit comments