WootManager.php

Contains \Drupal\woot\WootManager.

Namespace

Drupal\woot

Classes

Namesort descending Description
WootManager A simulated service for wooting. @todo throw useful exceptions

File

tests/resources/modules/d8/woot/src/WootManager.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Contains \Drupal\woot\WootManager.
  5. */
  6. namespace Drupal\woot;
  7. use Drupal\Component\Graph\Graph;
  8. use Drupal\Component\Utility\SafeMarkup;
  9. use Drupal\Core\Config\Entity\ConfigEntityInterface;
  10. use Drupal\Core\Entity\ContentEntityInterface;
  11. use Drupal\Core\Entity\EntityManager;
  12. use Drupal\Core\Session\AccountInterface;
  13. use Drupal\rest\LinkManager\LinkManagerInterface;
  14. use Drupal\rest\Plugin\Type\ResourcePluginManager;
  15. use Symfony\Component\Serializer\Serializer;
  16. /**
  17. * A simulated service for wooting.
  18. * @todo throw useful exceptions
  19. */
  20. class WootManager
  21. {
  22. /**
  23. * The current user.
  24. *
  25. * @var \Drupal\Core\Session\AccountInterface
  26. */
  27. protected $currentUser;
  28. /**
  29. * Constructs the default content manager.
  30. *
  31. * @param \Drupal\Core\Session|AccountInterface $current_user
  32. * The current user.
  33. */
  34. public function __construct(AccountInterface $current_user) {
  35. $this->currentUser = $current_user;
  36. }
  37. /**
  38. * Woof mightily. Note that we can include commands directly
  39. * inside a service class.
  40. *
  41. * @command woof
  42. * @aliases wf
  43. */
  44. public function woof()
  45. {
  46. return 'Woof!';
  47. }
  48. }