Skip to content

Commit

Permalink
support zf2 too
Browse files Browse the repository at this point in the history
  • Loading branch information
kokspflanze committed Jul 19, 2016
1 parent 65651b5 commit 9ce1566
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/ZfcBBCode/Service/ParserInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ interface ParserInterface
/**
* get parsed text
*
* @param $text
* @param string $text
* @return string
*/
public function getParsedText($text);

/**
* check if the text is correct
*
* @param $text
* @param string $text
* @return bool
*/
public function isTextValid($text);
Expand Down
4 changes: 2 additions & 2 deletions src/ZfcBBCode/Service/SBBCodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(array $configData)

/**
* get parsed text
* @param $text
* @param string $text
*
* @return string
*/
Expand All @@ -45,7 +45,7 @@ public function getParsedText($text)

/**
* check if the text is correct
* @param $text
* @param string $text
*
* @return bool
*/
Expand Down
13 changes: 12 additions & 1 deletion src/ZfcBBCode/Service/SBBCodeParserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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);
}


}
2 changes: 1 addition & 1 deletion src/ZfcBBCode/View/Helper/BBCodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(ParserInterface $bbCodeParser)
}

/**
* @param $string
* @param string $string
*
* @return string
*/
Expand Down
13 changes: 12 additions & 1 deletion src/ZfcBBCode/View/Helper/BBCodeParserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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);
}


}

0 comments on commit 9ce1566

Please sign in to comment.