<commit_before><?php
namespace CfdiUtils\VersionDiscovery;

use \DOMDocument;
use \DOMElement;
use CfdiUtils\Nodes\NodeInterface;
use CfdiUtils\Utils\Xml;

/**
 * @internal Use for compatibility
 */
trait StaticMethodsCompatTrait
{
    abstract protected static function createDiscoverer(): VersionDiscoverer;

    /**
     * @param DOMElement $element
     * @return string
     * @deprecated :3.0.0 Replaced with object instanced methods
     */
    public static function fromDOMElement(DOMElement $element): string
    {
        return static::createDiscoverer()->discover(new DomElementContainer($element));
    }

    /**
     * @param DOMDocument $document
     * @return string
     * @deprecated :3.0.0 Replaced with object instanced methods
     */
    public static function fromDOMDocument(DOMDocument $document): string
    {
        return static::fromDOMElement($document->documentElement);
    }

    /**
     * @param NodeInterface $node
     * @return string
     * @deprecated :3.0.0 Replaced with object instanced methods
     */
    public static function fromNode(NodeInterface $node): string
    {
        return static::createDiscoverer()->discover(new NodeContainer($node));
    }

    /**
     * @param string $contents
     * @return string
     * @deprecated :3.0.0 Replaced with object instanced methods
     */
    public static function fromXmlString(string $contents): string
    {
        return static::fromDOMDocument(Xml::newDocumentContent($contents));
    }
}<commit_msg>Make all methods call instanced methods<commit_after><?php
namespace CfdiUtils\VersionDiscovery;

use \DOMDocument;
use \DOMElement;
use CfdiUtils\Nodes\NodeInterface;

/**
 * @internal Use for compatibility
 */
trait StaticMethodsCompatTrait
{
    abstract protected static function createDiscoverer(): VersionDiscoverer;

    /**
     * @param DOMElement $element
     * @return string
     * @deprecated :3.0.0 Replaced with object instanced methods
     */
    public static function fromDOMElement(DOMElement $element): string
    {
        return static::createDiscoverer()->getFromDOMElement($element);
    }

    /**
     * @param DOMDocument $document
     * @return string
     * @deprecated :3.0.0 Replaced with object instanced methods
     */
    public static function fromDOMDocument(DOMDocument $document): string
    {
        return static::createDiscoverer()->getFromDOMDocument($document);
    }

    /**
     * @param NodeInterface $node
     * @return string
     * @deprecated :3.0.0 Replaced with object instanced methods
     */
    public static function fromNode(NodeInterface $node): string
    {
        return static::createDiscoverer()->getFromNode($node);
    }

    /**
     * @param string $contents
     * @return string
     * @deprecated :3.0.0 Replaced with object instanced methods
     */
    public static function fromXmlString(string $contents): string
    {
        return static::createDiscoverer()->getFromXmlString($contents);
    }
}
{'fraction_non_alphanumeric': 0.10267558528428093, 'fraction_numerical': 0.008026755852842809, 'mean_word_length': 3.2305516265912306, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1562133', 'n_tokens_mistral': 825, 'n_tokens_neox': 802, 'n_words': 211}