本文整理汇总了PHP中Assert\Assertion::readable方法的典型用法代码示例。如果您正苦于以下问题:PHP Assertion::readable方法的具体用法?PHP Assertion::readable怎么用?PHP Assertion::readable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assert\Assertion
的用法示例。
在下文中一共展示了Assertion::readable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($directory)
{
Assertion::directory($directory);
Assertion::readable($directory);
$directory .= substr($directory, -1) === '/' ? '' : '/';
//add ending slash
$this->directory = $directory;
}
示例2: testReadable
public function testReadable()
{
Assertion::readable(__FILE__);
$this->setExpectedException('Assert\\AssertionFailedException', null, Assertion::INVALID_READABLE);
Assertion::readable(__DIR__ . '/does-not-exist');
}
示例3: fromFile
/**
* Creates a new Doc with the DocStream set to the content of
* the specified file path.
*
* @param $DocType
* @param $DocMimeType
* @param $FilePath
* @return Doc
*
* @throws \InvalidArgumentException If the file does not exist or is not readable.
*/
public static function fromFile($DocType, $DocMimeType, $FilePath)
{
Assertion::file($FilePath, "{$FilePath} does not exist.");
Assertion::readable($FilePath, "{$FilePath} is not readable.");
return new self($DocType, $DocMimeType, file_get_contents($FilePath));
}
示例4: setCertificateFilePath
/**
* Sets a certificate file path and optional passphrase to use.
*
* @param string $certificateFilePath Path to a certificate file.
* @return Config
*
* @throws \InvalidArgumentException If certificate path is invalid.
*/
public function setCertificateFilePath($certificateFilePath, $passphrase = null)
{
Assertion::file($certificateFilePath);
Assertion::readable($certificateFilePath);
$this->certificateFilePath = $certificateFilePath;
$this->soapClientOptions['local_cert'] = $certificateFilePath;
if (!empty($passphrase)) {
$this->soapClientOptions['passphrase'] = $passphrase;
}
return $this;
}
示例5: __construct
/**
* @param string $path
*/
public function __construct($path)
{
Assertion::readable($path);
$this->setResource(fopen($path, "rb"));
$this->validate();
}