HEX
Server: Apache
System: Linux webd006.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: zwafgyp (177615)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/zwafgyp/dodolodge-net/wp-content/plugins/wp-migrate-db/class/Common/Replace/PairFactory.php
<?php

namespace DeliciousBrains\WPMDB\Common\Replace;

/**
 * Class PairFactory
 *
 * Used to create search and replace pairs instances.
 *
 * @package DeliciousBrains\WPMDB\Common\Replace
 */
class PairFactory {

    const REGEX = 'REGEX';
    const CASE_SENSITIVE = 'CASE_SENSITIVE';
    const CASE_INSENSITIVE = 'CASE_INSENSITIVE';

    /**
     * @param string $pattern
     * @param string $replace
     * @param string $type
     *
     * @return ReplacePairInterface
     */
    public function create($pattern, $replace, $type = self::CASE_INSENSITIVE) {
        switch($type) {
            case self::REGEX:
                return new RegexPair($pattern, $replace);
            case self::CASE_SENSITIVE:
                return new CaseSensitivePair($pattern, $replace);
            default:
                return new CaseInsensitivePair($pattern, $replace);
        }
    }
}