View sourcecode

The following files exists in this folder. Click to view.

phpdoc-cache-file_42952e918d3c06863630afe5a6a6c9f1.dat

1 lines ASCII Unix (LF)
1
O:39:"phpDocumentor\Descriptor\FileDescriptor":22:{s:7:"*hash";s:32:"5abef64a57a843cc61d2aad2a97d02f3";s:7:"*path";s:18:"DI/TInjectable.php";s:9:"*source";s:2932:"<?php

namespace Anax\DI;

/**
 * Interface to implement for DI aware services to let them know of the current $di
 *
 */
trait TInjectable
{

    /**
     * Properties
     */
    protected $di; // the service container



    /**
     * Set the service container to use
     *
     * @param class $di a service container
     *
     * @return $this
     */
    public function setDI($di)
    {
        $this->di = $di;
    }



    /**
     * Magic method to get and create services.
     * When created it is also stored as a parameter of this object.
     *
     * @param string $service name of class property not existing.
     *
     * @return class as the service requested.
     */
    public function __get($service)
    {
        if (!$this->di) {
            throw new \Exception(
                'In trait TInjectable used by class ' . __CLASS__ . '. You are trying to get
                message, code a property from $this->di, but $this->di is not set. Did you
                forget to call setDI()?'
            );
        }

        try {

            $this->$service = $this->di->get($service);
            return $this->$service;

        } catch (\Exception $e) {
            throw new \Exception(
                'In trait TInjectable used by class ' . __CLASS__ . '. You are trying to get
                a property (service) "' . $service . '" from $this->di, but the service is not
                set in $this->di. Did you misspell the service you are trying to reach or did
                you forget to load it into the $di container?'
                . $e->getMessage()
            );
        }
    }



   /**
     * Magic method to get and create services as a method call.
     * When created it is also stored as a parameter of this object.
     *
     * @param string $service   name of class property not existing.
     * @param array  $arguments Additional arguments to sen to the method (NOT IMPLEMENTED).
     *
     * @return class as the service requested.
     */
    public function __call($service, $arguments = [])
    {
        if (!$this->di) {
            throw new \Exception(
                'In trait TInjectable used by class ' . __CLASS__ . '. You are trying to call a
                method in $this->di, but $this->di is not set. Did you forget to call setDI()?'
            );
        }

        try {

            $this->$service = $this->di->get($service);
            return $this->$service;

        } catch (\Exception $e) {
            throw new \Exception(
                'In trait TInjectable used by class ' . __CLASS__ . '. You are trying to get a
                method (service) "' . $service . '" from $this->di, but the service is not set
                in $this->di. Did you misspell the service you are trying to reach or did you
                forget to load it into the $di container? '
                . $e->getMessage()
            );
        }
    }
}
";s:19:"*namespaceAliases";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:11:"*includes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:12:"*constants";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:12:"*functions";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:10:"*classes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:13:"*interfaces";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:9:"*traits";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{s:20:"\Anax\DI\TInjectable";O:40:"phpDocumentor\Descriptor\TraitDescriptor":14:{s:13:"*properties";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{s:2:"di";O:43:"phpDocumentor\Descriptor\PropertyDescriptor":16:{s:9:"*parent";r:19;s:8:"*types";N;s:10:"*default";N;s:9:"*static";b:0;s:13:"*visibility";s:9:"protected";s:8:"*fqsen";s:24:"\Anax\DI\TInjectable::di";s:7:"*name";s:2:"di";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:10:"Properties";s:14:"*description";s:0:"";s:17:"*fileDescriptor";N;s:7:"*line";i:15;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{s:3:"var";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}}}s:10:"*methods";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:3:{s:5:"setDI";O:41:"phpDocumentor\Descriptor\MethodDescriptor":17:{s:9:"*parent";r:19;s:11:"*abstract";b:0;s:8:"*final";b:0;s:9:"*static";b:0;s:13:"*visibility";s:6:"public";s:12:"*arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{s:3:"$di";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":15:{s:8:"*types";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:51:"phpDocumentor\Descriptor\Type\UnknownTypeDescriptor":1:{s:7:"*name";s:14:"\Anax\DI\class";}}}s:10:"*default";N;s:14:"*byReference";b:0;s:13:"*isVariadic";b:0;s:8:"*fqsen";s:0:"";s:7:"*name";s:3:"$di";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:0:"";s:14:"*description";s:19:"a service container";s:17:"*fileDescriptor";N;s:7:"*line";i:0;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}}}s:8:"*fqsen";s:29:"\Anax\DI\TInjectable::setDI()";s:7:"*name";s:5:"setDI";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:32:"Set the service container to use";s:14:"*description";s:0:"";s:17:"*fileDescriptor";N;s:7:"*line";i:26;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:5:"param";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:44:"phpDocumentor\Descriptor\Tag\ParamDescriptor":5:{s:15:"*variableName";s:3:"$di";s:8:"*types";r:54;s:7:"*name";s:5:"param";s:14:"*description";s:19:"a service container";s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:6:"return";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:45:"phpDocumentor\Descriptor\Tag\ReturnDescriptor":4:{s:8:"*types";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:51:"phpDocumentor\Descriptor\Type\UnknownTypeDescriptor":1:{s:7:"*name";s:5:"$this";}}}s:7:"*name";s:6:"return";s:14:"*description";s:0:"";s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}s:5:"__get";O:41:"phpDocumentor\Descriptor\MethodDescriptor":17:{s:9:"*parent";r:19;s:11:"*abstract";b:0;s:8:"*final";b:0;s:9:"*static";b:0;s:13:"*visibility";s:6:"public";s:12:"*arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{s:8:"$service";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":15:{s:8:"*types";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:46:"phpDocumentor\Descriptor\Type\StringDescriptor":0:{}}}s:10:"*default";N;s:14:"*byReference";b:0;s:13:"*isVariadic";b:0;s:8:"*fqsen";s:0:"";s:7:"*name";s:8:"$service";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:0:"";s:14:"*description";s:36:"name of class property not existing.";s:17:"*fileDescriptor";N;s:7:"*line";i:0;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}}}s:8:"*fqsen";s:29:"\Anax\DI\TInjectable::__get()";s:7:"*name";s:5:"__get";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:40:"Magic method to get and create services.";s:14:"*description";s:61:"When created it is also stored as a parameter of this object.";s:17:"*fileDescriptor";N;s:7:"*line";i:41;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:5:"param";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:44:"phpDocumentor\Descriptor\Tag\ParamDescriptor":5:{s:15:"*variableName";s:8:"$service";s:8:"*types";r:116;s:7:"*name";s:5:"param";s:14:"*description";s:36:"name of class property not existing.";s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:6:"return";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:45:"phpDocumentor\Descriptor\Tag\ReturnDescriptor":4:{s:8:"*types";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:51:"phpDocumentor\Descriptor\Type\UnknownTypeDescriptor":1:{s:7:"*name";s:14:"\Anax\DI\class";}}}s:7:"*name";s:6:"return";s:14:"*description";s:25:"as the service requested.";s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}s:6:"__call";O:41:"phpDocumentor\Descriptor\MethodDescriptor":17:{s:9:"*parent";r:19;s:11:"*abstract";b:0;s:8:"*final";b:0;s:9:"*static";b:0;s:13:"*visibility";s:6:"public";s:12:"*arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:8:"$service";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":15:{s:8:"*types";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:46:"phpDocumentor\Descriptor\Type\StringDescriptor":0:{}}}s:10:"*default";N;s:14:"*byReference";b:0;s:13:"*isVariadic";b:0;s:8:"*fqsen";s:0:"";s:7:"*name";s:8:"$service";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:0:"";s:14:"*description";s:36:"name of class property not existing.";s:17:"*fileDescriptor";N;s:7:"*line";i:0;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}s:10:"$arguments";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":15:{s:8:"*types";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:51:"phpDocumentor\Descriptor\Type\UnknownTypeDescriptor":1:{s:7:"*name";s:5:"array";}}}s:10:"*default";s:7:"array()";s:14:"*byReference";b:0;s:13:"*isVariadic";b:0;s:8:"*fqsen";s:0:"";s:7:"*name";s:10:"$arguments";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:0:"";s:14:"*description";s:60:"Additional arguments to sen to the method (NOT IMPLEMENTED).";s:17:"*fileDescriptor";N;s:7:"*line";i:0;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}}}s:8:"*fqsen";s:30:"\Anax\DI\TInjectable::__call()";s:7:"*name";s:6:"__call";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:57:"Magic method to get and create services as a method call.";s:14:"*description";s:61:"When created it is also stored as a parameter of this object.";s:17:"*fileDescriptor";N;s:7:"*line";i:78;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:5:"param";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{i:0;O:44:"phpDocumentor\Descriptor\Tag\ParamDescriptor":5:{s:15:"*variableName";s:8:"$service";s:8:"*types";r:177;s:7:"*name";s:5:"param";s:14:"*description";s:36:"name of class property not existing.";s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}i:1;O:44:"phpDocumentor\Descriptor\Tag\ParamDescriptor":5:{s:15:"*variableName";s:10:"$arguments";s:8:"*types";r:197;s:7:"*name";s:5:"param";s:14:"*description";s:60:"Additional arguments to sen to the method (NOT IMPLEMENTED).";s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:6:"return";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:45:"phpDocumentor\Descriptor\Tag\ReturnDescriptor":4:{s:8:"*types";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:51:"phpDocumentor\Descriptor\Type\UnknownTypeDescriptor":1:{s:7:"*name";s:14:"\Anax\DI\class";}}}s:7:"*name";s:6:"return";s:14:"*description";s:25:"as the service requested.";s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}}}s:13:"*usedTraits";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:8:"*fqsen";s:20:"\Anax\DI\TInjectable";s:7:"*name";s:11:"TInjectable";s:12:"*namespace";s:8:"\Anax\DI";s:10:"*package";s:0:"";s:10:"*summary";s:80:"Interface to implement for DI aware services to let them know of the current $di";s:14:"*description";s:0:"";s:17:"*fileDescriptor";r:1;s:7:"*line";i:9;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:7:"package";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:38:"phpDocumentor\Descriptor\TagDescriptor":3:{s:7:"*name";s:7:"package";s:14:"*description";s:7:"Default";s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:10:"subpackage";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}}}s:10:"*markers";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;a:3:{s:4:"type";s:0:"";s:7:"message";s:21:"the service container";s:4:"line";i:15;}}}s:8:"*fqsen";s:0:"";s:7:"*name";s:15:"TInjectable.php";s:12:"*namespace";N;s:10:"*package";s:7:"Default";s:10:"*summary";s:0:"";s:14:"*description";s:0:"";s:17:"*fileDescriptor";N;s:7:"*line";i:0;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:7:"package";r:269;s:10:"subpackage";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:40:"phpDocumentor\Descriptor\Validator\Error":4:{s:11:"*severity";s:5:"error";s:7:"*code";s:13:"PPC:ERR-50000";s:7:"*line";i:0;s:10:"*context";a:2:{s:11:"{{ value }}";s:2:"""";i:0;s:0:"";}}}}s:19:"*inheritedElement";N;}