This repository has been archived by the owner on May 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #365 from localheinz/fix/plugin-vs-service
Fix: Move plugin functionality into appropriate service
- Loading branch information
Showing
9 changed files
with
419 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace User\Controller; | ||
|
||
use Zend\Mvc\Controller\ControllerManager; | ||
use Zend\ServiceManager\FactoryInterface; | ||
use Zend\ServiceManager\ServiceLocatorInterface; | ||
use ZfModule\Service; | ||
|
||
class UserControllerFactory implements FactoryInterface | ||
{ | ||
/** | ||
* @param ServiceLocatorInterface $controllerManager | ||
* @return UserController | ||
*/ | ||
public function createService(ServiceLocatorInterface $controllerManager) | ||
{ | ||
/* @var ControllerManager $controllerManager */ | ||
$serviceManager = $controllerManager->getServiceLocator(); | ||
|
||
/* @var Service\Module $moduleService */ | ||
$moduleService = $serviceManager->get('zfmodule_service_module'); | ||
|
||
return new UserController($moduleService); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 0 additions & 66 deletions
66
module/ZfModule/src/ZfModule/Mvc/Controller/Plugin/ListModule.php
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
module/ZfModule/src/ZfModule/Mvc/Controller/Plugin/ListModuleFactory.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
module/ZfModule/test/ZfModuleTest/Mock/Collection/RepositoryCollection.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace ZfModuleTest\Mock\Collection; | ||
|
||
use Iterator; | ||
|
||
class RepositoryCollection implements Iterator | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
private $repositories; | ||
|
||
public function __construct(array $repositories = []) | ||
{ | ||
$this->repositories = $repositories; | ||
} | ||
|
||
public function current() | ||
{ | ||
return current($this->repositories); | ||
} | ||
|
||
public function next() | ||
{ | ||
next($this->repositories); | ||
} | ||
|
||
public function key() | ||
{ | ||
return key($this->repositories); | ||
} | ||
|
||
public function valid() | ||
{ | ||
$key = key($this->repositories); | ||
|
||
if (null === $key || false === $key) { | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
public function rewind() | ||
{ | ||
reset($this->repositories); | ||
} | ||
} |
Oops, something went wrong.