can't you use PathHelper::getNodename() here? https://github.com/phpcr/phpcr-utils/blob/master/src/PHPCR/Util/PathHelper.php#L230

if this is about a PHPCR path, basename will fail on windows machines.