Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Commit cbbd485

Browse files
author
Andrey Helldar
committed
additionalContent method has been renamed to the with
1 parent c9d2501 commit cbbd485

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/Services/ResponseService.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class ResponseService
1010
{
1111
/** @var array */
12-
protected $additionalContent = [];
12+
protected $with = [];
1313

1414
/** @var null|string|int|array|object */
1515
protected $content = null;
@@ -53,13 +53,13 @@ public function content($content = null)
5353
}
5454

5555
/**
56-
* @param array $content
56+
* @param array $with
5757
*
5858
* @return $this
5959
*/
60-
public function additionalContent(array $content = [])
60+
public function with(array $with = [])
6161
{
62-
$this->additionalContent = $content;
62+
$this->with = $with;
6363

6464
return $this;
6565
}
@@ -123,13 +123,13 @@ protected function jsonResponse()
123123

124124
private function mergeContent($content)
125125
{
126-
if (!$this->additionalContent) {
126+
if (!$this->with) {
127127
return $content;
128128
}
129129

130130
$content = is_array($content) ? $content : compact('content');
131131

132-
return array_merge($content, $this->additionalContent);
132+
return array_merge($content, $this->with);
133133
}
134134

135135
private function e($value = null, $doubleEncode = true)

src/helpers.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
* @param null|string|int|array|object $content
99
* @param int $status_code
1010
* @param array $headers
11-
* @param array $additional_content
11+
* @param array $with
1212
*
1313
* @return \Symfony\Component\HttpFoundation\JsonResponse
1414
*/
15-
function api_response($content = null, $status_code = 200, $headers = [], array $additional_content = [])
15+
function api_response($content = null, $status_code = 200, $headers = [], array $with = [])
1616
{
1717
return ResponseService::init()
1818
->headers($headers)
1919
->content($content)
20-
->additionalContent($additional_content)
20+
->with($with)
2121
->status($status_code)
2222
->response();
2323
}

0 commit comments

Comments
 (0)