當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。