Skip to content

Commit

Permalink
Merge pull request #10 from myLocalInfluence/feat/add-attributes-in-r…
Browse files Browse the repository at this point in the history
…aw-body

feat: Add Also Attributes in Data to Job
  • Loading branch information
kangoo13 authored Nov 25, 2020
2 parents 39d6456 + f45bec7 commit a76d9db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"ext-json": "*"
},
"require-dev": {
"phpspec/phpspec": "^5.1"
"phpspec/phpspec": "^5.1|^6.1"
},
"autoload": {
"psr-4": {
Expand Down
7 changes: 5 additions & 2 deletions src/PubSub/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ public function getJobId()
*/
public function getRawBody()
{
$data = json_decode(base64_decode($this->job->data()), true);
$fullData = [
'data' => json_decode(base64_decode($this->job->data()), true),
'attributes' => $this->job->attributes()
];
$newArray = [
'job' => $this->classHandler . '@handle',
'data' => $data,
'data' => $fullData,
];

return json_encode($newArray);
Expand Down

0 comments on commit a76d9db

Please sign in to comment.