original_string: protected function buildIdAttr($eltId = null, bool $errorIfExists = false)
      {
          if ($errorIfExists && isset($this->attributes['id'])) {
              throw new \Osf\Exception\ArchException('Id element already set');
          }
          if ($eltId === null) {
              $eltId = 'e' . self::$eltIdCount++;
          }
          $this->setAttribute('id', $eltId);
          return $this;
      }
code: protected function buildIdAttr($eltId = null, bool $errorIfExists = false)
      {
          if ($errorIfExists && isset($this->attributes['id'])) {
              throw new \Osf\Exception\ArchException('Id element already set');
          }
          if ($eltId === null) {
              $eltId = 'e' . self::$eltIdCount++;
          }
          $this->setAttribute('id', $eltId);
          return $this;
      }
code_tokens: protected function buildIdAttr ( $ eltId = null , bool $ errorIfExists = false ) { if ( $ errorIfExists && isset ( $ this -> attributes [ 'id' ] ) ) { throw new \ Osf \ Exception \ ArchException ( 'Id element already set' ) ; } if ( $ eltId === null ) { $ eltId = 'e' . self :: $ eltIdCount ++ ; } $ this -> setAttribute ( 'id' , $ eltId ) ; return $ this ; }
docstring: Build an id attribute
  @param string $eltId
  @param bool $errorIfExists
  @return $this
  @throws \Osf\Exception\ArchException
docstring_tokens: Build an id attribute