File Manager Lite
Dir:
/home/codewavebd/public_html/vendor/symfony/http-foundation
Upload
[..]
AcceptHeader.php (8.81 KB)
Edit
Rename
Del
AcceptHeaderItem.php (3.16 KB)
Edit
Rename
Del
CHANGELOG.md (22.02 KB)
Edit
Rename
Del
Cookie.php (11.53 KB)
Edit
Rename
Del
EventStreamResponse.php (2.88 KB)
Edit
Rename
Del
Exception/
Rename
Del
File/
Rename
Del
FileBag.php (3.77 KB)
Edit
Rename
Del
HeaderBag.php (6.94 KB)
Edit
Rename
Del
HeaderUtils.php (9.07 KB)
Edit
Rename
Del
InputBag.php (5.26 KB)
Edit
Rename
Del
IpUtils.php (9.34 KB)
Edit
Rename
Del
JsonResponse.php (6.45 KB)
Edit
Rename
Del
LICENSE (1.04 KB)
Edit
Rename
Del
ParameterBag.php (8.03 KB)
Edit
Rename
Del
README.md (526 B)
Edit
Rename
Del
RateLimiter/
Rename
Del
RedirectResponse.php (2.57 KB)
Edit
Rename
Del
Request.php (75.9 KB)
Edit
Rename
Del
RequestMatcher/
Rename
Del
Response.php (39.6 KB)
Edit
Rename
Del
ResponseHeaderBag.php (7.79 KB)
Edit
Rename
Del
ServerBag.php (3.92 KB)
Edit
Rename
Del
ServerEvent.php (3.3 KB)
Edit
Rename
Del
Session/
Rename
Del
StreamedJsonResponse.php (5.65 KB)
Edit
Rename
Del
StreamedResponse.php (3.57 KB)
Edit
Rename
Del
Test/
Rename
Del
UriSigner.php (7.53 KB)
Edit
Rename
Del
UrlHelper.php (3.05 KB)
Edit
Rename
Del
composer.json (1.33 KB)
Edit
Rename
Del
redisconfig.php (0 B)
Edit
Rename
Del
Edit: ServerEvent.php
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation; /** * An event generated on the server intended for streaming to the client * as part of the SSE streaming technique. * * @implements \IteratorAggregate<string> * * @author Yonel Ceruto <open@yceruto.dev> */ class ServerEvent implements \IteratorAggregate { /** * @param string|iterable<string> $data The event data field for the message * @param string|null $type The event type * @param int|null $retry The number of milliseconds the client should wait * before reconnecting in case of network failure * @param string|null $id The event ID to set the EventSource object's last event ID value * @param string|null $comment The event comment */ public function __construct( private string|iterable $data, private ?string $type = null, private ?int $retry = null, private ?string $id = null, private ?string $comment = null, ) { } public function getData(): iterable|string { return $this->data; } /** * @return $this */ public function setData(iterable|string $data): static { $this->data = $data; return $this; } public function getType(): ?string { return $this->type; } /** * @return $this */ public function setType(string $type): static { $this->type = $type; return $this; } public function getRetry(): ?int { return $this->retry; } /** * @return $this */ public function setRetry(?int $retry): static { $this->retry = $retry; return $this; } public function getId(): ?string { return $this->id; } /** * @return $this */ public function setId(string $id): static { $this->id = $id; return $this; } public function getComment(): ?string { return $this->comment; } public function setComment(string $comment): static { $this->comment = $comment; return $this; } /** * @return \Traversable<string> */ public function getIterator(): \Traversable { static $lastRetry = null; $head = ''; if ($this->comment) { $head .= \sprintf(': %s', $this->comment)."\n"; } if ($this->id) { $head .= \sprintf('id: %s', $this->id)."\n"; } if ($this->retry > 0 && $this->retry !== $lastRetry) { $head .= \sprintf('retry: %s', $lastRetry = $this->retry)."\n"; } if ($this->type) { $head .= \sprintf('event: %s', $this->type)."\n"; } yield $head; if (is_iterable($this->data)) { foreach ($this->data as $data) { yield \sprintf('data: %s', $data)."\n"; } } elseif ('' !== $this->data) { yield \sprintf('data: %s', $this->data)."\n"; } yield "\n"; } }
Simpan