diff --git a/.travis.yml b/.travis.yml index 9cdafc3..9380298 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,18 @@ +sudo: false + language: php php: + - 5.5 - 5.6 - 7 + - nightly - hhvm +allow_failures: + - php: nightly + - php: hhvm + matrix: fast_finish: true diff --git a/composer.json b/composer.json index bbb4af1..dce2184 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ ], "require": { "php": ">=5.6", - "zendframework/zend-servicemanager": "~3.0", + "zendframework/zend-servicemanager": "~2.7|~3.0", "zendframework/zend-validator": "~2.8", "zendframework/zend-view": "~2.7", "kokspflanze/sbb-code-parser": "~0.1" diff --git a/src/ZfcBBCode/Service/ParserInterface.php b/src/ZfcBBCode/Service/ParserInterface.php index 163263c..0e6acdb 100644 --- a/src/ZfcBBCode/Service/ParserInterface.php +++ b/src/ZfcBBCode/Service/ParserInterface.php @@ -9,7 +9,7 @@ interface ParserInterface /** * get parsed text * - * @param $text + * @param string $text * @return string */ public function getParsedText($text); @@ -17,7 +17,7 @@ public function getParsedText($text); /** * check if the text is correct * - * @param $text + * @param string $text * @return bool */ public function isTextValid($text); diff --git a/src/ZfcBBCode/Service/SBBCodeParser.php b/src/ZfcBBCode/Service/SBBCodeParser.php index 7524608..ebe3fe8 100644 --- a/src/ZfcBBCode/Service/SBBCodeParser.php +++ b/src/ZfcBBCode/Service/SBBCodeParser.php @@ -20,7 +20,7 @@ public function __construct(array $configData) /** * get parsed text - * @param $text + * @param string $text * * @return string */ @@ -45,7 +45,7 @@ public function getParsedText($text) /** * check if the text is correct - * @param $text + * @param string $text * * @return bool */ diff --git a/src/ZfcBBCode/Service/SBBCodeParserFactory.php b/src/ZfcBBCode/Service/SBBCodeParserFactory.php index 7041e32..988e8a0 100644 --- a/src/ZfcBBCode/Service/SBBCodeParserFactory.php +++ b/src/ZfcBBCode/Service/SBBCodeParserFactory.php @@ -5,7 +5,8 @@ use Interop\Container\ContainerInterface; -use Zend\ServiceManager\Factory\FactoryInterface; +use Zend\ServiceManager\FactoryInterface; +use Zend\ServiceManager\ServiceLocatorInterface; class SBBCodeParserFactory implements FactoryInterface { @@ -20,4 +21,14 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o return new SBBCodeParser($container->get('Configuration')['zfc-bbcode']); } + /** + * @param ServiceLocatorInterface $serviceLocator + * @return SBBCodeParser + */ + public function createService(ServiceLocatorInterface $serviceLocator) + { + return $this($serviceLocator, SBBCodeParser::class); + } + + } \ No newline at end of file diff --git a/src/ZfcBBCode/View/Helper/BBCodeParser.php b/src/ZfcBBCode/View/Helper/BBCodeParser.php index b05b825..1918b71 100644 --- a/src/ZfcBBCode/View/Helper/BBCodeParser.php +++ b/src/ZfcBBCode/View/Helper/BBCodeParser.php @@ -20,7 +20,7 @@ public function __construct(ParserInterface $bbCodeParser) } /** - * @param $string + * @param string $string * * @return string */ diff --git a/src/ZfcBBCode/View/Helper/BBCodeParserFactory.php b/src/ZfcBBCode/View/Helper/BBCodeParserFactory.php index b1de4b9..ae05b65 100644 --- a/src/ZfcBBCode/View/Helper/BBCodeParserFactory.php +++ b/src/ZfcBBCode/View/Helper/BBCodeParserFactory.php @@ -5,7 +5,8 @@ use Interop\Container\ContainerInterface; -use Zend\ServiceManager\Factory\FactoryInterface; +use Zend\ServiceManager\FactoryInterface; +use Zend\ServiceManager\ServiceLocatorInterface; class BBCodeParserFactory implements FactoryInterface { @@ -20,4 +21,14 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o return new BBCodeParser($container->get('zfc-bbcode_parser')); } + /** + * @param ServiceLocatorInterface $serviceLocator + * @return BBCodeParser + */ + public function createService(ServiceLocatorInterface $serviceLocator) + { + return $this($serviceLocator, BBCodeParser::class); + } + + } \ No newline at end of file