Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
ui_patterns-3414293
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
ui_patterns-3414293
Commits
f77c38b4
Commit
f77c38b4
authored
Jan 16, 2024
by
Pierre Dureau
Browse files
Options
Downloads
Patches
Plain Diff
WIP SourcePluginManager
parent
fef64b8a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/SourcePluginManager.php
+16
-0
16 additions, 0 deletions
src/SourcePluginManager.php
with
16 additions
and
0 deletions
src/SourcePluginManager.php
+
16
−
0
View file @
f77c38b4
...
@@ -43,12 +43,28 @@ class SourcePluginManager extends DefaultPluginManager implements ContextAwarePl
...
@@ -43,12 +43,28 @@ class SourcePluginManager extends DefaultPluginManager implements ContextAwarePl
*/
*/
public
function
getDefinitionsForPropType
(
string
$prop_type_id
,
array
$contexts
=
[]):
array
{
public
function
getDefinitionsForPropType
(
string
$prop_type_id
,
array
$contexts
=
[]):
array
{
$definitions
=
$this
->
getDefinitionsForContexts
(
$contexts
);
$definitions
=
$this
->
getDefinitionsForContexts
(
$contexts
);
// $yo = $this->
$definitions
=
array_filter
(
$definitions
,
function
(
$definition
)
use
(
$prop_type_id
)
{
$definitions
=
array_filter
(
$definitions
,
function
(
$definition
)
use
(
$prop_type_id
)
{
return
in_array
(
$prop_type_id
,
$definition
[
'prop_types'
]);
return
in_array
(
$prop_type_id
,
$definition
[
'prop_types'
]);
});
});
return
$definitions
;
return
$definitions
;
}
}
/**
* ...
*/
protected
function
getConvertibleDefinitions
(
string
$prop_type_id
,
array
$contexts
=
[]):
array
{
$definitions
=
[];
$prop_type_definition
=
$this
->
prop_type_manager
->
getDefinition
(
$prop_type_id
);
if
(
!
isset
(
$prop_type_definition
[
'convert_from'
]))
{
return
[];
}
foreach
(
$prop_type_definition
[
'convert_from'
]
as
$convertible_prop_type_id
)
{
$definitions
[
$convertible_prop_type_id
])
=
$this
->
getDefinitionsForPropType
(
$convertible_prop_type_id
,
$contexts
);
}
return
$definitions
;
}
/**
/**
* Returns the default source identifier for a prop type.
* Returns the default source identifier for a prop type.
*/
*/
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment