[FEATURE] Add ObjectManager->getScope like in TYPO3.Flow

This method detects if a class is of type prototype or
singleton. We need this method as it is a dependency for
further backporting of the Flow validation api.

Releases: 6.2
Resolves: #48766
Change-Id: I4d6b043a4015c31ede0b099eebed4491a38723cd
[TASK] Make preperations for backporting Flow validation api

Synced some parts of Extbase validation with the one of
Flow without changing actual behaviour.

Releases: 6.2
Resolves: #48767
Change-Id: I0801f4faaa2d9e0fea31e51704ff0a30ca2c4ccb
[WIP]

Change-Id: I9622a5c3a09689a7db6e80df361b8f6fec671c83