Set the UserInterface class that represents users.
@param string $classname The class to use for users. This should implement
Wedeto\Auth\UserInterface.
@return Wedeto\Auth\Authentication Provides fluent interface
328516
public function setUserClass(string $classname)
    {
        if (!class_exists($classname) || !is_subclass_of($classname, UserInterface::class))
            throw new DomainException("Invalid user class: $classname");
        $this->user_class = $classname;
        return $this;
    }
270251
public function load($username): UserInterface
    {
        $grav = Grav::instance();
        /** @var UniformResourceLocator $locator */
        $locator = $grav['locator'];

        // force lowercase of username
        $username = mb_strtolower($username);

        $filename = 'account://' . $username . YAML_EXT;
        $path = $locator->findResource($filename) ?: $locator->findResource($filename, true, true);
        $file = CompiledYamlFile::instance($path);
        $content = (array)$file->content() + ['username' => $username, 'state' => 'enabled'];

        $userClass = $this->className;
        $callable = function() {
            $blueprints = new Blueprints;

            return $blueprints->get('user/account');
        };

        /** @var UserInterface $user */
        $user = new $userClass($content, $callable);
        $user->file($file);

        return $user;
    }
850234
public function bindRuleToClass ($identifier, $className)
		{
			$this->classIndex->setRuleToClass($identifier, $className);

			$this->rules[$identifier] = new ClassBindingRule($this, $this->classIndex, $className);

			return $this;
		}
1293541
public function setEntityClass($className)
    {
        if (
            !class_exists($className) ||
            !is_subclass_of($className, EntityInterface::class)
        ) {
            throw new InvalidEntityClassException(
                "Class '{$className}' does not implements the " .
                "Slick\Orm\EntityInterface interface."
            );
        }
        
        $this->entityClass = $className;
        return $this;
    }
1228199
public function createToken($className)
    {
        if (!is_subclass_of($className, TokenInterface::class)) {
            $this->throwException(
                "$className is not a valid token sub-class"
            );
        }

        return new $className(
            $this->createCurrentSourceLocation(),
            $this->level,
            str_repeat($this->getIndentStyle(), $this->getIndentWidth())
        );
    }
516371
protected function createClass(string $className)
    {
        if (!class_exists($className)) {
            throw new class("The class $className does not exists") extends Exception implements
                NotFoundExceptionInterface {
            };
        }

        $reflection = new ReflectionClass($className);

        if ($reflection->hasMethod('__construct')) {
            return $reflection->newInstanceArgs($this->arguments);
        }

        return $reflection->newInstance();
    }
541286
protected static function getObject($className)
    {
        if (!isset(self::$instances[$className])) {
            self::$instances[$className] = self::createObject($className);
        }

        return self::$instances[$className];
    }
363214
public final function set(string $className, $value): CacheInterface
   {
       return $this->cache->set($className, $value);
   }
1172151
public function asSharedInstanceOf($className)
    {
        $endPoint = &$this->getEndPoint();
        $endPoint['lookupType'] = self::TYPE_SHARED;
        $endPoint['className'] = $className;

        return $this;
    }
867572
public function setUsername($username){
        if(!$this->setModified('username', $username)->isModified()){
            return $this;
        }
        $this->username = $username;

        return $this;
    }
1257868
public function setFormClassName($className) {
        if ($this->configured) throw new IllegalStateException('Configuration is frozen');
        $name = $this->name ? ' name="'.$this->name.'"':'';
        $path = $this->path ? ' path="'.$this->path.'"':'';

        if (!is_subclass_of($className, ACTION_FORM_BASE_CLASS)) throw new StrutsConfigException('<mapping'.$name.$path.' form="'.$className.'": Not a subclass of '.ACTION_FORM_BASE_CLASS.'.');

        $this->formClassName = $className;
        return $this;
    }
622819
public static function setDateTimeClassName(string $className)
    {
        if(!class_exists($className)) {
            throw new \InvalidArgumentException($className . ' does not exist');
        }

        self::$_dateTimeClassName = $className;
    }
1346582
public function reflectInterface($className): ReflectionInterface
    {
        $className = ClassName::fromUnknown($className);

        $class = $this->reflectClassLike($className);

        if (false === $class instanceof ReflectionInterface) {
            throw new ClassNotFound(sprintf(
                '"%s" is not an interface, it is a "%s"',
                $className->full(),
                get_class($class)
            ));
        }

        return $class;
    }
1087033
public function setGroupClass(string $classname)
    {
        if (!class_exists($classname) || !is_subclass_of($classname, GroupInterface::class))
            throw new DomainException("Invalid group class: $classname");
        $this->group_class = $classname;
        return $this;
    }
1078853
public function instance($classname)
    {
        // Find the class instance, and register the class if the instance is not found.
        if(!($instance = jaxon()->getPluginManager()->getRegisteredObject($classname)))
        {
            $instance = jaxon()->registerClass($classname, [], true);
        }
        if(($instance))
        {
            $this->initInstance($instance);
        }
        return $instance;
    }
763639
public function makeInstance($className)
    {
        // class reflection
        $reflection = new ReflectionClass($className);
        // get the class constructor
        $constructor = $reflection->getConstructor();

        // if there is no constructor, just create and
        // return a new instance
        if (!$constructor) {
            return $reflection->newInstance();
        }

        // created and returns the new instance passing the
        // resolved parameters
        return $reflection->newInstanceArgs($this->resolveParameters($constructor->getParameters(), []));
    }
1341405
public function classname($classname = null)
    {
        if ($classname === null) {
            return $this->classname;
        }

        $this->classname = $classname;
    }