protected static function scanDependency($context, $code, $ocode) {
        $child = array();

        $code = preg_replace_callback('/static::(\w+?)\s*\(/', function ($matches) use ($context, &$child) {
            if (!isset($child[$matches[1]])) {
                $child[$matches[1]] = 0;
            }
            $child[$matches[1]]++;

            return "{$context['funcprefix']}{$matches[1]}(";
        }, $code);

        // replace the constants
        $code = preg_replace('/static::([A-Z0-9_]+)/', "\$cx['constants']['$1']", $code);

        // compress space
        $code = preg_replace('/    /', ' ', $code);

        return array(static::replaceSafeString($context, $code), $child, $ocode);
    }
protected static function scanDependency($context, $code, $ocode) {
        $child = array();

        $code = preg_replace_callback('/static::(\w+?)\s*\(/', function ($matches) use ($context, &$child) {
            if (!isset($child[$matches[1]])) {
                $child[$matches[1]] = 0;
            }
            $child[$matches[1]]++;

            return "{$context['funcprefix']}{$matches[1]}(";
        }, $code);

        // replace the constants
        $code = preg_replace('/static::([A-Z0-9_]+)/', "\$cx['constants']['$1']", $code);

        // compress space
        $code = preg_replace('/    /', ' ', $code);

        return array(static::replaceSafeString($context, $code), $child, $ocode);
    }
protected static function scanDependency ( $ context , $ code , $ ocode ) { $ child = array ( ) ; $ code = preg_replace_callback ( '/static::(\w+?)\s*\(/' , function ( $ matches ) use ( $ context , & $ child ) { if ( ! isset ( $ child [ $ matches [ 1 ] ] ) ) { $ child [ $ matches [ 1 ] ] = 0 ; } $ child [ $ matches [ 1 ] ] ++ ; return "{$context['funcprefix']}{$matches[1]}(" ; } , $ code ) ; // replace the constants $ code = preg_replace ( '/static::([A-Z0-9_]+)/' , "\$cx['constants']['$1']" , $ code ) ; // compress space $ code = preg_replace ( '/    /' , ' ' , $ code ) ; return array ( static :: replaceSafeString ( $ context , $ code ) , $ child , $ ocode ) ; }
Scan for required standalone functions

@param array<string,array|string|integer> $context current compile context
@param string $code patched PHP code string of the method
@param string $ocode original PHP code string of the method

@return array<string|array> list of converted code and children array
Scan for required standalone functions