You haven't specified it clearly in the question, but I interpret your phrase "errors about strict standards regarding the way my code is laid out" as meaning that you're running PHP Code Sniffer or a similar tool, and it is where you're getting these errors from.
PHP Code Sniffer is an excellent tool for analysing your code in terms of whether it meets certain guidelines.
There are any number of sets of guidelines around for this -- people have argued for decades about whether to use tabs or spaces for indenting, whether to use CamelCase or snake_case for variable names, and many other points.
PHP Code Sniffer is flexible enough to be able to handle any of these guidelines, and can be configured to check your code for one of the common standards or your own custom set.
In recent years, the PHP world has settled on a common set of standards defined by the PHP-FIG (Framework Interop Group). These standards are known as PSR1, PSR2, etc. For PHP Code Sniffer, you just need to specify --standard=psr2 to get it to check your code against the PSR standards.
As I said, there are other standards you can work to, but most PHP code these days is being written to PSR standards, so it's a good place to start.
The PSR standards, like all other coding standards are purely a consensus of opinion; code that doesn't meet any standards isn't "wrong"; it's just harder to read.
The code you've quoted fails to conform to the PSR standards in several ways, mainly indenting and capitalisation of variable names in the bit you've quoted.
If you want to alter the code to meet the standards, it should be fairly easy. PHP Code Sniffer also comes with a companion tool called PHPCBF (PHP Code Beautifier and Fixer) which can auto-correct at least some of the errors that PHP Code Sniffer detects.
The alternative is simply to leave it as is; if this is a large chunk of old code that's being incorporated into a newer project, then it may make sense to keep it separate and simply exclude the old code from your tests.