当前位置: 首页>>代码示例>>PHP>>正文


PHP DocParser::addNamespace方法代码示例

本文整理汇总了PHP中Doctrine\Common\Annotations\DocParser::addNamespace方法的典型用法代码示例。如果您正苦于以下问题:PHP DocParser::addNamespace方法的具体用法?PHP DocParser::addNamespace怎么用?PHP DocParser::addNamespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\Common\Annotations\DocParser的用法示例。


在下文中一共展示了DocParser::addNamespace方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testIssueMultipleNamespaces

 public function testIssueMultipleNamespaces()
 {
     $docblock = "@Entity";
     $parser = new DocParser();
     $parser->addNamespace("Doctrine\\Tests\\Common\\Annotations\\Ticket\\Doctrine\\ORM\\Mapping");
     $parser->addNamespace("Doctrine\\Tests\\Common\\Annotations\\Ticket\\Doctrine\\ORM");
     $annots = $parser->parse($docblock);
     $this->assertEquals(1, count($annots));
     $this->assertInstanceOf("Doctrine\\Tests\\Common\\Annotations\\Ticket\\Doctrine\\ORM\\Mapping\\Entity", $annots[0]);
 }
开发者ID:eltondias,项目名称:Relogio,代码行数:10,代码来源:DCOM58Test.php

示例2: register

 public function register(Application $app)
 {
     $app['translation-extractor.logger'] = $app->share(function (Application $app) {
         return $app['monolog'];
     });
     $app['translation-extractor.doc-parser'] = $app->share(function () {
         $parser = new DocParser();
         $parser->addNamespace("JMS\\TranslationBundle\\Annotation");
         return $parser;
     });
     $app['translation-extractor.node-visitors'] = $app->share(function (Application $app) {
         return [new ConstraintExtractor($app), new ValidationExtractor($app['validator']->getMetadataFactory()), new DefaultPhpFileExtractor($app['translation-extractor.doc-parser']), new TwigFileExtractor($app['twig']), new FormExtractor($app['translation-extractor.doc-parser']), new HelpMessageExtractor($app['translation-extractor.doc-parser'])];
     });
     $app['translation-extractor.file-extractor'] = $app->share(function (Application $app) {
         return new FileExtractor($app['twig'], $app['translation-extractor.logger'], $app['translation-extractor.node-visitors']);
     });
     $app['translation-extractor.extractor-manager'] = $app->share(function (Application $app) {
         return new ExtractorManager($app['translation-extractor.file-extractor'], $app['translation-extractor.logger']);
     });
     $app['translation-extractor.writer'] = $app->share(function (Application $app) {
         return new FileWriter($app['translation-extractor.writers']);
     });
     $app['translation-extractor.writers'] = $app->share(function () {
         return ['po' => new SymfonyDumperAdapter(new PoFileDumper(), 'po'), 'xlf' => new XliffDumper()];
     });
     $app['translation-extractor.loader-manager'] = $app->share(function (Application $app) {
         return new LoaderManager($app['translation-extractor.loaders']);
     });
     $app['translation-extractor.loaders'] = $app->share(function () {
         return ['po' => new SymfonyLoaderAdapter(new PoFileLoader()), 'xlf' => new XliffLoader()];
     });
     $app['translation-extractor.updater'] = $app->share(function (Application $app) {
         AnnotationRegistry::registerAutoloadNamespace('JMS\\TranslationBundle\\Annotation', $app['root.path'] . '/vendor/jms/translation-bundle');
         return new Updater($app['translation-extractor.loader-manager'], $app['translation-extractor.extractor-manager'], $app['translation-extractor.logger'], $app['translation-extractor.writer']);
     });
 }
开发者ID:luisbrito,项目名称:Phraseanet,代码行数:36,代码来源:TranslationExtractorServiceProvider.php

示例3: addNamespace

 /**
  * Adds a namespace in which we will look for annotations.
  *
  * @param string $namespace
  */
 public function addNamespace($namespace)
 {
     $this->parser->addNamespace($namespace);
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:9,代码来源:SimpleAnnotationReader.php

示例4: registerNamespace

 /**
  * @param string $namespace
  *
  * @throws RuntimeException
  */
 public function registerNamespace($namespace)
 {
     $namespace = ltrim($namespace, '\\');
     $this->docParser->addNamespace($namespace);
     $this->docParser->addNamespace('\\' . $namespace);
 }
开发者ID:christianblos,项目名称:codedocs,代码行数:11,代码来源:AnnotationParser.php


注:本文中的Doctrine\Common\Annotations\DocParser::addNamespace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。