Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
file_mdm-3397429
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
file_mdm-3397429
Commits
5bde1104
Commit
5bde1104
authored
2 years ago
by
Dieter Holvoet
Committed by
mondrake
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3331098
by DieterHolvoet: Fix subclassing and stop overriding constructors
parent
f635ed48
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
file_mdm_exif/src/Plugin/FileMetadata/Exif.php
+5
-41
5 additions, 41 deletions
file_mdm_exif/src/Plugin/FileMetadata/Exif.php
src/Plugin/FileMetadata/FileMetadataPluginBase.php
+1
-1
1 addition, 1 deletion
src/Plugin/FileMetadata/FileMetadataPluginBase.php
with
6 additions
and
42 deletions
file_mdm_exif/src/Plugin/FileMetadata/Exif.php
+
5
−
41
View file @
5bde1104
...
...
@@ -2,13 +2,8 @@
namespace
Drupal\file_mdm_exif\Plugin\FileMetadata
;
use
Drupal\Core\Cache\CacheBackendInterface
;
use
Drupal\Core\Config\ConfigFactoryInterface
;
use
Drupal\Core\StreamWrapper\StreamWrapperManagerInterface
;
use
Drupal\file_mdm
\Plugin\FileMetadata\FileMetadataPluginBase
;
use
Drupal\file_mdm_exif
\ExifTagMapperInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\Mime\MimeTypeGuesserInterface
;
use
lsolesen\pel\PelEntry
;
use
lsolesen\pel\PelExif
;
use
lsolesen\pel\PelIfd
;
...
...
@@ -47,46 +42,15 @@ class Exif extends FileMetadataPluginBase {
*/
protected
$pelFile
;
/**
* Constructs an Exif file metadata plugin.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param array $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Cache\CacheBackendInterface $cache_service
* The cache service.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
* @param \Symfony\Component\Mime\MimeTypeGuesserInterface $mime_type_guesser
* The MIME type mapping service.
* @param \Drupal\file_mdm_exif\ExifTagMapperInterface $tag_mapper
* The EXIF tag mapping service.
* @param \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager
* The stream wrapper manager service.
*/
public
function
__construct
(
array
$configuration
,
$plugin_id
,
array
$plugin_definition
,
CacheBackendInterface
$cache_service
,
ConfigFactoryInterface
$config_factory
,
MimeTypeGuesserInterface
$mime_type_guesser
,
ExifTagMapperInterface
$tag_mapper
,
StreamWrapperManagerInterface
$stream_wrapper_manager
)
{
parent
::
__construct
(
$configuration
,
$plugin_id
,
$plugin_definition
,
$cache_service
,
$config_factory
,
$stream_wrapper_manager
);
$this
->
mimeTypeGuesser
=
$mime_type_guesser
;
$this
->
tagMapper
=
$tag_mapper
;
}
/**
* {@inheritdoc}
*/
public
static
function
create
(
ContainerInterface
$container
,
array
$configuration
,
$plugin_id
,
$plugin_definition
)
{
return
new
static
(
$configuration
,
$plugin_id
,
$plugin_definition
,
$container
->
get
(
'cache.file_mdm'
),
$container
->
get
(
'config.factory'
),
$container
->
get
(
'file.mime_type.guesser'
),
$container
->
get
(
'file_mdm_exif.tag_mapper'
),
$container
->
get
(
'stream_wrapper_manager'
)
);
$instance
=
parent
::
create
(
$container
,
$configuration
,
$plugin_id
,
$plugin_definition
);
$instance
->
mimeTypeGuesser
=
$container
->
get
(
'file.mime_type.guesser'
);
$instance
->
tagMapper
=
$container
->
get
(
'file_mdm_exif.tag_mapper'
);
return
$instance
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/Plugin/FileMetadata/FileMetadataPluginBase.php
+
1
−
1
View file @
5bde1104
...
...
@@ -108,7 +108,7 @@ abstract class FileMetadataPluginBase extends PluginBase implements FileMetadata
* @param \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager
* The stream wrapper manager service.
*/
public
function
__construct
(
array
$configuration
,
$plugin_id
,
array
$plugin_definition
,
CacheBackendInterface
$cache_service
,
ConfigFactoryInterface
$config_factory
,
StreamWrapperManagerInterface
$stream_wrapper_manager
)
{
public
final
function
__construct
(
array
$configuration
,
$plugin_id
,
array
$plugin_definition
,
CacheBackendInterface
$cache_service
,
ConfigFactoryInterface
$config_factory
,
StreamWrapperManagerInterface
$stream_wrapper_manager
)
{
parent
::
__construct
(
$configuration
,
$plugin_id
,
$plugin_definition
);
$this
->
cache
=
$cache_service
;
$this
->
configFactory
=
$config_factory
;
...
...
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
register
or
sign in
to comment