Skip to content

Commit

Permalink
Rename LocationProvider to LocationResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
pspanja committed Dec 23, 2019
1 parent 25dc798 commit fc972d8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions bundle/Resources/config/services/view.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
services:
netgen.ezplatform_site.view.location_provider.sudo_main_location_provider:
class: Netgen\Bundle\EzPlatformSiteApiBundle\View\LocationProvider\SudoMainLocationProvider
netgen.ezplatform_site.view.location_resolver.sudo_main_location_resolver:
class: Netgen\Bundle\EzPlatformSiteApiBundle\View\LocationResolver\SudoMainLocationResolver
arguments:
- '@ezpublish.api.repository'
- '@netgen.ezplatform_site.load_service'

netgen.ezplatform_site.view.location_provider:
alias: netgen.ezplatform_site.view.location_provider.sudo_main_location_provider
netgen.ezplatform_site.view.location_resolver:
alias: netgen.ezplatform_site.view.location_resolver.sudo_main_location_resolver

netgen.ezplatform_site.view_builder.content:
class: Netgen\Bundle\EzPlatformSiteApiBundle\View\Builder\ContentViewBuilder
Expand All @@ -16,7 +16,7 @@ services:
- '@ezpublish.api.repository'
- '@ezpublish.view.configurator'
- '@ezpublish.view.view_parameters.injector.dispatcher'
- '@netgen.ezplatform_site.view.location_provider'
- '@netgen.ezplatform_site.view.location_resolver'

# deprecated since 3.3, used aliased service
netgen.ezplatform_site.ngcontent_view_provider.configured:
Expand Down
12 changes: 6 additions & 6 deletions bundle/View/Builder/ContentViewBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use eZ\Publish\Core\MVC\Symfony\View\EmbedView;
use eZ\Publish\Core\MVC\Symfony\View\ParametersInjector;
use Netgen\Bundle\EzPlatformSiteApiBundle\View\ContentView;
use Netgen\Bundle\EzPlatformSiteApiBundle\View\LocationProvider;
use Netgen\Bundle\EzPlatformSiteApiBundle\View\LocationResolver;
use Netgen\EzPlatformSiteApi\API\Site;
use Netgen\EzPlatformSiteApi\API\Values\Content;
use Netgen\EzPlatformSiteApi\API\Values\Location;
Expand Down Expand Up @@ -49,22 +49,22 @@ class ContentViewBuilder implements ViewBuilder
private $viewParametersInjector;

/**
* @var \Netgen\Bundle\EzPlatformSiteApiBundle\View\LocationProvider
* @var \Netgen\Bundle\EzPlatformSiteApiBundle\View\LocationResolver
*/
private $locationProvider;
private $locationResolver;

public function __construct(
Site $site,
Repository $repository,
Configurator $viewConfigurator,
ParametersInjector $viewParametersInjector,
LocationProvider $locationProvider
LocationResolver $locationResolver
) {
$this->site = $site;
$this->repository = $repository;
$this->viewConfigurator = $viewConfigurator;
$this->viewParametersInjector = $viewParametersInjector;
$this->locationProvider = $locationProvider;
$this->locationResolver = $locationResolver;
}

public function matches($argument): bool
Expand Down Expand Up @@ -128,7 +128,7 @@ public function buildView(array $parameters): ContentView

if ($location === null) {
try {
$location = $this->locationProvider->getLocation($content);
$location = $this->locationResolver->getLocation($content);
} catch (NotFoundException $e) {
// do nothing
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Provides Location for the Content View when it's not explicitly given.
*/
abstract class LocationProvider
abstract class LocationResolver
{
/**
* @param \Netgen\EzPlatformSiteApi\API\Values\Content $content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

declare(strict_types=1);

namespace Netgen\Bundle\EzPlatformSiteApiBundle\View\LocationProvider;
namespace Netgen\Bundle\EzPlatformSiteApiBundle\View\LocationResolver;

use eZ\Publish\API\Repository\Repository;
use eZ\Publish\Core\Helper\ContentInfoLocationLoader;
use Netgen\Bundle\EzPlatformSiteApiBundle\View\LocationProvider;
use Netgen\Bundle\EzPlatformSiteApiBundle\View\LocationResolver;
use Netgen\EzPlatformSiteApi\API\LoadService;
use Netgen\EzPlatformSiteApi\API\Values\Content;
use Netgen\EzPlatformSiteApi\API\Values\Location;

class CoreAdapterProvider extends LocationProvider
class CoreAdapterResolver extends LocationResolver
{
/**
* @var \eZ\Publish\API\Repository\Repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

declare(strict_types=1);

namespace Netgen\Bundle\EzPlatformSiteApiBundle\View\LocationProvider;
namespace Netgen\Bundle\EzPlatformSiteApiBundle\View\LocationResolver;

use Exception;
use eZ\Publish\API\Repository\Repository;
use eZ\Publish\Core\Base\Exceptions\NotFoundException;
use Netgen\Bundle\EzPlatformSiteApiBundle\View\LocationProvider;
use Netgen\Bundle\EzPlatformSiteApiBundle\View\LocationResolver;
use Netgen\EzPlatformSiteApi\API\LoadService;
use Netgen\EzPlatformSiteApi\API\Values\Content;
use Netgen\EzPlatformSiteApi\API\Values\Location;

class SudoMainLocationProvider extends LocationProvider
class SudoMainLocationResolver extends LocationResolver
{
/**
* @var \eZ\Publish\API\Repository\Repository
Expand Down

0 comments on commit fc972d8

Please sign in to comment.