[FEATURE] Add trait to detect public deprecated methods
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / UnitDeprecated / Compatibility / Fixtures / PublicMethodDeprecationTraitTextFixture.php
1 <?php
2 declare(strict_types = 1);
3 namespace TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\Fixtures;
4
5 /*
6 * This file is part of the TYPO3 CMS project.
7 *
8 * It is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License, either version 2
10 * of the License, or any later version.
11 *
12 * For the full copyright and license information, please read the
13 * LICENSE.txt file that was distributed with this source code.
14 *
15 * The TYPO3 project - inspiring people to share!
16 */
17
18 use TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait;
19
20 /**
21 * Test class using public method deprecation trait test fixture
22 */
23 class PublicMethodDeprecationTraitTextFixture
24 {
25 use PublicMethodDeprecationTrait;
26
27 protected $deprecatedPublicMethods = [
28 'methodMadeProtected' => 'Deprecation text',
29 'methodMadeProtectedWithArguments' => 'Deprecation text',
30 'methodMadeProtectedWithReturn' => 'Deprecation text',
31 ];
32
33 public function standardPublicMethod(): void
34 {
35 throw new \RuntimeException('test', 1528822131);
36 }
37
38 protected function standardProtectedMethod(): void
39 {
40 // empty
41 }
42
43 /**
44 * @private
45 */
46 protected function methodMadeProtected(): void
47 {
48 throw new \RuntimeException('test', 1528822485);
49 }
50
51 /**
52 * @private
53 */
54 protected function methodMadeProtectedWithReturn(): string
55 {
56 return 'foo';
57 }
58
59 /**
60 * @private
61 * @param string $arg1
62 * @param string $arg2
63 */
64 protected function methodMadeProtectedWithArguments(string $arg1, string $arg2): void
65 {
66 if ($arg1 === 'foo' && $arg2 === 'bar') {
67 throw new \RuntimeException('test', 1528822486);
68 }
69 }
70 }