<commit_before><?php
namespace Tonis\OAuth2;

use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\Driver\YamlDriver;
use Doctrine\ORM\Tools\ResolveTargetEntityListener;
use OAuth2\Server;
use OAuth2\Storage;
use PDO;
use Tonis\OAuth2\Doctrine\FileLocator;
use Tonis\OAuth2\Storage\DoctrineORM;

class OAuthFactory
{
    /**
     * Creates a default instance for PDO usage.
     *
     * @param PDO   $pdo
     * @param array $options
     * @param array $grants
     * @return Server
     */
    public static function createForPDO(PDO $pdo, array $options = [], array $grants = [])
    {
        return new Server(new Storage\Pdo($pdo), $options, $grants);
    }

    /**
     * Creates a default instance based on DoctrineORM. This adds the YAML driver
     * for the entity metadata, sets up the entity resolver so you can customize any
     * entities, and sets the storage using the same PDO connection as the Entity Manager.
     *
     * @param EntityManager $entityManager
     * @param array         $options
     * @param array         $grants
     * @return Server
     */
    public static function createForDoctrineORM(<commit_msg>Updates<commit_after><?php
namespace Tonis\OAuth2;

use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\Driver\YamlDriver;
use Doctrine\ORM\Tools\ResolveTargetEntityListener;
use OAuth2\Server;
use OAuth2\Storage;
use PDO;
use Tonis\OAuth2\Doctrine\FileLocator;

class OAuthFactory
{
    /**
     * Creates a default instance for PDO usage.
     *
     * @param PDO   $pdo
     * @param array $options
     * @param array $grants
     * @return Server
     */
    public static function createForPDO(PDO $pdo, array $options = [], array $grants = [])
    {
        return new Server(new Storage\Pdo($pdo), $options, $grants);
    }

    /**
     * Creates a default instance based on DoctrineORM. This adds the YAML driver
     * for the entity metadata, sets up the entity resolver so you can customize any
     * entities, and sets the storage using the same PDO connection as the Entity Manager.
     *
     * @param EntityManager $entityManager
     * @param array         $options
     * @param array         $grants
     * @return Server
     */
    public static function createForDoctrineORM(
{'fraction_non_alphanumeric': 0.08961474036850921, 'fraction_numerical': 0.0037688442211055275, 'mean_word_length': 3.021885521885522, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6160371', 'n_tokens_mistral': 713, 'n_tokens_neox': 709, 'n_words': 219}