當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Assertion::readable方法代碼示例

本文整理匯總了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;
 }
開發者ID:mathielen,項目名稱:report-write-engine,代碼行數:8,代碼來源:ExcelFileRepository.php

示例2: testReadable

 public function testReadable()
 {
     Assertion::readable(__FILE__);
     $this->setExpectedException('Assert\\AssertionFailedException', null, Assertion::INVALID_READABLE);
     Assertion::readable(__DIR__ . '/does-not-exist');
 }
開發者ID:GerDner,項目名稱:luck-docker,代碼行數:6,代碼來源:AssertTest.php

示例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));
 }
開發者ID:swisspost-yellowcube,項目名稱:yellowcube-php,代碼行數:17,代碼來源:Doc.php

示例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;
 }
開發者ID:swisspost-yellowcube,項目名稱:yellowcube-php,代碼行數:19,代碼來源:Config.php

示例5: __construct

 /**
  * @param string $path
  */
 public function __construct($path)
 {
     Assertion::readable($path);
     $this->setResource(fopen($path, "rb"));
     $this->validate();
 }
開發者ID:metasyntactical,項目名稱:xml-tools,代碼行數:9,代碼來源:FileXmlStream.php


注:本文中的Assert\Assertion::readable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。