<commit_before><?php

namespace Taisiya\PropelBundle\Database;

use Taisiya\PropelBundle\Database\Exception\InvalidArgumentException;

final class Schema
{
    /**
     * @var array
     */
    private $databases = [];

    /**
     * @param Database $database
     * @return self
     * @throws InvalidArgumentException
     */
    public function createDatabase(Database $database): self
    {
        if ($this->hasDatabase($database::getName())) {
            throw new InvalidArgumentException('Database '.$database::getName().' already added');
        }

        $this->databases[$database::getName()] = $database;

        return $this;
    }

    /**
     * @param Database $database
     * @return Schema
     */
    public function createDatabaseIfNotExists(Database $database): self
    {
        if (!$this->hasDatabase($database::getName())) {
            $this->createDatabase($database);
        }

        return $this;
    }

    /**
     * @param Database $database
     * @throws InvalidArgumentException
     * @return Schema
     */
    public function removeDatabase(Database $database): self
    {
        if (!$this->hasDatabase($database::getName())) {
            throw new InvalidArgumentException('Database '.$database::getName().' not exists');
        }

        unset($this->databases[$database::getName()]);

        return $this;
    }

    /**
     * @param string $name
     * @return Database
     * @throws InvalidArgumentException
     */
    public function getDatabase(string $name): Database
    {
        if (!array_key_exists($name, $this->databases)) {
            throw new InvalidArgumentException('Database '.$name.' not added');
        }

        return $this->databases[$name];
    }

    public function getDatabaseByClassName(string $class): Database
    {

    }

    /**
     * @param string $name
     * @return bool
     */
    public function hasDatabase(string $name): bool
    {
        return array_key_exists($name, $this->databases);
    }

    public function hasDatabaseByClassName(string $className): bool
    {
        if ( ! class_exists($className)) {<commit_msg>code style fix<commit_after><?php

namespace Taisiya\PropelBundle\Database;

use Taisiya\PropelBundle\Database\Exception\InvalidArgumentException;

final class Schema
{
    /**
     * @var array
     */
    private $databases = [];

    /**
     * @param Database $database
     * @return self
     * @throws InvalidArgumentException
     */
    public function createDatabase(Database $database): self
    {
        if ($this->hasDatabase($database::getName())) {
            throw new InvalidArgumentException('Database '.$database::getName().' already added');
        }

        $this->databases[$database::getName()] = $database;

        return $this;
    }

    /**
     * @param Database $database
     * @return Schema
     */
    public function createDatabaseIfNotExists(Database $database): self
    {
        if (!$this->hasDatabase($database::getName())) {
            $this->createDatabase($database);
        }

        return $this;
    }

    /**
     * @param Database $database
     * @throws InvalidArgumentException
     * @return Schema
     */
    public function removeDatabase(Database $database): self
    {
        if (!$this->hasDatabase($database::getName())) {
            throw new InvalidArgumentException('Database '.$database::getName().' not exists');
        }

        unset($this->databases[$database::getName()]);

        return $this;
    }

    /**
     * @param string $name
     * @return Database
     * @throws InvalidArgumentException
     */
    public function getDatabase(string $name): Database
    {
        if (!array_key_exists($name, $this->databases)) {
            throw new InvalidArgumentException('Database '.$name.' not added');
        }

        return $this->databases[$name];
    }

    public function getDatabaseByClassName(string $class): Database
    {
    }

    /**
     * @param string $name
     * @return bool
     */
    public function hasDatabase(string $name): bool
    {
        return array_key_exists($name, $this->databases);
    }

    public function hasDatabaseByClassName(string $className): bool
    {
        if (! class_exists($className)) {
{'fraction_non_alphanumeric': 0.13042458362655407, 'fraction_numerical': 0.0, 'mean_word_length': 2.497949138638228, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '203132', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1091, 'n_words': 246}