To update class NPath value if new one is bigger then existing

@param string $sClassName class name
@param int    $iNPath     NPath value
967281
public function updateClassMaxNPath($sClassName, $iNPath)
    {
        if (!isset($this->_aStats[$sClassName]['max']['npath'])
            || $this->_aStats[$sClassName]['max']['npath'] < $iNPath
        ) {
            $this->_aStats[$sClassName]['max']['npath'] = $iNPath;
        }
    }
836691
public function updatePath($oldPath, $newPath)
    {
        if ($this->contains($oldPath)) {
            $this->items[$newPath] = $this->items[$oldPath];
            unset($this->items[$oldPath]);
        }
    }
420634
public static function singleton($classPath) {
        if ( !isset(self::$INSTANES[$classPath]) ) {
            $reflect = new \ReflectionClass($classPath);
            self::$INSTANES[$classPath] = $reflect->newInstance();
        }
        return self::$INSTANES[$classPath];
    }
1095168
public function updateCollectionAliasExternal($cName, $cLink, $newWindow = 0)
    {
        if ($this->cPointerExternalLink != '') {
            $db = Database::connection();
            $this->markModified();
            if ($newWindow) {
                $newWindow = 1;
            } else {
                $newWindow = 0;
            }
            $db->executeQuery('update CollectionVersions set cvName = ? where cID = ?', array($cName, $this->cID));
            $db->executeQuery('update Pages set cPointerExternalLink = ?, cPointerExternalLinkNewWindow = ? where cID = ?', array($cLink, $newWindow, $this->cID));
        }
    }
500306
public function setClass($className, $classPath) {
		$className = strtolower($className);
		$path = null;
		if(
			// Pure object naming with only lib name and exact class name
			existsPathOf(LIBSDIR.$classPath.'/'.$className.'.php', $path) ||
			// Pure object naming
			existsPathOf(LIBSDIR.$classPath.'.php', $path) ||
			// Old Orpheus naming
			existsPathOf(LIBSDIR.$classPath.'_class.php', $path) ||
			// Full path
			existsPathOf(LIBSDIR.$classPath, $path)
		) {
			$this->classes[$className] = $path;
			
		} else {
			throw new \Exception("ClassLoader : File \"{$classPath}\" of class \"{$className}\" not found.");
		}
		return true;
		
	}
1105376
public function rename($oldPath, $newPath)
    {
        $payload = $this->getNewFileLocationPayload($newPath);

        return $this->updateMetadata($oldPath, $payload);
    }
1188449
public function updatePhotoFromPath($photoId, $filepath)
    {
        if (is_null($photoId) || $photoId == '') {
            throw new Exception('The photoId is required to update a photo.');
        }

        if (is_null($filepath) || $filepath == '') {
            throw new Exception('The filepath is required to upload a file.');
        }

        if (!file_exists($filepath)) {
            throw new Exception('The filepath does not point to an accessible file.');
        }

        $params = array(
            'method' => 'sp.photo.update',
            'photo_id' => $photoId,
        );

        $photos = array(
            'photo' => new CURLFile($filepath),
        );

        return $this->_makeApiRequest($params, $photos);
    }
1008555
static public function subclassOf($value, $className, $message = null, $propertyPath = null)
        {
            if (!is_subclass_of($value, $className)) {
                $message = $message ?: sprintf(
                    'Class "%s" was expected to be subclass of "%s".',
                    static::stringify($value),
                    $className
                );

                throw static::createException($value, $message, static::INVALID_SUBCLASS_OF, $propertyPath, array('class' => $className));
            }
        }
1255513
public static function matchType($inValue, $className) {
        if ($inValue instanceof \stdClass) {
            $inValueKeys = array_keys(get_object_vars($inValue));
            if (in_array('_type', $inValueKeys)) {
                $tempStore = new $className();
                $tempStoreType = $tempStore->get_type();
                if ($tempStoreType===$inValue->_type) return $className;
            }
        }

        return null;
    }
129878
public static function create($classPath) {

        if ( !isset(self::$INSTANES[$classPath]) ) {
            $reflect = new \ReflectionClass($classPath);
            $instance = $reflect->newInstance();
            $instance->initConfigs();
            self::$INSTANES[$classPath] = $instance;
        }
        return self::$INSTANES[$classPath];
    }
304443
public function rename(string $srcPath, string $dstPath): ?Virtual
    {
        $changes = $this->getChanges();

        $srcEntity = $this->getEntity($srcPath);
        $dstEntity = $this->getEntity($dstPath);

        if (null === $srcEntity || !$srcEntity->file_exists()) {
            $result = null;
        } elseif (null === $dstEntity || $dstEntity->file_exists()) {
            $result = null;
        } else {
            if ($srcEntity->is_dir()) {
                $dirStat = $this->getStat($srcPath, 0);
                $dstEntity = $this->makeDirectory($dstPath, $dirStat['mode'], 0);

                $list = $this->getList($srcPath);
                if (count($list)) {
                    foreach ($list as $file) {
                        $filename = $file->basename();
                        $this->rename(
                            $srcPath.'/'.$filename,
                            $dstPath.'/'.$filename
                        );
                    }
                }
            } else {
                $tmpPath = $this->tempnam();
                copy($srcEntity->path(), $tmpPath);

                $dstEntity = Virtual::newInstance(
                    $dstEntity, $tmpPath, $dstEntity->basename()
                );
                $changes->add($dstPath, $dstEntity);
            }

            $srcEntity = Deleted::newInstance($srcEntity);
            $changes->add($srcPath, $srcEntity);

            $result = $dstEntity;
        }

        return $result;
    }
1117
public void setClasspath(String classpath) {
        this.classpath = new LinkedList<String>();
        StringTokenizer tokenizer = new StringTokenizer(classpath, File.pathSeparator);
        while (tokenizer.hasMoreTokens()) {
            this.classpath.add(tokenizer.nextToken());
        }
    }
630159
public function updateClassNames(&$classes)
    {
        if (!$this->apply()) {
            return;
        }
        
        if ($class = $this->owner->PaginationSizeClass) {
            $classes[] = $class;
        }
        
        if ($class = $this->owner->PaginationButtonModeClass) {
            $classes[] = $class;
        }
    }
1345788
public function setRepositoryPath($repository_path, $createNew = false, $_init = true)
    {
        if (is_string($repository_path)) {
            if ($new_path = realpath($repository_path)) {
                $repository_path = $new_path;
                if (is_dir($repository_path)) {
                    if (file_exists($repository_path."/.git") && is_dir($repository_path."/.git")) {
                        $this->repository_path = $repository_path;
                    } else {
                        if ($createNew) {
                            $this->repository_path = $repository_path;
                            if ($_init) {
                                $this->run('init');
                            }
                        } else {
                            throw new \Exception(
                                sprintf('"%s" is not a git repository!', $repository_path)
                            );
                        }
                    }
                } else {
                    throw new \Exception(
                        sprintf('"%s" is not a directory', $repository_path)
                    );
                }
            } else {
                if ($createNew) {
                    if ($parent = realpath(dirname($repository_path))) {
                        mkdir($repository_path);
                        $this->repository_path = $repository_path;
                        if ($_init) {
                            $this->run('init');
                        }
                    } else {
                        throw new \Exception('Cannot create repository in non-existent directory');
                    }
                } else {
                    throw new \Exception(
                        sprintf('"%s" does not exist', $repository_path)
                    );
                }
            }
        }
    }
5938
public function addDataTypeDefinition($typeName, $typeClass, $classpath = null)
    {
        ComponentHelper::getComponentHelper($this)->addDataTypeDefinition($typeName, $typeClass, $classpath);
    }
599026
public function setClassName($sClass)
    {
        $this->sPrefix = $this->getOption('core.prefix.function');

        $sClass = trim($sClass, '.\\ ');
        if(!$sClass)
        {
            return $this;
        }

        if(!($xCallable = $this->xRepository->getCallableObject($sClass)))
        {
            // Todo: decide which of these values to return
            // return null;
            return $this;
        }

        $this->sPrefix = $this->getOption('core.prefix.class') . $xCallable->getJsName() . '.';
        return $this;
    }
749616
protected function createSeedRunner(
        IoInterface $inOut,
        string $seedsPath,
        callable $seedInit = null,
        string $seedsTable = BaseMigrationRunner::SEEDS_TABLE
    ): FileSeedRunner {
        return new FileSeedRunner($inOut, $seedsPath, $seedInit, $seedsTable);
    }