code: public function addNamedRange(NamedRange $namedRange)
      {
          if ($namedRange->getScope() == null) {
              // global scope
              $this->namedRanges[$namedRange->getName()] = $namedRange;
          } else {
              // local scope
              $this->namedRanges[$namedRange->getScope()->getTitle() . '!' . $namedRange->getName()] = $namedRange;
          }
  
          return true;
      }
docs: Add named range.
  
  @param NamedRange $namedRange
  
  @return bool