I reduced my globals to only one. Seems a bit weird to inject a class with only one variable and a getter function, but I don't want any implicit dependencies, I want them all explicit and documented. Also I only want the "globals" accessible to the classes I give access to. So in a sense they are not global. Need to re-name to shared. LOAD_ON is the only variable that I need in multiple classes.
Is this the correct way (best practice) to implement a "global" variable when trying to adhere to SOLID / DRY (Don't Repeat Yourself) / OOP ( Object Oriented Programming).
<?php
class GlobalClass
{
private $LOAD_ON = 0;
public function getLoad()
{
return $this->LOAD_ON;
}
}