Skip to content

Commit bbe398b

Browse files
committed
public constants
1 parent 72eb97f commit bbe398b

File tree

4 files changed

+24
-21
lines changed

4 files changed

+24
-21
lines changed

src/Forms/Controls/CsrfProtection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818
class CsrfProtection extends HiddenField
1919
{
20-
const PROTECTION = 'Nette\Forms\Controls\CsrfProtection::validateCsrf';
20+
public const PROTECTION = 'Nette\Forms\Controls\CsrfProtection::validateCsrf';
2121

2222
/** @var Nette\Http\Session */
2323
public $session;

src/Forms/Controls/SelectBox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
class SelectBox extends ChoiceControl
1919
{
2020
/** validation rule */
21-
const VALID = ':selectBoxValid';
21+
public const VALID = ':selectBoxValid';
2222

2323
/** @var array of option / optgroup */
2424
private $options = [];

src/Forms/Controls/UploadControl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class UploadControl extends BaseControl
2121
{
2222
/** validation rule */
23-
const VALID = ':uploadControlValid';
23+
public const VALID = ':uploadControlValid';
2424

2525
/**
2626
* @param string|object

src/Forms/Form.php

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,21 @@
2626
class Form extends Container implements Nette\Utils\IHtmlString
2727
{
2828
/** validator */
29-
const EQUAL = ':equal',
29+
public const
30+
EQUAL = ':equal',
3031
IS_IN = self::EQUAL,
3132
NOT_EQUAL = ':notEqual',
3233
IS_NOT_IN = self::NOT_EQUAL,
3334
FILLED = ':filled',
3435
BLANK = ':blank',
3536
REQUIRED = self::FILLED,
36-
VALID = ':valid';
37+
VALID = ':valid',
3738

38-
// button
39-
const SUBMITTED = ':submitted';
39+
// button
40+
SUBMITTED = ':submitted',
4041

41-
// text
42-
const MIN_LENGTH = ':minLength',
42+
// text
43+
MIN_LENGTH = ':minLength',
4344
MAX_LENGTH = ':maxLength',
4445
LENGTH = ':length',
4546
EMAIL = ':email',
@@ -50,32 +51,34 @@ class Form extends Container implements Nette\Utils\IHtmlString
5051
FLOAT = ':float',
5152
MIN = ':min',
5253
MAX = ':max',
53-
RANGE = ':range';
54+
RANGE = ':range',
5455

55-
// multiselect
56-
const COUNT = self::LENGTH;
56+
// multiselect
57+
COUNT = self::LENGTH,
5758

58-
// file upload
59-
const MAX_FILE_SIZE = ':fileSize',
59+
// file upload
60+
MAX_FILE_SIZE = ':fileSize',
6061
MIME_TYPE = ':mimeType',
6162
IMAGE = ':image',
6263
MAX_POST_SIZE = ':maxPostSize';
6364

6465
/** method */
65-
const GET = 'get',
66+
public const
67+
GET = 'get',
6668
POST = 'post';
6769

6870
/** submitted data types */
69-
const DATA_TEXT = 1;
70-
const DATA_LINE = 2;
71-
const DATA_FILE = 3;
72-
const DATA_KEYS = 8;
71+
public const
72+
DATA_TEXT = 1,
73+
DATA_LINE = 2,
74+
DATA_FILE = 3,
75+
DATA_KEYS = 8;
7376

7477
/** @internal tracker ID */
75-
const TRACKER_ID = '_form_';
78+
public const TRACKER_ID = '_form_';
7679

7780
/** @internal protection token ID */
78-
const PROTECTOR_ID = '_token_';
81+
public const PROTECTOR_ID = '_token_';
7982

8083
/** @var callable[] function (Form $sender); Occurs when the form is submitted and successfully validated */
8184
public $onSuccess;

0 commit comments

Comments
 (0)