View file vendor/symfony/http-kernel/Profiler/ProfilerStorageInterface.php

File size: 1.61Kb
  1. <?php
  2.  
  3. /*
  4. * This file is part of the Symfony package.
  5. *
  6. * (c) Fabien Potencier <fabien@symfony.com>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11.  
  12. namespace Symfony\Component\HttpKernel\Profiler;
  13.  
  14. /**
  15. * ProfilerStorageInterface.
  16. *
  17. * This interface exists for historical reasons. The only supported
  18. * implementation is FileProfilerStorage.
  19. *
  20. * As the profiler must only be used on non-production servers, the file storage
  21. * is more than enough and no other implementations will ever be supported.
  22. *
  23. * @internal
  24. *
  25. * @author Fabien Potencier <fabien@symfony.com>
  26. */
  27. interface ProfilerStorageInterface
  28. {
  29. /**
  30. * Finds profiler tokens for the given criteria.
  31. *
  32. * @param int|null $limit The maximum number of tokens to return
  33. * @param int|null $start The start date to search from
  34. * @param int|null $end The end date to search to
  35. *
  36. * @return array An array of tokens
  37. */
  38. public function find(?string $ip, ?string $url, ?int $limit, ?string $method, int $start = null, int $end = null): array;
  39.  
  40. /**
  41. * Reads data associated with the given token.
  42. *
  43. * The method returns false if the token does not exist in the storage.
  44. *
  45. * @return Profile|null The profile associated with token
  46. */
  47. public function read(string $token): ?Profile;
  48.  
  49. /**
  50. * Saves a Profile.
  51. *
  52. * @return bool Write operation successful
  53. */
  54. public function write(Profile $profile): bool;
  55.  
  56. /**
  57. * Purges all data from the database.
  58. */
  59. public function purge();
  60. }