Skip to content
Snippets Groups Projects
Select Git revision
  • f75263bc099a66758e600c1c1054b14a6c128b1d
  • main default protected
  • devel
  • 1.1.0
  • 1.0.4
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
9 results

WpdbMigrationFactory.php

Blame
  • WpdbMigrationFactory.php 569 B
    <?php
    declare(strict_types=1);
    
    namespace WPDesk\Migrations\Version;
    
    use Psr\Log\LoggerInterface;
    use WPDesk\Migrations\AbstractMigration;
    
    class WpdbMigrationFactory implements MigrationFactory {
    
    	/** @var \wpdb */
    	protected $wpdb;
    
    	/** @var LoggerInterface */
    	protected $logger;
    
    	public function __construct( \wpdb $wpdb, LoggerInterface $logger ) {
    		$this->wpdb   = $wpdb;
    		$this->logger = $logger;
    	}
    
    	public function create_version( string $migration_class ): AbstractMigration {
    		return new $migration_class(
    			$this->wpdb,
    			$this->logger
    		);
    	}
    
    }