Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
feeds_ex
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
feeds_ex
Merge requests
!29
Fix issues identified by PHPStan scan
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix issues identified by PHPStan scan
issue/feeds_ex-3441604:phpstan
into
8.x-1.x
Overview
0
Commits
12
Pipelines
13
Changes
11
Merged
Patrick Kenny
requested to merge
issue/feeds_ex-3441604:phpstan
into
8.x-1.x
1 year ago
Overview
0
Commits
12
Pipelines
13
Changes
11
Expand
0
0
Merge request reports
Compare
8.x-1.x
version 13
01dc9e84
1 year ago
version 12
3de6f7bf
1 year ago
version 11
5a80a015
1 year ago
version 10
04c6adc6
1 year ago
version 9
22ab8f8f
1 year ago
version 8
e8b1fba4
1 year ago
version 7
4d9dc69f
1 year ago
version 6
7965eded
1 year ago
version 5
0c7f8e37
1 year ago
version 4
a235adf5
1 year ago
version 3
5e5eb614
1 year ago
version 2
3b7fb870
1 year ago
version 1
9307da72
1 year ago
8.x-1.x (base)
and
latest version
latest version
01dc9e84
12 commits,
1 year ago
version 13
01dc9e84
12 commits,
1 year ago
version 12
3de6f7bf
11 commits,
1 year ago
version 11
5a80a015
10 commits,
1 year ago
version 10
04c6adc6
9 commits,
1 year ago
version 9
22ab8f8f
13 commits,
1 year ago
version 8
e8b1fba4
12 commits,
1 year ago
version 7
4d9dc69f
11 commits,
1 year ago
version 6
7965eded
10 commits,
1 year ago
version 5
0c7f8e37
9 commits,
1 year ago
version 4
a235adf5
8 commits,
1 year ago
version 3
5e5eb614
7 commits,
1 year ago
version 2
3b7fb870
3 commits,
1 year ago
version 1
9307da72
2 commits,
1 year ago
11 files
+
94
−
36
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
11
Search (e.g. *.vue) (Ctrl+P)
src/Feeds/Parser/JmesPathParser.php
+
27
−
7
Options
@@ -7,10 +7,10 @@ use Drupal\feeds\FeedInterface;
use
Drupal\feeds\Result\FetcherResultInterface
;
use
Drupal\feeds\Result\ParserResultInterface
;
use
Drupal\feeds\StateInterface
;
use
Drupal\feeds_ex
\JmesRuntimeFactory
;
use
Drupal\feeds_ex
\JmesRuntimeFactoryInterface
;
use
Drupal\feeds_ex
\Utility\JsonUtility
;
use
JmesPath\SyntaxErrorException
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
* Defines a JSON parser using JMESPath.
@@ -43,20 +43,40 @@ class JmesPathParser extends JsonParserBase {
protected
$runtimeFactory
;
/**
* {@inheritdoc}
* Constructs a JmesPathParser object.
*
* @param array $configuration
* The plugin configuration.
* @param string $plugin_id
* The plugin id.
* @param array $plugin_definition
* The plugin definition.
* @param \Drupal\feeds_ex\Utility\JsonUtility $utility
* The JSON helper class.
* @param \Drupal\feeds_ex\JmesRuntimeFactoryInterface $factory
* A factory to generate JMESPath runtime objects.
*/
public
function
__construct
(
array
$configuration
,
$plugin_id
,
array
$plugin_definition
,
JsonUtility
$utility
)
{
public
function
__construct
(
array
$configuration
,
$plugin_id
,
array
$plugin_definition
,
JsonUtility
$utility
,
JmesRuntimeFactoryInterface
$factory
)
{
parent
::
__construct
(
$configuration
,
$plugin_id
,
$plugin_definition
,
$utility
);
$this
->
setRuntimeFactory
(
$factory
);
}
// Set default factory.
$this
->
runtimeFactory
=
new
JmesRuntimeFactory
();
/**
* {@inheritdoc}
*/
public
static
function
create
(
ContainerInterface
$container
,
array
$configuration
,
$plugin_id
,
$plugin_definition
)
{
return
new
static
(
$configuration
,
$plugin_id
,
$plugin_definition
,
$container
->
get
(
'feeds_ex.json_utility'
),
$container
->
get
(
'feeds_ex.jmes_runtime_factory'
)
);
}
/**
* Sets the factory to use for creating JMESPath Runtime objects.
*
* This is useful in unit tests.
*
* @param \Drupal\feeds_ex\JmesRuntimeFactoryInterface $factory
* The factory to use.
*/
Loading