Added retrieval of sections

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10145
| License       | MIT
no it is not. Your IDE cannot guess that the return value is an array of Section objects when providing completion (well, some IDE could because we have phpdoc on the private property here, but we generally prefer documenting public stuff). The API doc builder cannot guess it either.
And someone not reading the full code may not guess it either.