<?php

namespace Velis\App;

use Velis\App;

/**
 * @author Jan Małysiak <jan.malysiak@velistech.com>
 * @deprecated use composer autoloader instead
 */
class LoaderFactory
{
    /**
     * @return Loader
     */
    public function createLoader(): Loader
    {
        $version = App::getPhalconMajorVersion();
        if ($version >= PhalconVersion::PHALCON5) {
            $wrapped = new \Phalcon\Autoload\Loader();
        } else {
            $wrapped = new \Phalcon\Loader();
        }

        return new Loader($wrapped, $version);
    }
}
