File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 1010
1111namespace Bitbucket \API ;
1212
13+ use Bitbucket \API \Http \Listener \ApiOneCollectionListener ;
1314use Bitbucket \API \Http \Listener \NormalizeArrayListener ;
1415use Buzz \Message \MessageInterface ;
1516use Bitbucket \API \Http \ClientInterface ;
@@ -51,6 +52,7 @@ public function __construct(array $options = array(), ClientInterface $client =
5152 $ this ->httpClient = (null !== $ client ) ? $ client : new Client ($ options , $ client );
5253
5354 $ this ->httpClient ->addListener (new NormalizeArrayListener ());
55+ $ this ->httpClient ->addListener (new ApiOneCollectionListener ());
5456 }
5557
5658 /**
Original file line number Diff line number Diff line change @@ -131,7 +131,9 @@ private function getContent()
131131
132132 if (is_array ($ content ) && JSON_ERROR_NONE === json_last_error ()) {
133133 // replace reference inserted by `LegacyCollectionListener` with actual data.
134- if (is_string ($ content ['values ' ]) && strpos ($ content ['values ' ], '. ' ) !== false ) {
134+ if (array_key_exists ('values ' , $ content ) &&
135+ is_string ($ content ['values ' ]) &&
136+ strpos ($ content ['values ' ], '. ' ) !== false ) {
135137 $ content ['values ' ] = $ content [str_replace ('. ' , '' , $ content ['values ' ])];
136138 }
137139 return $ content ;
You can’t perform that action at this time.
0 commit comments