本文整理汇总了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;
}