What are some best practices for maintaining flat data hierarchies when using wrapper classes in PHP?

When using wrapper classes in PHP to maintain flat data hierarchies, it is important to ensure that the wrapper class does not introduce unnecessary nesting or complexity. To maintain a flat data hierarchy, the wrapper class should only contain methods for accessing and manipulating the data, without adding additional layers of abstraction.

class DataWrapper {
    private $data;

    public function __construct($data) {
        $this->data = $data;
    }

    public function getData() {
        return $this->data;
    }

    public function setData($newData) {
        $this->data = $newData;
    }

    // Add more methods as needed for manipulating the data
}