Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
yii2-core
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
palax-packages
yii2-core
Merge requests
!5
Fix: remove unused props
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix: remove unused props
fix/remove_unused_props
into
main
Overview
0
Commits
2
Pipelines
0
Changes
1
Merged
Глухих Алексей Александрович
requested to merge
fix/remove_unused_props
into
main
1 year ago
Overview
0
Commits
2
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
06b34e47
2 commits,
1 year ago
1 file
+
13
−
1
Expand all files
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/api/actions/DataHandlerAction.php
+
13
−
1
Options
@@ -39,7 +39,7 @@ class DataHandlerAction extends ApiAction
$reflectionClass
=
new
ReflectionClass
(
$this
->
dataHandlerClass
);
$initialDataHandlerConfig
=
$this
->
dataHandlerConfig
?
(
$this
->
dataHandlerConfig
)()
:
[];
/** @var DataHandler $instance */
$instance
=
$reflectionClass
->
newInstanceArgs
([
'config'
=>
$initialDataHandlerConfig
+
$this
->
get
Data
(
)]);
$instance
=
$reflectionClass
->
newInstanceArgs
([
'config'
=>
$initialDataHandlerConfig
+
$this
->
get
ClearData
(
$reflectionClass
)]);
$this
->
dataHandler
=
$instance
;
}
catch
(
Throwable
$t
)
{
Yii
::
info
([
@@ -50,4 +50,16 @@ class DataHandlerAction extends ApiAction
return
true
;
}
protected
function
getClearData
(
ReflectionClass
$reflectionClass
):
mixed
{
$data
=
$this
->
getData
();
foreach
(
$data
as
$key
=>
$item
)
{
if
(
!
$reflectionClass
->
hasProperty
(
$key
))
{
unset
(
$data
[
$key
]);
}
}
return
$data
;
}
}