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


PHP Assert::path方法代码示例

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


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

示例1: __construct

 /**
  * Creates a new path mapping.
  *
  * @param string          $repositoryPath The repository path.
  * @param string|string[] $pathReferences The path references.
  *
  * @throws InvalidArgumentException If any of the arguments is invalid.
  */
 public function __construct($repositoryPath, $pathReferences)
 {
     Assert::path($repositoryPath);
     $pathReferences = (array) $pathReferences;
     Assert::notEmpty($pathReferences, 'At least one filesystem path must be passed.');
     Assert::allString($pathReferences, 'The filesystem paths must be strings. Got: %s');
     Assert::allNotEmpty($pathReferences, 'The filesystem paths must not be empty.');
     $this->repositoryPath = $repositoryPath;
     $this->pathReferences = $pathReferences;
 }
开发者ID:sensorario,项目名称:manager,代码行数:18,代码来源:PathMapping.php

示例2: removeRootPathMapping

 /**
  * {@inheritdoc}
  */
 public function removeRootPathMapping($repositoryPath)
 {
     Assert::path($repositoryPath);
     $this->assertMappingsLoaded();
     if (!$this->mappings->contains($repositoryPath, $this->rootPackage->getName())) {
         return;
     }
     $mapping = $this->mappings->get($repositoryPath, $this->rootPackage->getName());
     $tx = new Transaction();
     try {
         $syncOp = $this->syncRepositoryPath($repositoryPath);
         $syncOp->takeSnapshot();
         $tx->execute($this->unloadPathMapping($mapping));
         $tx->execute($this->removePathMappingFromPackageFile($repositoryPath));
         $tx->execute($syncOp);
         $this->saveRootPackageFile();
         $tx->commit();
     } catch (Exception $e) {
         $tx->rollback();
         throw $e;
     }
     $this->removeResolvedConflicts();
 }
开发者ID:niklongstone,项目名称:manager,代码行数:26,代码来源:RepositoryManagerImpl.php

示例3: __construct

 /**
  * Creates the conflict.
  *
  * @param string $repositoryPath The conflicting repository path.
  */
 public function __construct($repositoryPath)
 {
     Assert::path($repositoryPath);
     $this->repositoryPath = $repositoryPath;
 }
开发者ID:SenseException,项目名称:manager,代码行数:10,代码来源:PathConflict.php


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