本文整理匯總了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;
}
示例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();
}
示例3: __construct
/**
* Creates the conflict.
*
* @param string $repositoryPath The conflicting repository path.
*/
public function __construct($repositoryPath)
{
Assert::path($repositoryPath);
$this->repositoryPath = $repositoryPath;
}