File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,15 @@ private function __construct()
2626 /**
2727 * Get a singleton of a line renderer.
2828 *
29- * @param string $type the type
29+ * @param string $type the type
30+ * @param mixed ...$ctorArgs the constructor arguments
3031 *
3132 * @return AbstractLineRenderer
3233 */
33- public static function getInstance (string $ type ): AbstractLineRenderer
34+ public static function getInstance (string $ type, ... $ ctorArgs ): AbstractLineRenderer
3435 {
3536 if (!isset (self ::$ singletons [$ type ])) {
36- self ::$ singletons [$ type ] = self ::make ($ type );
37+ self ::$ singletons [$ type ] = self ::make ($ type, ... $ ctorArgs );
3738 }
3839
3940 return self ::$ singletons [$ type ];
Original file line number Diff line number Diff line change @@ -26,14 +26,15 @@ private function __construct()
2626 /**
2727 * Get a singleton of a template.
2828 *
29- * @param string $template the template
29+ * @param string $template the template
30+ * @param mixed ...$ctorArgs the constructor arguments
3031 *
3132 * @return AbstractRenderer
3233 */
33- public static function getInstance (string $ template ): AbstractRenderer
34+ public static function getInstance (string $ template, ... $ ctorArgs ): AbstractRenderer
3435 {
3536 if (!isset (self ::$ singletons [$ template ])) {
36- self ::$ singletons [$ template ] = self ::make ($ template );
37+ self ::$ singletons [$ template ] = self ::make ($ template, ... $ ctorArgs );
3738 }
3839
3940 return self ::$ singletons [$ template ];
Original file line number Diff line number Diff line change @@ -25,8 +25,8 @@ private function __construct()
2525 */
2626 public static function fromArray (array $ array , int $ flags = 0 ): \Generator
2727 {
28- // it may worth unrolling if-conditions to out of for-loop
29- // so it wont have to check multiple if-conditions inside each loop
28+ // it may worth unrolling if-conditions to be out of for-loop
29+ // so it does have to check if-conditions in each iteration
3030
3131 if ($ flags & self ::ITERATOR_GET_BOTH ) {
3232 for (\end ($ array ); ($ key = \key ($ array )) !== null ; \prev ($ array )) {
You can’t perform that action at this time.
0 commit comments