<commit_before><?php

namespace Bolt\Database\Migration;

use Bolt\Application;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;
use Symfony\Component\HttpFoundation\File\File;

/**
 * Abstract base class for database import/export
 *
 * @author <NAME> <<EMAIL>>
 */
abstract class AbstractMigration
{
    /** @var \Bolt\Application */
    protected $app;

    /** @var \Symfony\Component\Filesystem\Filesystem */
    protected $fs;

    /** @var boolean */
    protected $error = false;

    /** @var array */
    protected $errorMessages = array();

    /** @var boolean */
    protected $warning = false;

    /** @var array */
    protected $warningMessages = array();

    /** @var array */
    protected $validExtensions = array('json', 'yaml', 'yml');

    /** @var string */
    protected $files;

    /**
     * Constructor.
     *
     * @param \Bolt\Application $app
     */
    public function __construct(Application $app)
    {
        $this->app = $app;
        $this->fs  = new Filesystem();
    }

    /**
     * Get the error state.
     *
     * @return boolean
     */
    public function getError()
    {
        return $this->error;
    }

    /**
     * Set the error state.
     *
     * @param boolean $error
     *
     * @return \Bolt\Database\Migration\AbstractMigration
     */
    public function setError($error)
    {
        $this->error = $error;

        return $this;
    }

    /**
     * Get the error messages.
     *
     * @return array
     */
    public function getErrorMessages()
    {
        return $this->errorMessages;
    }

    /**
     * Add an error message to the error queue.
     *
     * @param string $errorMessage
     *
     * @return \Bolt\Database\Migration\AbstractMigration
     */
    public function setErrorMessage($errorMessage)
    {
        $this->errorMessages[] = $errorMessage;

        return $this;
    }

    /**
     * Set the warning state.
     *
     * @param boolean $warning
     *
     * @return \Bolt\Database\Migration\AbstractMigration
     */
    public function setWarning($warning)
    {
        $this->warning = $warning;

        return $this;
    }

    /**
     * Get the warning messages.
     *
     * @return array
     */
    public function getWarningMessages()
    {
        return $this->errorWarning;
    }

    /**
     * Add an warning message to the warning queue.
     *
     * @param string $warningMessage
     *
     * @return \Bolt\Database\Migration\AbstractMigration
     */
    public function setWarningMessage($warningMessage)
    {
        $this->warningMessages[] = $warningMessage;

        return $this;
    }

    /**
     * Set the migration files.
     *
     * @param string|array $files File(s)
     *
     * @return boolean
     */<commit_msg>Allow notice messages to be queued too… while we're at it.<commit_after><?php

namespace Bolt\Database\Migration;

use Bolt\Application;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;
use Symfony\Component\HttpFoundation\File\File;

/**
 * Abstract base class for database import/export
 *
 * @author <NAME> <<EMAIL>>
 */
abstract class AbstractMigration
{
    /** @var \Bolt\Application */
    protected $app;

    /** @var \Symfony\Component\Filesystem\Filesystem */
    protected $fs;

    /** @var boolean */
    protected $error = false;

    /** @var array */
    protected $errorMessages = array();

    /** @var boolean */
    protected $warning = false;

    /** @var array */
    protected $warningMessages = array();

    /** @var boolean */
    protected $notice = false;

    /** @var array */
    protected $noticeMessages = array();

    /** @var array */
    protected $validExtensions = array('json', 'yaml', 'yml');

    /** @var string */
    protected $files;

    /**
     * Constructor.
     *
     * @param \Bolt\Application $app
     */
    public function __construct(Application $app)
    {
        $this->app = $app;
        $this->fs  = new Filesystem();
    }

    /**
     * Get the error state.
     *
     * @return boolean
     */
    public function getError()
    {
        return $this->error;
    }

    /**
     * Set the error state.
     *
     * @param boolean $error
     *
     * @return \Bolt\Database\Migration\AbstractMigration
     */
    public function setError($error)
    {
        $this->error = $error;

        return $this;
    }

    /**
     * Get the error messages.
     *
     * @return array
     */
    public function getErrorMessages()
    {
        return $this->errorMessages;
    }

    /**
     * Add an error message to the error queue.
     *
     * @param string $errorMessage
     *
     * @return \Bolt\Database\Migration\AbstractMigration
     */
    public function setErrorMessage($errorMessage)
    {
        $this->errorMessages[] = $errorMessage;

        return $this;
    }

    /**
     * Set the warning state.
     *
     * @param boolean $warning
     *
     * @return \Bolt\Database\Migration\AbstractMigration
     */
    public function setWarning($warning)
    {
        $this->warning = $warning;

        return $this;
    }

    /**
     * Get the warning messages.
     *
     * @return array
     */
    public function getWarningMessages()
    {
        return $this->warningMessages;
    }

    /**
     * Add an warning message to the warning queue.
     *
     * @param string $warningMessage
     *
     * @return \Bolt\Database\Migration\AbstractMigration
     */
    public function setWarningMessage($warningMessage)
    {
        $this->warningMessages[] = $warningMessage;

        return $this;
    }

    /**
     * Set the notice state.
     *
     * @param boolean $notice
     *
     * @return \Bolt\Database\Migration\AbstractMigration
     */
    public function setNotice($notice)
    {
        $this->notice = $notice;

        return $this;
    }

    /**
     * Get the notice messages.
     *
     * @return array
     */
    public function getNoticeMessages()
    {
        return $this->noticeMessages;
    }

    /**
     * Add an notice message to the notice queue.
     *
     * @param string $noticeMessage
     *
     * @return \Bolt\Database\Migration\AbstractMigration
     */
    public function setNoticeMessage($noticeMessage)
    {
        $this->noticeMessages[] = $noticeMessage;

        return $this;
    }

    /**
     * Set the migration files.
     *
     * @param string|array $files File(s)
     *
     * @return boolean
     */
{'fraction_non_alphanumeric': 0.12509340905694216, 'fraction_numerical': 0.0, 'mean_word_length': 2.0157728706624605, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 30, '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': '518565', 'n_tokens_mistral': 1938, 'n_tokens_neox': 1910, 'n_words': 451}