Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-forms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-forms
Merge requests
!28
release: 3.0.0
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
release: 3.0.0
devel
into
master
Overview
0
Commits
46
Pipelines
1
Changes
2
Merged
Krzysztof Dyszczyk
requested to merge
devel
into
master
2 years ago
Overview
0
Commits
46
Pipelines
1
Changes
2
0
0
Merge request reports
Viewing commit
e4208af7
Prev
Next
Show latest version
2 files
+
18
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Unverified
e4208af7
refactor: add consistency in typing and inline docs
· e4208af7
Bartek Jaskulski
authored
3 years ago
src/Field/BasicField.php
+
10
−
4
View file @ e4208af7
Edit in single-file editor
Open in Web IDE
Show full file
@@ -3,6 +3,7 @@
namespace
WPDesk\Forms\Field
;
use
WPDesk\Forms\Field
;
use
WPDesk\Forms\Form\FormWithFields
;
use
WPDesk\Forms\Sanitizer\NoSanitize
;
use
WPDesk\Forms\Serializer
;
use
WPDesk\Forms\Serializer\NoSerialize
;
@@ -25,6 +26,7 @@ abstract class BasicField implements Field {
public
function
__construct
()
{
$this
->
meta
[
'class'
]
=
[];
$this
->
meta
[
'priority'
]
=
10
;
}
public
function
get_label
()
{
@@ -299,12 +301,16 @@ abstract class BasicField implements Field {
return
$this
;
}
/** @return int */
public
function
get_priority
()
{
return
$this
->
meta
[
'priority'
]
??
10
;
public
function
get_priority
():
int
{
return
$this
->
meta
[
'priority'
];
}
public
function
set_priority
(
int
$priority
)
{
/**
* Fields are sorted by lowest priority value first, when getting FormWithFields
*
* @see FormWithFields::get_fields()
*/
public
function
set_priority
(
int
$priority
):
self
{
$this
->
meta
[
'priority'
]
=
$priority
;
return
$this
;
Loading