@@ -56,6 +56,8 @@ public function __construct(
5656
5757 /**
5858 * @phpstan-param \Symfony\Component\HttpFoundation\ResponseHeaderBag::DISPOSITION_*|null $contentDisposition
59+ *
60+ * @return $this
5961 */
6062 public function setFile (BinaryFile $ file , ?string $ contentDisposition = null , bool $ autoLastModified = true ): static
6163 {
@@ -79,6 +81,8 @@ public function getFile(): BinaryFile
7981
8082 /**
8183 * Automatically sets the Last-Modified header according the file modification date.
84+ *
85+ * @return $this
8286 */
8387 public function setAutoLastModified (): static
8488 {
@@ -94,6 +98,8 @@ public function setAutoLastModified(): static
9498 *
9599 * @param string $filename Optionally use this filename instead of the real name of the file
96100 * @param string $filenameFallback A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename
101+ *
102+ * @return $this
97103 */
98104 public function setContentDisposition (string $ disposition , string $ filename = '' , string $ filenameFallback = '' ): BinaryStreamResponse
99105 {
@@ -111,6 +117,9 @@ public function setContentDisposition(string $disposition, string $filename = ''
111117 return $ this ;
112118 }
113119
120+ /**
121+ * @return $this
122+ */
114123 public function prepare (Request $ request ): static
115124 {
116125 $ this ->headers ->set ('Content-Length ' , (string )$ this ->file ->size );
@@ -144,6 +153,8 @@ public function prepare(Request $request): static
144153 * Sends the file.
145154 *
146155 * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
156+ *
157+ * @return $this
147158 */
148159 public function sendContent (): static
149160 {
@@ -170,6 +181,8 @@ public function sendContent(): static
170181
171182 /**
172183 * @throws \LogicException when the content is not null
184+ *
185+ * @return $this
173186 */
174187 public function setContent (?string $ content ): static
175188 {
@@ -216,12 +229,12 @@ private function processRangeRequest(Request $request): void
216229 if ($ start < 0 || $ end > $ fileSize - 1 ) {
217230 $ this ->setStatusCode (
218231 Response::HTTP_REQUESTED_RANGE_NOT_SATISFIABLE
219- ); // HTTP_REQUESTED_RANGE_NOT_SATISFIABLE
232+ );
220233 } elseif ($ start !== 0 || $ end !== $ fileSize - 1 ) {
221234 $ this ->maxlen = $ end < $ fileSize ? $ end - $ start + 1 : -1 ;
222235 $ this ->offset = $ start ;
223236
224- $ this ->setStatusCode (Response::HTTP_PARTIAL_CONTENT ); // HTTP_PARTIAL_CONTENT
237+ $ this ->setStatusCode (Response::HTTP_PARTIAL_CONTENT );
225238 $ this ->headers ->set ('Content-Range ' , sprintf ('bytes %s-%s/%s ' , $ start , $ end , $ fileSize ));
226239 $ this ->headers ->set ('Content-Length ' , $ end - $ start + 1 );
227240 }
0 commit comments