We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Kitodo\Dlf\Validation; |
||
6 | |||
7 | /** |
||
8 | * (c) Kitodo. Key to digital objects e.V. <[email protected]> |
||
9 | * |
||
10 | * This file is part of the Kitodo and TYPO3 projects. |
||
11 | * |
||
12 | * @license GNU General Public License version 3 or later. |
||
13 | * For the full copyright and license information, please read the |
||
14 | * LICENSE.txt file that was distributed with this source code. |
||
15 | */ |
||
16 | |||
17 | trait LibXmlTrait |
||
18 | { |
||
19 | /** |
||
20 | * Add the errors from the libxml error buffer as validation error. |
||
21 | * |
||
22 | * To enable user error handling, you need to use libxml_use_internal_errors(true) beforehand. |
||
23 | * |
||
24 | * @return void |
||
25 | */ |
||
26 | public function addErrorsOfBuffer(): void |
||
27 | { |
||
28 | $errors = libxml_get_errors(); |
||
29 | foreach ($errors as $error) { |
||
30 | $this->addError($error->message, $error->code); |
||
0 ignored issues
–
show
|
|||
31 | } |
||
32 | libxml_clear_errors(); |
||
33 | } |
||
34 | |||
35 | public function enableErrorBuffer(): void |
||
36 | { |
||
37 | libxml_use_internal_errors(true); |
||
38 | } |
||
39 | |||
40 | public function disableErrorBuffer(): void |
||
41 | { |
||
42 | libxml_use_internal_errors(false); |
||
43 | } |
||
44 | } |
||
45 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.