https://github.com/phore/phore-annotations
Wrapper for Doctrine Annotaions
https://github.com/phore/phore-annotations
Last synced: 5 months ago
JSON representation
Wrapper for Doctrine Annotaions
- Host: GitHub
- URL: https://github.com/phore/phore-annotations
- Owner: phore
- Created: 2016-12-01T12:44:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-01T12:58:02.000Z (over 9 years ago)
- Last Synced: 2025-03-07T19:39:28.734Z (over 1 year ago)
- Language: PHP
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# phore-annotations
Wrapper for Doctrine Annotaions
## Create a AnnotationPack
```
class AnnotationPack_Application implements GoAnnotationPack {
/**
* Return a Array of Annotation Classnames to be loaded
*
* @return string[]
*/
public function getAnnotationClassNames() {
return [
Action::class,
AllowAll::class,
Api::class,
Filter::class,
Mount::class,
Parameter::class,
Requires::class,
Route::class,
ContextInit::class
];
}
}
```
## Register the Pack
```
Annotations::Register(AnnotationPack_Application::class);
```
## Access the Annotations
```
Annotations::ForClass(SomeClass::class);
Annotations::ForMethod(SomeClass::class, "methodName");
Annotations::ForProperty(SomeClass::class, "propertyName");
```
The Annotations returned are Doctrine Annotations
[http://doctrine-project.com]