Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Commit

Permalink
Move ImportMetaFilter to Import\Service\ #56
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaber-de committed Feb 18, 2016
1 parent 3b2a5bd commit 8c26c11
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion inc/Cli/WpCliW2MCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function import( Array $args, Array $assoc_args ) {
$postponed_meta_filter_list,
$postponed_meta_filter_resolver
);
$post_meta_filter_composite = new Import\Filter\ImportMetaFilter(
$post_meta_filter_composite = new Import\Service\ImportMetaFilter(
$meta_filter_list,
'post'
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php # -*- coding: utf-8 -*-

namespace W2M\Import\Filter;
namespace W2M\Import\Service;

use
W2M\Import\Data,
Expand All @@ -10,7 +10,7 @@
/**
* Class ImportMetaFilter
*
* Single instance to apply filters from a list to any meta value
* Single instance (composite) that applies filters from a list to any meta value
* of a specific object type.
*
* @package W2M\Import\Filter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php # -*- coding: utf-8 -*-

namespace W2M\Import\Filter;
namespace W2M\Import\Service;

use
W2M\Import\Type;
Expand Down
14 changes: 8 additions & 6 deletions inc/Import/Service/Importer/WpPostImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
use
W2M\Import\Data,
W2M\Import\Filter,
W2M\Import\Type,
W2M\Import\Module,
W2M\Import\Service,
W2M\Import\Type,
WP_Post,
WP_Error,
WP_Http;
WP_Http,
stdClass;

/**
* Class WpPostImporter
Expand All @@ -29,19 +31,19 @@ class WpPostImporter implements PostImporterInterface {
private $http;

/**
* @var Filter\ImportMetaFilterInterface $meta_filter
* @var Service\ImportMetaFilterInterface $meta_filter
*/
private $meta_filter;

/**
* @param Data\MultiTypeIdMapperInterface $id_mapper
* @param WP_Http $http (Optional)
* @param Filter\ImportMetaFilterInterface $meta_filter (Optional)
* @param Service\ImportMetaFilterInterface $meta_filter (Optional)
*/
public function __construct(
Data\MultiTypeIdMapperInterface $id_mapper,
WP_Http $http = NULL,
Filter\ImportMetaFilterInterface $meta_filter = NULL
Service\ImportMetaFilterInterface $meta_filter = NULL
) {

$this->id_mapper = $id_mapper;
Expand All @@ -51,7 +53,7 @@ public function __construct(

$this->meta_filter = $meta_filter
? $meta_filter
: new Filter\PassThroughImportMetaFilter;
: new Service\PassThroughImportMetaFilter;
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php # -*- coding: utf-8 -*-

namespace W2M\Import\Filter;
namespace W2M\Import\Service;

use
W2M\Import\Type;
Expand All @@ -9,6 +9,7 @@
* Class PassThroughImportMetaFilter
*
* Just a dummy filter which passes the given value through.
* Used to unify object creation and object setup with optional dependencies.
*
* @package W2M\Import\Filter
*/
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Use the installer via back-end of your install or ...
* `w2m_import_post_ancestor_resolving_start` in `W2M\Import\Module\ResolvingPendingRelations::resolving_posts()`
* `w2m_import_term_ancestor_resolving_start` in `W2M\Import\Module\ResolvingPendingRelations::resolving_terms()`

* `w2m_import_meta_not_filterable` in `W2M\Import\Filter\ImportMetaFilter::filter_value()`
* `w2m_import_meta_not_filterable` in `W2M\Import\Service\ImportMetaFilter::filter_value()`
* `w2m_import_meta_filter` in `W2M\Controller\MetaFilterApi::register_filter()`


Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php # -*- coding: utf-8 -*-

namespace W2M\Test\Unit\Import\Filter;
namespace W2M\Test\Unit\Import\Service;

use
W2M\Import\Filter,
W2M\Import\Service,
W2M\Test\Helper;

class ImportMetaFilterTest extends Helper\MonkeyTestCase {
Expand Down

0 comments on commit 8c26c11

Please sign in to comment.