original_string: public function with($hook)
      {
          if (!in_array($hook, PluginInterface::VALID_HOOKS)) {
              throw new InvalidArgumentException("The `{$hook}` hook is not a known plugin hook.");
          }
          foreach ($this as $plugin) {
              if ($plugin->isEnabled($hook)) {
                  yield $plugin;
              }
          }
      }
code: public function with($hook)
      {
          if (!in_array($hook, PluginInterface::VALID_HOOKS)) {
              throw new InvalidArgumentException("The `{$hook}` hook is not a known plugin hook.");
          }
          foreach ($this as $plugin) {
              if ($plugin->isEnabled($hook)) {
                  yield $plugin;
              }
          }
      }
code_tokens: public function with ( $ hook ) { if ( ! in_array ( $ hook , PluginInterface :: VALID_HOOKS ) ) { throw new InvalidArgumentException ( "The `{$hook}` hook is not a known plugin hook." ) ; } foreach ( $ this as $ plugin ) { if ( $ plugin -> isEnabled ( $ hook ) ) { yield $ plugin ; } } }
docstring: Filter the plugins to those with the named hook enabled.
  
  @param string $hook The hook to filter plugins by
  @return \Generator A generator containing matching plugins.
  @throws \InvalidArgumentException on invalid hooks
docstring_tokens: Filter the plugins to those with the named hook enabled .