ResetInterface.php 999 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Contracts\Service;
  11. /**
  12. * Provides a way to reset an object to its initial state.
  13. *
  14. * When calling the "reset()" method on an object, it should be put back to its
  15. * initial state. This usually means clearing any internal buffers and forwarding
  16. * the call to internal dependencies. All properties of the object should be put
  17. * back to the same state it had when it was first ready to use.
  18. *
  19. * This method could be called, for example, to recycle objects that are used as
  20. * services, so that they can be used to handle several requests in the same
  21. * process loop (note that we advise making your services stateless instead of
  22. * implementing this interface when possible.)
  23. */
  24. interface ResetInterface
  25. {
  26. public function reset();
  27. }