private function extractUsedClasses(&$placeholder)
    {
        $classNamespaceRegExp = '/([\\\\a-zA-Z0-9_]*\\\\[\\\\a-zA-Z0-9_]*)/';
        $matches = [];
        $usedInModelClasses = [];
        if (preg_match_all($classNamespaceRegExp, $placeholder, $matches)) {
            foreach ($matches[1] as $match) {
                $usedClassName = $match;
                $usedInModelClasses[] = trim($usedClassName, '\\');
                $namespaceParts = explode('\\', $usedClassName);
                $resultClassName = array_pop($namespaceParts);
                $placeholder = str_replace($usedClassName, $resultClassName, $placeholder);
            }
        }

        return array_unique($usedInModelClasses);
    }
private function extractUsedClasses(&$placeholder)
    {
        $classNamespaceRegExp = '/([\\\\a-zA-Z0-9_]*\\\\[\\\\a-zA-Z0-9_]*)/';
        $matches = [];
        $usedInModelClasses = [];
        if (preg_match_all($classNamespaceRegExp, $placeholder, $matches)) {
            foreach ($matches[1] as $match) {
                $usedClassName = $match;
                $usedInModelClasses[] = trim($usedClassName, '\\');
                $namespaceParts = explode('\\', $usedClassName);
                $resultClassName = array_pop($namespaceParts);
                $placeholder = str_replace($usedClassName, $resultClassName, $placeholder);
            }
        }

        return array_unique($usedInModelClasses);
    }
private function extractUsedClasses ( & $ placeholder ) { $ classNamespaceRegExp = '/([\\\\a-zA-Z0-9_]*\\\\[\\\\a-zA-Z0-9_]*)/' ; $ matches = [ ] ; $ usedInModelClasses = [ ] ; if ( preg_match_all ( $ classNamespaceRegExp , $ placeholder , $ matches ) ) { foreach ( $ matches [ 1 ] as $ match ) { $ usedClassName = $ match ; $ usedInModelClasses [ ] = trim ( $ usedClassName , '\\' ) ; $ namespaceParts = explode ( '\\' , $ usedClassName ) ; $ resultClassName = array_pop ( $ namespaceParts ) ; $ placeholder = str_replace ( $ usedClassName , $ resultClassName , $ placeholder ) ; } } return array_unique ( $ usedInModelClasses ) ; }
Extract and replace fully-qualified class names from placeholder.

@param string $placeholder Placeholder to extract class names from. Rewrites value to content without FQN

@return array Extracted FQN
Extract and replace fully - qualified class names from placeholder .