original_string: public static function dotSet(array $array, $key, $value)
      {
          $path = explode('.', $key);
          $total = count($path);
  
          $current = &$array;
  
          for ($ii = 0; $ii < $total; $ii++) {
              if ($ii === $total - 1) {
                  $current[$path[$ii]] = $value;
              } else {
                  if (!is_array($current)) {
                      throw new LackOfCoffeeException(
                          'Part of the path is not an array.'
                      );
                  }
  
                  if (!array_key_exists($path[$ii], $current)) {
                      $current[$path[$ii]] = [];
                  }
  
                  $current = &$current[$path[$ii]];
              }
          }
      }
code: public static function dotSet(array $array, $key, $value)
      {
          $path = explode('.', $key);
          $total = count($path);
  
          $current = &$array;
  
          for ($ii = 0; $ii < $total; $ii++) {
              if ($ii === $total - 1) {
                  $current[$path[$ii]] = $value;
              } else {
                  if (!is_array($current)) {
                      throw new LackOfCoffeeException(
                          'Part of the path is not an array.'
                      );
                  }
  
                  if (!array_key_exists($path[$ii], $current)) {
                      $current[$path[$ii]] = [];
                  }
  
                  $current = &$current[$path[$ii]];
              }
          }
      }
code_tokens: public static function dotSet ( array $ array , $ key , $ value ) { $ path = explode ( '.' , $ key ) ; $ total = count ( $ path ) ; $ current = & $ array ; for ( $ ii = 0 ; $ ii < $ total ; $ ii ++ ) { if ( $ ii === $ total - 1 ) { $ current [ $ path [ $ ii ] ] = $ value ; } else { if ( ! is_array ( $ current ) ) { throw new LackOfCoffeeException ( 'Part of the path is not an array.' ) ; } if ( ! array_key_exists ( $ path [ $ ii ] , $ current ) ) { $ current [ $ path [ $ ii ] ] = [ ] ; } $ current = & $ current [ $ path [ $ ii ] ] ; } } }
docstring: Set an array element using dot notation.
  
  Same as `Arr::dotGet()`, but the value is replaced instead of fetched.
  
  @param array $array
  @param string $key
  @param mixed $value
  
  @throws LackOfCoffeeException
docstring_tokens: Set an array element using dot notation .