original_string: protected function registerFill($style)
      {
          $styleId = $style->getId();
  
          // Currently - only solid backgrounds are supported
          // so $backgroundColor is a scalar value (RGB Color)
          $backgroundColor = $style->getBackgroundColor();
  
          if ($backgroundColor) {
              $isBackgroundColorRegistered = isset($this->registeredFills[$backgroundColor]);
  
              // We need to track the already registered background definitions
              if ($isBackgroundColorRegistered) {
                  $registeredStyleId = $this->registeredFills[$backgroundColor];
                  $registeredFillId = $this->styleIdToFillMappingTable[$registeredStyleId];
                  $this->styleIdToFillMappingTable[$styleId] = $registeredFillId;
              } else {
                  $this->registeredFills[$backgroundColor] = $styleId;
                  $this->styleIdToFillMappingTable[$styleId] = $this->fillIndex++;
              }
  
          } else {
              // The fillId maps a style to a fill declaration
              // When there is no background color definition - we default to 0
              $this->styleIdToFillMappingTable[$styleId] = 0;
          }
      }
code: protected function registerFill($style)
      {
          $styleId = $style->getId();
  
          // Currently - only solid backgrounds are supported
          // so $backgroundColor is a scalar value (RGB Color)
          $backgroundColor = $style->getBackgroundColor();
  
          if ($backgroundColor) {
              $isBackgroundColorRegistered = isset($this->registeredFills[$backgroundColor]);
  
              // We need to track the already registered background definitions
              if ($isBackgroundColorRegistered) {
                  $registeredStyleId = $this->registeredFills[$backgroundColor];
                  $registeredFillId = $this->styleIdToFillMappingTable[$registeredStyleId];
                  $this->styleIdToFillMappingTable[$styleId] = $registeredFillId;
              } else {
                  $this->registeredFills[$backgroundColor] = $styleId;
                  $this->styleIdToFillMappingTable[$styleId] = $this->fillIndex++;
              }
  
          } else {
              // The fillId maps a style to a fill declaration
              // When there is no background color definition - we default to 0
              $this->styleIdToFillMappingTable[$styleId] = 0;
          }
      }
code_tokens: protected function registerFill ( $ style ) { $ styleId = $ style -> getId ( ) ; // Currently - only solid backgrounds are supported // so $backgroundColor is a scalar value (RGB Color) $ backgroundColor = $ style -> getBackgroundColor ( ) ; if ( $ backgroundColor ) { $ isBackgroundColorRegistered = isset ( $ this -> registeredFills [ $ backgroundColor ] ) ; // We need to track the already registered background definitions if ( $ isBackgroundColorRegistered ) { $ registeredStyleId = $ this -> registeredFills [ $ backgroundColor ] ; $ registeredFillId = $ this -> styleIdToFillMappingTable [ $ registeredStyleId ] ; $ this -> styleIdToFillMappingTable [ $ styleId ] = $ registeredFillId ; } else { $ this -> registeredFills [ $ backgroundColor ] = $ styleId ; $ this -> styleIdToFillMappingTable [ $ styleId ] = $ this -> fillIndex ++ ; } } else { // The fillId maps a style to a fill declaration // When there is no background color definition - we default to 0 $ this -> styleIdToFillMappingTable [ $ styleId ] = 0 ; } }
docstring: Register a fill definition
  
  @param \Box\Spout\Writer\Style\Style $style
docstring_tokens: Register a fill definition