src/Brainly.php
private function fixer($data, $noWrite = false)
	{
		if (
			$noWrite or $this->writeCache($data)
		) {
			$data = $noWrite ? $data : json_decode($data, true);
			if ($data['success'] === true) {
				if (isset($data['data']['tasks']['items'])) {
					$r = [];
					foreach ($data['data']['tasks']['items'] as $k => $v) {
						$responses = [];
						foreach ($v['responses'] as $j => $q) {
							$responses[] = [
								"content" => $q['content']
							];
						}
						$r[] = [
							"content" 	=> $v['task']['content'],
							"responses"	=> $responses
						];
					}
					return $r;
				}
			}
		}
		return false;
	}
private function fixer($data, $noWrite = false)
	{
		if (
			$noWrite or $this->writeCache($data)
		) {
			$data = $noWrite ? $data : json_decode($data, true);
			if ($data['success'] === true) {
				if (isset($data['data']['tasks']['items'])) {
					$r = [];
					foreach ($data['data']['tasks']['items'] as $k => $v) {
						$responses = [];
						foreach ($v['responses'] as $j => $q) {
							$responses[] = [
								"content" => $q['content']
							];
						}
						$r[] = [
							"content" 	=> $v['task']['content'],
							"responses"	=> $responses
						];
					}
					return $r;
				}
			}
		}
		return false;
	}
private function fixer ( $ data , $ noWrite = false ) { if ( $ noWrite or $ this -> writeCache ( $ data ) ) { $ data = $ noWrite ? $ data : json_decode ( $ data , true ) ; if ( $ data [ 'success' ] === true ) { if ( isset ( $ data [ 'data' ] [ 'tasks' ] [ 'items' ] ) ) { $ r = [ ] ; foreach ( $ data [ 'data' ] [ 'tasks' ] [ 'items' ] as $ k => $ v ) { $ responses = [ ] ; foreach ( $ v [ 'responses' ] as $ j => $ q ) { $ responses [ ] = [ "content" => $ q [ 'content' ] ] ; } $ r [ ] = [ "content" => $ v [ 'task' ] [ 'content' ] , "responses" => $ responses ] ; } return $ r ; } } } return false ; }
Fix raw data.

@param string $data
@return array
Fix raw data .