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