$24 GRAYBYTE WORDPRESS FILE MANAGER $39

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.216.51
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bravetechrwanda/itiministry.org/plugins/give/src/Framework/Migrations/

HOME
Current File : /home/bravetechrwanda/itiministry.org/plugins/give/src/Framework/Migrations//MigrationsRegister.php
<?php

namespace Give\Framework\Migrations;

use Give\Framework\Exceptions\Primitives\InvalidArgumentException;
use Give\Framework\Migrations\Contracts\BaseMigration;

class MigrationsRegister
{
    /**
     * FQCN of Migration classes
     *
     * @since 2.9.0
     *
     * @var string[]
     */
    private $migrations = [];

    /**
     * Returns all of the registered migrations
     *
     * @since 4.0.0 sort migrations
     * @since 2.9.0
     *
     * @return string[]
     */
    public function getMigrations()
    {
        $sortedMigrations = $this->migrations;

        uasort($sortedMigrations, function($a, $b) {
            return $a::timestamp() <=> $b::timestamp();
        });

        return $sortedMigrations;
    }

    /**
     * Checks to see if a migration is registered with the given ID
     *
     * @since 2.9.2
     *
     * @param string $id
     *
     * @return bool
     */
    public function hasMigration($id)
    {
        return isset($this->migrations[$id]);
    }

    /**
     * Returns a migration with the given ID
     *
     * @since 2.9.2
     *
     * @param string $id
     *
     * @return string
     */
    public function getMigration($id)
    {
        if ( ! isset($this->migrations[$id])) {
            throw new InvalidArgumentException("No migration exists with the ID {$id}");
        }

        return $this->migrations[$id];
    }

    /**
     * Returns all of the registered migration ids
     *
     * @since 2.9.0
     *
     * @return string[]
     */
    public function getRegisteredIds()
    {
        return array_keys($this->migrations);
    }

    /**
     * Add a migration to the list of migrations
     *
     * @since 2.9.0
     *
     * @param string $migrationClass FQCN of the Migration Class
     */
    public function addMigration($migrationClass)
    {
        if ( ! is_subclass_of($migrationClass, BaseMigration::class)) {
            throw new InvalidArgumentException('Class must extend the ' . BaseMigration::class . ' class');
        }

        $migrationId = $migrationClass::id();

        if (isset($this->migrations[$migrationId])) {
            throw new InvalidArgumentException(
                'A migration can only be added once. Make sure there are not id conflicts.'
            );
        }

        $this->migrations[$migrationId] = $migrationClass;
    }

    /**
     * Helper for adding a bunch of migrations at once
     *
     * @since 2.9.0
     *
     * @param string[] $migrationClasses
     */
    public function addMigrations(array $migrationClasses)
    {
        foreach ($migrationClasses as $migrationClass) {
            $this->addMigration($migrationClass);
        }
    }
}

Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Actions
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Contracts
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Controllers
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Exceptions
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
MigrationsRegister.php
2.635 KB
31 Mar 2025 11.17 PM
bravetechrwanda / bravetechrwanda
0644
MigrationsRunner.php
6.846 KB
22 May 2025 12.18 AM
bravetechrwanda / bravetechrwanda
0644
MigrationsServiceProvider.php
0.919 KB
22 May 2025 12.18 AM
bravetechrwanda / bravetechrwanda
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF