Skip to content

Commit

Permalink
Merge pull request #130 from gsteel/factory-alias-for-laminas-translator
Browse files Browse the repository at this point in the history
Add service manager alias for `Laminas\Translator\TranslatorInterface`
  • Loading branch information
gsteel authored Jul 2, 2024
2 parents d6c05e1 + e1deac9 commit 419894b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
24 changes: 12 additions & 12 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

namespace Laminas\I18n;

use Laminas\ServiceManager\ConfigInterface;
use Laminas\ServiceManager\Factory\InvokableFactory;
use Laminas\ServiceManager\ServiceManager;
use Laminas\Translator\TranslatorInterface;

/**
* @see ConfigInterface
*
* @psalm-import-type ServiceManagerConfigurationType from ConfigInterface
* @psalm-import-type ServiceManagerConfiguration from ServiceManager
* @final
*/
class ConfigProvider
Expand All @@ -17,10 +16,10 @@ class ConfigProvider
* Return general-purpose laminas-i18n configuration.
*
* @return array{
* dependencies: ServiceManagerConfigurationType,
* filters: ServiceManagerConfigurationType,
* validators: ServiceManagerConfigurationType,
* view_helpers: ServiceManagerConfigurationType,
* dependencies: ServiceManagerConfiguration,
* filters: ServiceManagerConfiguration,
* validators: ServiceManagerConfiguration,
* view_helpers: ServiceManagerConfiguration,
* locale: string|null,
* }
*/
Expand All @@ -38,7 +37,7 @@ public function __invoke()
/**
* Return application-level dependency configuration.
*
* @return ServiceManagerConfigurationType
* @return ServiceManagerConfiguration
*/
public function getDependencyConfig()
{
Expand All @@ -50,6 +49,7 @@ public function getDependencyConfig()
'Zend\I18n\Translator\TranslatorInterface' => Translator\TranslatorInterface::class,
'Zend\I18n\Translator\LoaderPluginManager' => Translator\LoaderPluginManager::class,
Geography\CountryCodeListInterface::class => Geography\DefaultCountryCodeList::class,
TranslatorInterface::class => Translator\TranslatorInterface::class,
],
'factories' => [
Translator\TranslatorInterface::class => Translator\TranslatorServiceFactory::class,
Expand All @@ -62,7 +62,7 @@ public function getDependencyConfig()
/**
* Return laminas-filter configuration.
*
* @return ServiceManagerConfigurationType
* @return ServiceManagerConfiguration
*/
public function getFilterConfig()
{
Expand Down Expand Up @@ -97,7 +97,7 @@ public function getFilterConfig()
/**
* Return laminas-validator configuration.
*
* @return ServiceManagerConfigurationType
* @return ServiceManagerConfiguration
*/
public function getValidatorConfig()
{
Expand Down Expand Up @@ -153,7 +153,7 @@ public function getValidatorConfig()
*
* Obsoletes View\HelperConfig.
*
* @return ServiceManagerConfigurationType
* @return ServiceManagerConfiguration
*/
public function getViewHelperConfig()
{
Expand Down
14 changes: 6 additions & 8 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@
namespace Laminas\I18n;

use Laminas\ModuleManager\ModuleManager;
use Laminas\ServiceManager\ConfigInterface;
use Laminas\ServiceManager\ServiceManager;

/**
* @see ConfigInterface
*
* @psalm-import-type ServiceManagerConfigurationType from ConfigInterface
* @psalm-import-type ServiceManagerConfiguration from ServiceManager
*/
class Module
{
/**
* Return laminas-i18n configuration for laminas-mvc application.
*
* @return array{
* filters: ServiceManagerConfigurationType,
* service_manager: ServiceManagerConfigurationType,
* validators: ServiceManagerConfigurationType,
* view_helpers: ServiceManagerConfigurationType,
* filters: ServiceManagerConfiguration,
* service_manager: ServiceManagerConfiguration,
* validators: ServiceManagerConfiguration,
* view_helpers: ServiceManagerConfiguration,
* }
*/
public function getConfig()
Expand Down

0 comments on commit 419894b

Please sign in to comment.