Skip to content

Commit fdc1257

Browse files
committed
added deprecated notices
1 parent 9d54a1a commit fdc1257

File tree

8 files changed

+45
-42
lines changed

8 files changed

+45
-42
lines changed

src/Forms/Container.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ public function getUntrustedValues(string|object|null $returnType = null, ?array
171171
}
172172

173173

174-
/** @deprecated use getUntrustedValues() */
174+
#[\Deprecated('use getUntrustedValues()')]
175175
public function getUnsafeValues($returnType, ?array $controls = null)
176176
{
177+
trigger_error(__METHOD__ . '() was renamed to getUntrustedValues()', E_USER_DEPRECATED);
177178
return $this->getUntrustedValues($returnType, $controls);
178179
}
179180

@@ -555,9 +556,10 @@ public function addImageButton(string $name, ?string $src = null, ?string $alt =
555556
}
556557

557558

558-
/** @deprecated use addImageButton() */
559+
#[\Deprecated('use addImageButton()')]
559560
public function addImage(): Controls\ImageButton
560561
{
562+
trigger_error(__METHOD__ . '() was renamed to addImageButton()', E_USER_DEPRECATED);
561563
return $this->addImageButton(...func_get_args());
562564
}
563565

src/Forms/Controls/Checkbox.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ public function getContainerPrototype(): Html
8989
}
9090

9191

92-
/** @deprecated use getContainerPrototype() */
92+
#[\Deprecated('use getContainerPrototype()')]
9393
public function getSeparatorPrototype(): Html
9494
{
95+
trigger_error(__METHOD__ . '() was renamed to getContainerPrototype()', E_USER_DEPRECATED);
9596
return $this->container;
9697
}
9798
}

src/Forms/Controls/CsrfProtection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CsrfProtection extends HiddenField
2121
{
2222
public const Protection = 'Nette\Forms\Controls\CsrfProtection::validateCsrf';
2323

24-
/** @deprecated use CsrfProtection::Protection */
24+
#[\Deprecated('use CsrfProtection::Protection')]
2525
public const PROTECTION = self::Protection;
2626

2727
public ?Nette\Http\Session $session = null;

src/Forms/Controls/SelectBox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SelectBox extends ChoiceControl
2121
/** validation rule */
2222
public const Valid = ':selectBoxValid';
2323

24-
/** @deprecated use SelectBox::Valid */
24+
#[\Deprecated('use SelectBox::Valid')]
2525
public const VALID = self::Valid;
2626

2727
/** of option / optgroup */

src/Forms/Controls/UploadControl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class UploadControl extends BaseControl
2525
/** validation rule */
2626
public const Valid = ':uploadControlValid';
2727

28-
/** @deprecated use UploadControl::Valid */
28+
#[\Deprecated('use UploadControl::Valid')]
2929
public const VALID = self::Valid;
3030

3131
private bool $nullable = false;

src/Forms/Form.php

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -83,106 +83,106 @@ class Form extends Container implements Nette\HtmlStringable
8383
/** @internal protection token ID */
8484
public const ProtectorId = '_token_';
8585

86-
/** @deprecated use Form::Equal */
86+
#[\Deprecated('use Form::Equal')]
8787
public const EQUAL = self::Equal;
8888

89-
/** @deprecated use Form::IsIn */
89+
#[\Deprecated('use Form::IsIn')]
9090
public const IS_IN = self::IsIn;
9191

92-
/** @deprecated use Form::NotEqual */
92+
#[\Deprecated('use Form::NotEqual')]
9393
public const NOT_EQUAL = self::NotEqual;
9494

95-
/** @deprecated use Form::IsNotIn */
95+
#[\Deprecated('use Form::IsNotIn')]
9696
public const IS_NOT_IN = self::IsNotIn;
9797

98-
/** @deprecated use Form::Filled */
98+
#[\Deprecated('use Form::Filled')]
9999
public const FILLED = self::Filled;
100100

101-
/** @deprecated use Form::Blank */
101+
#[\Deprecated('use Form::Blank')]
102102
public const BLANK = self::Blank;
103103

104-
/** @deprecated use Form::Required */
104+
#[\Deprecated('use Form::Required')]
105105
public const REQUIRED = self::Required;
106106

107-
/** @deprecated use Form::Valid */
107+
#[\Deprecated('use Form::Valid')]
108108
public const VALID = self::Valid;
109109

110-
/** @deprecated use Form::Submitted */
110+
#[\Deprecated('use Form::Submitted')]
111111
public const SUBMITTED = self::Submitted;
112112

113-
/** @deprecated use Form::MinLength */
113+
#[\Deprecated('use Form::MinLength')]
114114
public const MIN_LENGTH = self::MinLength;
115115

116-
/** @deprecated use Form::MaxLength */
116+
#[\Deprecated('use Form::MaxLength')]
117117
public const MAX_LENGTH = self::MaxLength;
118118

119-
/** @deprecated use Form::Length */
119+
#[\Deprecated('use Form::Length')]
120120
public const LENGTH = self::Length;
121121

122-
/** @deprecated use Form::Email */
122+
#[\Deprecated('use Form::Email')]
123123
public const EMAIL = self::Email;
124124

125-
/** @deprecated use Form::Pattern */
125+
#[\Deprecated('use Form::Pattern')]
126126
public const PATTERN = self::Pattern;
127127

128-
/** @deprecated use Form::PatternCI */
128+
#[\Deprecated('use Form::PatternCI')]
129129
public const PATTERN_ICASE = self::PatternInsensitive;
130130

131-
/** @deprecated use Form::Integer */
131+
#[\Deprecated('use Form::Integer')]
132132
public const INTEGER = self::Integer;
133133

134-
/** @deprecated use Form::Numeric */
134+
#[\Deprecated('use Form::Numeric')]
135135
public const NUMERIC = self::Numeric;
136136

137-
/** @deprecated use Form::Float */
137+
#[\Deprecated('use Form::Float')]
138138
public const FLOAT = self::Float;
139139

140-
/** @deprecated use Form::Min */
140+
#[\Deprecated('use Form::Min')]
141141
public const MIN = self::Min;
142142

143-
/** @deprecated use Form::Max */
143+
#[\Deprecated('use Form::Max')]
144144
public const MAX = self::Max;
145145

146-
/** @deprecated use Form::Range */
146+
#[\Deprecated('use Form::Range')]
147147
public const RANGE = self::Range;
148148

149-
/** @deprecated use Form::Count */
149+
#[\Deprecated('use Form::Count')]
150150
public const COUNT = self::Count;
151151

152-
/** @deprecated use Form::MaxFileSize */
152+
#[\Deprecated('use Form::MaxFileSize')]
153153
public const MAX_FILE_SIZE = self::MaxFileSize;
154154

155-
/** @deprecated use Form::MimeType */
155+
#[\Deprecated('use Form::MimeType')]
156156
public const MIME_TYPE = self::MimeType;
157157

158-
/** @deprecated use Form::Image */
158+
#[\Deprecated('use Form::Image')]
159159
public const IMAGE = self::Image;
160160

161-
/** @deprecated use Form::MaxPostSize */
161+
#[\Deprecated('use Form::MaxPostSize')]
162162
public const MAX_POST_SIZE = self::MaxPostSize;
163163

164-
/** @deprecated use Form::Get */
164+
#[\Deprecated('use Form::Get')]
165165
public const GET = self::Get;
166166

167-
/** @deprecated use Form::Post */
167+
#[\Deprecated('use Form::Post')]
168168
public const POST = self::Post;
169169

170-
/** @deprecated use Form::DataText */
170+
#[\Deprecated('use Form::DataText')]
171171
public const DATA_TEXT = self::DataText;
172172

173-
/** @deprecated use Form::DataLine */
173+
#[\Deprecated('use Form::DataLine')]
174174
public const DATA_LINE = self::DataLine;
175175

176-
/** @deprecated use Form::DataFile */
176+
#[\Deprecated('use Form::DataFile')]
177177
public const DATA_FILE = self::DataFile;
178178

179-
/** @deprecated use Form::DataKeys */
179+
#[\Deprecated('use Form::DataKeys')]
180180
public const DATA_KEYS = self::DataKeys;
181181

182-
/** @deprecated use Form::TrackerId */
182+
#[\Deprecated('use Form::TrackerId')]
183183
public const TRACKER_ID = self::TrackerId;
184184

185-
/** @deprecated use Form::ProtectorId */
185+
#[\Deprecated('use Form::ProtectorId')]
186186
public const PROTECTOR_ID = self::ProtectorId;
187187

188188
/**

src/Forms/Rendering/DataClassGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class DataClassGenerator
2424
public bool $useSmartObject = true;
2525

2626

27-
/** @deprecated use Nette\Latte\Blueprint::dataClass() */
27+
#[\Deprecated('use Nette\Latte\Blueprint::dataClass()')]
2828
public function generateCode(Form $form, ?string $baseName = null): string
2929
{
3030
trigger_error(__METHOD__ . '() is deprecated, use ' . Blueprint::class . '::dataClass()', E_USER_DEPRECATED);

src/Forms/Rendering/LatteRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
final class LatteRenderer
2121
{
22-
/** @deprecated use Nette\Latte\Blueprint::latte() */
22+
#[\Deprecated('use Nette\Latte\Blueprint::latte()')]
2323
public function render(Form $form): string
2424
{
2525
trigger_error(__METHOD__ . '() is deprecated, use ' . Blueprint::class . '::latte()', E_USER_DEPRECATED);

0 commit comments

Comments
 (0)