Completed
Push — wip/steps ( c05a56...a944ff )
by Romain
02:56
created

skipViewHelperFormContextNotFound()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/*
3
 * 2017 Romain CANON <[email protected]>
4
 *
5
 * This file is part of the TYPO3 FormZ project.
6
 * It is free software; you can redistribute it and/or modify it
7
 * under the terms of the GNU General Public License, either
8
 * version 3 of the License, or any later version.
9
 *
10
 * For the full copyright and license information, see:
11
 * http://www.gnu.org/licenses/gpl-3.0.html
12
 */
13
14
namespace Romm\Formz\Exceptions;
15
16
use Romm\Formz\ViewHelpers\FieldViewHelper;
17
use Romm\Formz\ViewHelpers\FormIdentifierHashViewHelper;
18
use Romm\Formz\ViewHelpers\FormViewHelper;
19
use Romm\Formz\ViewHelpers\OptionViewHelper;
20
use Romm\Formz\ViewHelpers\Slot\HasViewHelper;
21
use Romm\Formz\ViewHelpers\Slot\RenderViewHelper;
22
use Romm\Formz\ViewHelpers\SlotViewHelper;
23
use Romm\Formz\ViewHelpers\Step\SkipViewHelper;
24
use Romm\Formz\ViewHelpers\Step\SubstepViewHelper;
25
26
class ContextNotFoundException extends FormzException
27
{
28
    const FORM_CONTEXT_NOT_FOUND = 'The view helper "%s" must be used inside the view helper "%s".';
29
30
    const FIELD_CONTEXT_NOT_FOUND = 'The view helper "%s" must be used inside the view helper "%s".';
31
32
    const FORM_IDENTIFIER_FORM_CONTEXT_NOT_FOUND = 'The form context was not found for the view helper "%". You must either fill the arguments `form` and `name`, or use this view helper inside "%s"';
33
34
    /**
35
     * @code 1465243085
36
     *
37
     * @return self
38
     */
39
    final public static function fieldViewHelperFormContextNotFound()
40
    {
41
        /** @var self $exception */
42
        $exception = self::getNewExceptionInstance(
43
            self::FORM_CONTEXT_NOT_FOUND,
44
            [FieldViewHelper::class, FormViewHelper::class]
45
        );
46
47
        return $exception;
48
    }
49
    /**
50
     * @code 1494337489
51
     *
52
     * @return self
53
     */
54
    final public static function substepViewHelperFormContextNotFound()
55
    {
56
        /** @var self $exception */
57
        $exception = self::getNewExceptionInstance(
58
            self::FORM_CONTEXT_NOT_FOUND,
59
            [SubstepViewHelper::class, FormViewHelper::class]
60
        );
61
62
        return $exception;
63
    }
64
65
    /**
66
     * @code 1561020379
67
     *
68
     * @return self
69
     */
70
    final public static function skipViewHelperFormContextNotFound()
71
    {
72
        /** @var self $exception */
73
        $exception = self::getNewExceptionInstance(
74
            self::FORM_CONTEXT_NOT_FOUND,
75
            [SkipViewHelper::class, FormViewHelper::class]
76
        );
77
78
        return $exception;
79
    }
80
81
    /**
82
     * @code 1465243287
83
     *
84
     * @return self
85
     */
86
    final public static function optionViewHelperFieldContextNotFound()
87
    {
88
        /** @var self $exception */
89
        $exception = self::getNewExceptionInstance(
90
            self::FIELD_CONTEXT_NOT_FOUND,
91
            [OptionViewHelper::class, FieldViewHelper::class]
92
        );
93
94
        return $exception;
95
    }
96
97
    /**
98
     * @code 1488473956
99
     *
100
     * @return self
101
     */
102
    final public static function slotRenderViewHelperFieldContextNotFound()
103
    {
104
        /** @var self $exception */
105
        $exception = self::getNewExceptionInstance(
106
            self::FIELD_CONTEXT_NOT_FOUND,
107
            [RenderViewHelper::class, FieldViewHelper::class]
108
        );
109
110
        return $exception;
111
    }
112
113
    /**
114
     * @code 1488474106
115
     *
116
     * @return self
117
     */
118
    final public static function slotViewHelperFieldContextNotFound()
119
    {
120
        /** @var self $exception */
121
        $exception = self::getNewExceptionInstance(
122
            self::FIELD_CONTEXT_NOT_FOUND,
123
            [SlotViewHelper::class, FieldViewHelper::class]
124
        );
125
126
        return $exception;
127
    }
128
129
    /**
130
     * @code 1488988566
131
     *
132
     * @return self
133
     */
134
    final public static function slotHasViewHelperFieldContextNotFound()
135
    {
136
        /** @var self $exception */
137
        $exception = self::getNewExceptionInstance(
138
            self::FIELD_CONTEXT_NOT_FOUND,
139
            [HasViewHelper::class, FieldViewHelper::class]
140
        );
141
142
        return $exception;
143
    }
144
145
    /**
146
     * @code 1490960228
147
     *
148
     * @return self
149
     */
150
    final public static function formIdentifierViewHelperFormContextNotFound()
151
    {
152
        /** @var self $exception */
153
        $exception = self::getNewExceptionInstance(
154
            self::FORM_IDENTIFIER_FORM_CONTEXT_NOT_FOUND,
155
            [FormIdentifierHashViewHelper::class, FormViewHelper::class]
156
        );
157
158
        return $exception;
159
    }
160
}
161