phore/annotations

Phore Annotations Abstraction

Installs: 630

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/phore/annotations

dev-master / 0.1.x-dev 2016-12-01 12:57 UTC

This package is auto-updated.

Last update: 2025-09-25 09:35:42 UTC


README

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]