‪TYPO3CMS  10.4
TypeConverterException.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 
23 final class ‪TypeConverterException extends \TYPO3\CMS\Extbase\Property\Exception\TypeConverterException
24 {
28  protected ‪$error;
29 
31  {
32  // [phpstan] Unsafe usage of new static()
33  // todo: Either mark this class or its constructor final or use new self instead.
34  $exception = new static(‪$error->‪getMessage(), ‪$error->‪getCode());
35  $exception->error = ‪$error;
36 
37  return $exception;
38  }
39 
40  public function ‪getError(): ‪Error
41  {
42  if (empty($this->error)) {
43  return new ‪Error($this->getMessage(), $this->getCode(), [$this->getPrevious()]);
44  }
45 
46  return ‪$this->error;
47  }
48 }
‪TYPO3\CMS\Form\Mvc\Property\Exception\TypeConverterException\getError
‪getError()
Definition: TypeConverterException.php:39
‪TYPO3\CMS\Form\Mvc\Property\Exception\TypeConverterException\fromError
‪static fromError(Error $error)
Definition: TypeConverterException.php:29
‪TYPO3\CMS\Extbase\Error\Message\getCode
‪int getCode()
Definition: Message.php:80
‪TYPO3\CMS\Form\Mvc\Property\Exception
Definition: TypeConverterException.php:16
‪TYPO3\CMS\Extbase\Error\Error
Definition: Error.php:25
‪TYPO3\CMS\Form\Mvc\Property\Exception\TypeConverterException
Definition: TypeConverterException.php:24
‪TYPO3\CMS\Extbase\Error\Message\getMessage
‪string getMessage()
Definition: Message.php:70
‪TYPO3\CMS\Form\Mvc\Property\Exception\TypeConverterException\$error
‪Error $error
Definition: TypeConverterException.php:27