Skip to content

Commit d24c147

Browse files
committed
added deprecated notices
1 parent e129c4f commit d24c147

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
@@ -172,9 +172,10 @@ public function getUntrustedValues(string|object|null $returnType = null, ?array
172172
}
173173

174174

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

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

558559

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

src/Forms/Controls/Checkbox.php

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

9292

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

src/Forms/Controls/CsrfProtection.php

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

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

2828
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
@@ -22,7 +22,7 @@ class SelectBox extends ChoiceControl
2222
/** validation rule */
2323
public const Valid = ':selectBoxValid';
2424

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

2828
/** of option / optgroup */

src/Forms/Controls/UploadControl.php

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

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

3232
private bool $nullable = false;

src/Forms/Form.php

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

190190
/**

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)