From 8ca6cc32b2c789a3149861159ad258f2cb9491e3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:39:39 +0200 Subject: Adding upstream version 2.11.4. Signed-off-by: Daniel Baumann --- library/vendor/lessphp/lib/Less/Visitor.php | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 library/vendor/lessphp/lib/Less/Visitor.php (limited to 'library/vendor/lessphp/lib/Less/Visitor.php') diff --git a/library/vendor/lessphp/lib/Less/Visitor.php b/library/vendor/lessphp/lib/Less/Visitor.php new file mode 100644 index 0000000..19e041f --- /dev/null +++ b/library/vendor/lessphp/lib/Less/Visitor.php @@ -0,0 +1,46 @@ +_visitFnCache = get_class_methods( get_class( $this ) ); + $this->_visitFnCache = array_flip( $this->_visitFnCache ); + } + + public function visitObj( $node ) { + $funcName = 'visit'.$node->type; + if ( isset( $this->_visitFnCache[$funcName] ) ) { + + $visitDeeper = true; + $this->$funcName( $node, $visitDeeper ); + + if ( $visitDeeper ) { + $node->accept( $this ); + } + + $funcName .= "Out"; + if ( isset( $this->_visitFnCache[$funcName] ) ) { + $this->$funcName( $node ); + } + + } else { + $node->accept( $this ); + } + + return $node; + } + + public function visitArray( $nodes ) { + array_map( array( $this,'visitObj' ), $nodes ); + return $nodes; + } +} -- cgit v1.2.3