`if (!$serverSide) { return; }` would make the code easier to follow and reduce indentation.