original_string: public static function decorate(StreamInterface $stream, array $methods)
      {
          // If any of the required methods were not provided, then simply
          // proxy to the decorated stream.
          foreach (array_diff(static::SLOTS, array_keys($methods)) as $diff) {
              $methods[$diff] = [$stream, $diff];
          }
  
          return new self($methods);
      }
code: public static function decorate(StreamInterface $stream, array $methods)
      {
          // If any of the required methods were not provided, then simply
          // proxy to the decorated stream.
          foreach (array_diff(static::SLOTS, array_keys($methods)) as $diff) {
              $methods[$diff] = [$stream, $diff];
          }
  
          return new self($methods);
      }
code_tokens: public static function decorate ( StreamInterface $ stream , array $ methods ) { // If any of the required methods were not provided, then simply // proxy to the decorated stream. foreach ( array_diff ( static :: SLOTS , array_keys ( $ methods ) ) as $ diff ) { $ methods [ $ diff ] = [ $ stream , $ diff ] ; } return new self ( $ methods ) ; }
docstring: Adds custom functionality to an underlying stream by intercepting
  specific method calls.
  
  @param StreamInterface $stream  Stream to decorate
  @param array           $methods Hash of method name to a closure
  
  @return FnStream
docstring_tokens: Adds custom functionality to an underlying stream by intercepting specific method calls .