PHPDoc,文件抛出异常

时间:2020-05-14 18:01:26

标签: php cakephp phpstorm cakephp-3.0 phpdoc

PHPDoc是否有可能文件(在本例中为CakePHP模板文件)引发异常?

以下代码摘要:

<?PHP
/**
 * template for Excel Export
 *
 * @var \App\View\SpreadsheetView $this
 *
 *
 * @throws \PhpOffice\PhpSpreadsheet\Exception
 */

$this->SPREADSHEET->setActiveSheetIndex(0);
$title = "test-title";
$currentSheet = $this->SPREADSHEET->getActiveSheet();
$currentSheet->setTitle($title);
$this->SPREADSHEET->getProperties()
    ->setTitle($title)
    ->setSubject($title . ' ' . date('d.m.Y H:i'));

setActiveSheet可能会引发异常。 @throws \PhpOffice\PhpSpreadsheet\Exception对文件不起作用。 PhpStorm报告未处理的异常。我也知道,异常是在此模板文件之外处理的。但是我该怎么说PhpStorm?

0 个答案:

没有答案