it looks like $data in line 172 is set as a string earlier in the code. While you do not have to explicitly set data types for most stuff in PHP, IF $data was set to a string value, you cannot then use it as an array in that way. That line appears to be saying `add a new entry in this array at the end with the value ...` and the array you are setting.
If you are not using $data earlier, then simply get rid of the square brackets after that.
If that doesn't solve it, I might be able to help if I saw more of the code