Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed doc blocks and license

  • Loading branch information...
commit ada4bda5823ffe1df8228e9dddefa38d6420f983 1 parent 01364a7
@everzet everzet authored
Showing with 581 additions and 437 deletions.
  1. +2 −2 LICENSE
  2. +6 −6 src/Behat/Gherkin/Cache/CacheInterface.php
  3. +20 −9 src/Behat/Gherkin/Cache/FileCache.php
  4. +51 −44 src/Behat/Gherkin/Dumper/GherkinDumper.php
  5. +7 −3 src/Behat/Gherkin/Filter/FilterInterface.php
  6. +12 −4 src/Behat/Gherkin/Filter/LineFilter.php
  7. +13 −5 src/Behat/Gherkin/Filter/LineRangeFilter.php
  8. +12 −4 src/Behat/Gherkin/Filter/NameFilter.php
  9. +13 −5 src/Behat/Gherkin/Filter/TagFilter.php
  10. +9 −9 src/Behat/Gherkin/Gherkin.php
  11. +38 −14 src/Behat/Gherkin/Keywords/ArrayKeywords.php
  12. +2 −2 src/Behat/Gherkin/Keywords/CachedArrayKeywords.php
  13. +19 −9 src/Behat/Gherkin/Keywords/CucumberKeywords.php
  14. +25 −25 src/Behat/Gherkin/Keywords/KeywordsDumper.php
  15. +18 −18 src/Behat/Gherkin/Keywords/KeywordsInterface.php
  16. +38 −14 src/Behat/Gherkin/Keywords/SymfonyTranslationKeywords.php
  17. +37 −40 src/Behat/Gherkin/Lexer.php
  18. +8 −6 src/Behat/Gherkin/Loader/AbstractFileLoader.php
  19. +29 −21 src/Behat/Gherkin/Loader/ArrayLoader.php
  20. +12 −4 src/Behat/Gherkin/Loader/DirectoryLoader.php
  21. +2 −2 src/Behat/Gherkin/Loader/FileLoaderInterface.php
  22. +16 −8 src/Behat/Gherkin/Loader/GherkinFileLoader.php
  23. +4 −4 src/Behat/Gherkin/Loader/LoaderInterface.php
  24. +18 −8 src/Behat/Gherkin/Loader/YamlFileLoader.php
  25. +8 −8 src/Behat/Gherkin/Node/AbstractNode.php
  26. +15 −15 src/Behat/Gherkin/Node/AbstractScenarioNode.php
  27. +1 −1  src/Behat/Gherkin/Node/BackgroundNode.php
  28. +3 −2 src/Behat/Gherkin/Node/ExamplePyStringNode.php
  29. +4 −4 src/Behat/Gherkin/Node/ExampleStepNode.php
  30. +2 −2 src/Behat/Gherkin/Node/ExampleTableNode.php
  31. +30 −31 src/Behat/Gherkin/Node/FeatureNode.php
  32. +3 −3 src/Behat/Gherkin/Node/NodeVisitorInterface.php
  33. +4 −4 src/Behat/Gherkin/Node/OutlineNode.php
  34. +7 −7 src/Behat/Gherkin/Node/PyStringNode.php
  35. +8 −8 src/Behat/Gherkin/Node/ScenarioNode.php
  36. +1 −1  src/Behat/Gherkin/Node/StepArgumentNodeInterface.php
  37. +21 −20 src/Behat/Gherkin/Node/StepNode.php
  38. +36 −36 src/Behat/Gherkin/Node/TableNode.php
  39. +27 −29 src/Behat/Gherkin/Parser.php
View
4 LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2011 Konstantin Kudryashov <ever.zet@gmail.com>
+Copyright (c) 2012 Konstantin Kudryashov <ever.zet@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -19,4 +19,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
+OTHER DEALINGS IN THE SOFTWARE.
View
12 src/Behat/Gherkin/Cache/CacheInterface.php
@@ -22,8 +22,8 @@
/**
* Checks that cache for feature exists and is fresh.
*
- * @param string $path feature path
- * @param integer $timestamp the last time feature was updated
+ * @param string $path Feature path
+ * @param integer $timestamp The last time feature was updated
*
* @return Boolean
*/
@@ -32,17 +32,17 @@ function isFresh($path, $timestamp);
/**
* Reads feature cache from path.
*
- * @param string $path feature path
+ * @param string $path Feature path
*
- * @return FeatureNode
+ * @return FeatureNode
*/
function read($path);
/**
* Caches feature node.
*
- * @param string $path feature path
- * @param FeatureNode $feature feature instance
+ * @param string $path Feature path
+ * @param FeatureNode $feature Feature instance
*/
function write($path, FeatureNode $feature);
}
View
29 src/Behat/Gherkin/Cache/FileCache.php
@@ -4,8 +4,19 @@
use Behat\Gherkin\Node\FeatureNode;
+/*
+* This file is part of the Behat Gherkin.
+* (c) 2011 Konstantin Kudryashov <ever.zet@gmail.com>
+*
+* For the full copyright and license information, please view the LICENSE
+* file that was distributed with this source code.
+*/
+
/**
- * Features filecache.
+ * File cache.
+ * Caches feature into a file.
+ *
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class FileCache implements CacheInterface
{
@@ -14,7 +25,7 @@ class FileCache implements CacheInterface
/**
* Initializes file cache.
*
- * @param string $path path to the folder where to store caches.
+ * @param string $path Path to the folder where to store caches.
*/
public function __construct($path)
{
@@ -28,8 +39,8 @@ public function __construct($path)
/**
* Checks that cache for feature exists and is fresh.
*
- * @param string $path feature path
- * @param integer $timestamp the last time feature was updated
+ * @param string $path Feature path
+ * @param integer $timestamp The last time feature was updated
*
* @return Boolean
*/
@@ -47,9 +58,9 @@ public function isFresh($path, $timestamp)
/**
* Reads feature cache from path.
*
- * @param string $path feature path
+ * @param string $path Feature path
*
- * @return FeatureNode
+ * @return FeatureNode
*/
public function read($path)
{
@@ -59,8 +70,8 @@ public function read($path)
/**
* Caches feature node.
*
- * @param string $path feature path
- * @param FeatureNode $feature feature instance
+ * @param string $path Feature path
+ * @param FeatureNode $feature Feature instance
*/
public function write($path, FeatureNode $feature)
{
@@ -70,7 +81,7 @@ public function write($path, FeatureNode $feature)
/**
* Returns feature cache file path from features path.
*
- * @param string $path feature path
+ * @param string $path Feature path
*
* @return string
*/
View
95 src/Behat/Gherkin/Dumper/GherkinDumper.php
@@ -22,7 +22,7 @@
/**
* Gherkin Dumper.
*
- * @author Jean-François Lépine <dev@lepine.pro>
+ * @author Jean-François Lépine <dev@lepine.pro>
*/
class GherkinDumper
{
@@ -30,10 +30,10 @@ class GherkinDumper
private $indent;
/**
- * Constructor
+ * Constructs dumper.
*
- * @param \Behat\Gherkin\Keywords\KeywordsInterface $keywords
- * @param string $indent
+ * @param KeywordsInterface $keywords Keywords container
+ * @param string $indent Indentation
*/
public function __construct(KeywordsInterface $keywords, $indent = ' ')
{
@@ -42,10 +42,12 @@ public function __construct(KeywordsInterface $keywords, $indent = ' ')
}
/**
- * Dump a feature
+ * Dumps a feature.
+ *
+ * @see dumpFeature()
+ *
+ * @param FeatureNode $feature Feature instance
*
- * @see Behat\Gherkin\dumpFeature()
- * @param Behat\Gherkin\Node\FeatureNode
* @return string
*/
public function dump(FeatureNode $feature)
@@ -54,9 +56,10 @@ public function dump(FeatureNode $feature)
}
/**
- * Dump background
+ * Dumps a background.
+ *
+ * @param BackgroundNode $background Background instance
*
- * @param Behat\Gherkin\Node\BackgroundNode
* @return string
*/
public function dumpBackground(BackgroundNode $background)
@@ -75,9 +78,10 @@ public function dumpBackground(BackgroundNode $background)
}
/**
- * Dump comment
+ * Dumps comment.
+ *
+ * @param string $comment Comment string
*
- * @param string $comment
* @return string
*/
public function dumpComment($comment)
@@ -86,9 +90,10 @@ public function dumpComment($comment)
}
/**
- * Dump feature
+ * Dumps feature.
+ *
+ * @param FeatureNode $feature Feature instance
*
- * @param \Behat\Gherkin\Node\FeatureNode $feature
* @return string
*/
public function dumpFeature(FeatureNode $feature)
@@ -96,19 +101,16 @@ public function dumpFeature(FeatureNode $feature)
$language = $feature->getLanguage();
$this->keywords->setLanguage($language);
- // Feature's infos
$content = ''
. $this->dumpLanguage($language)
. ($feature->getTags() ? PHP_EOL . $this->dumpTags($feature->getTags(), 0) : '')
. PHP_EOL . $this->dumpKeyword($this->keywords->getFeatureKeywords(), $feature->getTitle(), 0)
. PHP_EOL . $this->dumpText($feature->getDescription(), 1);
- // Background
if ($feature->getBackground()) {
$content .= $this->dumpBackground($feature->getBackground());
}
- // scenarios
$scenarios = $feature->getScenarios();
foreach ($scenarios as $scenario) {
$content .= PHP_EOL . $this->dumpScenario($scenario);
@@ -117,11 +119,12 @@ public function dumpFeature(FeatureNode $feature)
}
/**
- * Dump keyword
+ * Dumps keyword.
+ *
+ * @param string $keyword Keyword string
+ * @param string $text Text
+ * @param integer $indent Indentation
*
- * @param string $keyword
- * @param string $text
- * @param integer $indent
* @return string
*/
public function dumpKeyword($keyword, $text, $indent = 0)
@@ -135,29 +138,27 @@ public function dumpKeyword($keyword, $text, $indent = 0)
}
/**
- * Dump scenario
+ * Dumps scenario.
+ *
+ * @param ScenarioNode $scenario Scenario instance
*
- * @param \Behat\Gherkin\Node\ScenarioNode $scenario
* @return string
*/
public function dumpScenario(ScenarioNode $scenario)
{
$keyWordToUse = $scenario instanceof OutlineNode ? $this->keywords->getOutlineKeywords() : $this->keywords->getScenarioKeywords();
- // Main content
$content = ''
. (sizeof($scenario->getTags()) > 0 ? PHP_EOL . $this->dumpTags($scenario->getTags(), 1) : '')
. PHP_EOL . $this->dumpKeyword($keyWordToUse, $scenario->getTitle(), 1)
;
- // Steps
foreach ($scenario->getSteps() as $step) {
$content .=
PHP_EOL . $this->dumpIndent(2)
. $this->dumpStep($step);
}
- // Examples
if ($scenario instanceof OutlineNode) {
$content .= ''
. PHP_EOL . PHP_EOL . $this->dumpKeyword($this->keywords->getExamplesKeywords(), '', 1)
@@ -169,10 +170,10 @@ public function dumpScenario(ScenarioNode $scenario)
}
/**
- * Dump table node
+ * Dumps table node.
*
- * @param \Behat\Gherkin\Node\TableNode $tableNode
- * @param integer $indent
+ * @param TableNode $tableNode Table node
+ * @param integer $indent Indentation
* @return string
*/
public function dumpTableNode(TableNode $tableNode, $indent = 0)
@@ -187,9 +188,10 @@ public function dumpTableNode(TableNode $tableNode, $indent = 0)
}
/**
- * Dump indent
+ * Dumps indentation.
+ *
+ * @param integer $indent Indentation
*
- * @param integer $indent
* @return string
*/
public function dumpIndent($indent)
@@ -198,11 +200,13 @@ public function dumpIndent($indent)
}
/**
- * Dump step
+ * Dumps a step.
+ *
+ * @param StepNode $step Step node instance
*
- * @param \Behat\Gherkin\Node\StepNode $step
* @return string
- * @throws \Behat\Gherkin\Exception\Exception
+ *
+ * @throws Exception if invalid step type providen
*/
public function dumpStep(StepNode $step)
{
@@ -230,10 +234,11 @@ public function dumpStep(StepNode $step)
}
/**
- * Dump text
+ * Dumps text.
+ *
+ * @param string $text Text to dump
+ * @param integer $indent Indentation
*
- * @param string $text
- * @param integer $indent
* @return string
*/
public function dumpText($text, $indent = 0)
@@ -245,24 +250,26 @@ public function dumpText($text, $indent = 0)
}
/**
- * Dump tags
+ * Dumps tags.
+ *
+ * @param array $tags Array of tags
+ * @param integer $indent Indentation
*
- * @param array $tags
- * @param integer $indent
* @return string
*/
- public function dumpTags(array $array, $indent = 0)
+ public function dumpTags(array $tags, $indent = 0)
{
- if (empty($array)) {
+ if (empty($tags)) {
return '';
}
- return $this->dumpIndent($indent) . '@' . ltrim(implode(' @', $array));
+ return $this->dumpIndent($indent) . '@' . ltrim(implode(' @', $tags));
}
/**
- * Dump language tag
+ * Dumps language tag.
+ *
+ * @param string $language Language name
*
- * @param string $language
* @return string
*/
public function dumpLanguage($language)
View
10 src/Behat/Gherkin/Filter/FilterInterface.php
@@ -16,21 +16,25 @@
/**
* Filter interface.
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
interface FilterInterface
{
/**
* Checks if Feature matches specified filter.
*
- * @param Behat\Gherkin\Node\FeatureNode $feature
+ * @param FeatureNode $feature Feature instance
+ *
+ * @return Boolean
*/
function isFeatureMatch(FeatureNode $feature);
/**
* Checks if scenario or outline matches specified filter.
*
- * @param Behat\Gherkin\Node\ScenarioNode|Behat\Gherkin\Node\OutlineNode $scenario
+ * @param ScenarioNode $scenario Scenario or Outline node instance
+ *
+ * @return Boolean
*/
function isScenarioMatch(ScenarioNode $scenario);
}
View
16 src/Behat/Gherkin/Filter/LineFilter.php
@@ -16,7 +16,7 @@
/**
* Filters scenarios by definition line number.
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class LineFilter implements FilterInterface
{
@@ -25,7 +25,7 @@ class LineFilter implements FilterInterface
/**
* Initializes filter.
*
- * @param string $filterLine line of the scenario to filter on
+ * @param string $filterLine Line of the scenario to filter on
*/
public function __construct($filterLine)
{
@@ -33,7 +33,11 @@ public function __construct($filterLine)
}
/**
- * {@inheritdoc}
+ * Checks if Feature matches specified filter.
+ *
+ * @param FeatureNode $feature Feature instance
+ *
+ * @return Boolean
*/
public function isFeatureMatch(FeatureNode $feature)
{
@@ -41,7 +45,11 @@ public function isFeatureMatch(FeatureNode $feature)
}
/**
- * {@inheritdoc}
+ * Checks if scenario or outline matches specified filter.
+ *
+ * @param ScenarioNode $scenario Scenario or Outline node instance
+ *
+ * @return Boolean
*/
public function isScenarioMatch(ScenarioNode $scenario)
{
View
18 src/Behat/Gherkin/Filter/LineRangeFilter.php
@@ -16,7 +16,7 @@
/**
* Filters scenarios by definition line number range.
*
- * @author Fabian Kiss <headrevision@gmail.com>
+ * @author Fabian Kiss <headrevision@gmail.com>
*/
class LineRangeFilter implements FilterInterface
{
@@ -26,8 +26,8 @@ class LineRangeFilter implements FilterInterface
/**
* Initializes filter.
*
- * @param string $filterMinLine minimum line of a scenario to filter on
- * @param string $filterMaxLine maximum line of a scenario to filter on
+ * @param string $filterMinLine Minimum line of a scenario to filter on
+ * @param string $filterMaxLine Maximum line of a scenario to filter on
*/
public function __construct($filterMinLine, $filterMaxLine)
{
@@ -40,7 +40,11 @@ public function __construct($filterMinLine, $filterMaxLine)
}
/**
- * {@inheritdoc}
+ * Checks if Feature matches specified filter.
+ *
+ * @param FeatureNode $feature Feature instance
+ *
+ * @return Boolean
*/
public function isFeatureMatch(FeatureNode $feature)
{
@@ -48,7 +52,11 @@ public function isFeatureMatch(FeatureNode $feature)
}
/**
- * {@inheritdoc}
+ * Checks if scenario or outline matches specified filter.
+ *
+ * @param ScenarioNode $scenario Scenario or Outline node instance
+ *
+ * @return Boolean
*/
public function isScenarioMatch(ScenarioNode $scenario)
{
View
16 src/Behat/Gherkin/Filter/NameFilter.php
@@ -16,7 +16,7 @@
/**
* Filters scenarios by feature/scenario name.
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class NameFilter implements FilterInterface
{
@@ -25,7 +25,7 @@ class NameFilter implements FilterInterface
/**
* Initializes filter.
*
- * @param string $filterStringString name filter string
+ * @param string $filterStringString Name filter string
*/
public function __construct($filterString)
{
@@ -33,7 +33,11 @@ public function __construct($filterString)
}
/**
- * {@inheritdoc}
+ * Checks if Feature matches specified filter.
+ *
+ * @param FeatureNode $feature Feature instance
+ *
+ * @return Boolean
*/
public function isFeatureMatch(FeatureNode $feature)
{
@@ -45,7 +49,11 @@ public function isFeatureMatch(FeatureNode $feature)
}
/**
- * {@inheritdoc}
+ * Checks if scenario or outline matches specified filter.
+ *
+ * @param ScenarioNode $scenario Scenario or Outline node instance
+ *
+ * @return Boolean
*/
public function isScenarioMatch(ScenarioNode $scenario)
{
View
18 src/Behat/Gherkin/Filter/TagFilter.php
@@ -17,7 +17,7 @@
/**
* Filters scenarios by feature/scenario tag.
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class TagFilter implements FilterInterface
{
@@ -26,7 +26,7 @@ class TagFilter implements FilterInterface
/**
* Initializes filter.
*
- * @param string $filterStringString name filter string
+ * @param string $filterStringString Name filter string
*/
public function __construct($filterString)
{
@@ -34,7 +34,11 @@ public function __construct($filterString)
}
/**
- * {@inheritdoc}
+ * Checks if Feature matches specified filter.
+ *
+ * @param FeatureNode $feature Feature instance
+ *
+ * @return Boolean
*/
public function isFeatureMatch(FeatureNode $feature)
{
@@ -42,7 +46,11 @@ public function isFeatureMatch(FeatureNode $feature)
}
/**
- * {@inheritdoc}
+ * Checks if scenario or outline matches specified filter.
+ *
+ * @param ScenarioNode $scenario Scenario or Outline node instance
+ *
+ * @return Boolean
*/
public function isScenarioMatch(ScenarioNode $scenario)
{
@@ -52,7 +60,7 @@ public function isScenarioMatch(ScenarioNode $scenario)
/**
* Checks that node matches condition.
*
- * @param Behat\Gherkin\Node\Node\AbstractNode $node node to check
+ * @param AbstractNode $node Node to check
*/
protected function matchesCondition(AbstractNode $node)
{
View
18 src/Behat/Gherkin/Gherkin.php
@@ -18,7 +18,7 @@
/**
* Gherkin manager.
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class Gherkin
{
@@ -29,7 +29,7 @@ class Gherkin
/**
* Either to freeze features after loading or not.
*
- * @param Boolean $freeze
+ * @param Boolean $freeze To freeze?
*/
public function setFreeze($freeze = true)
{
@@ -39,7 +39,7 @@ public function setFreeze($freeze = true)
/**
* Adds loader to manager.
*
- * @param Behat\Gherkin\Loader\LoaderInterface $loader loader
+ * @param LoaderInterface $loader Feature loader
*/
public function addLoader(LoaderInterface $loader)
{
@@ -49,7 +49,7 @@ public function addLoader(LoaderInterface $loader)
/**
* Adds filter to manager.
*
- * @param Behat\Gherkin\Filter\FilterInterface $filter filter
+ * @param FilterInterface $filter Feature/Scenario filter
*/
public function addFilter(FilterInterface $filter)
{
@@ -59,7 +59,7 @@ public function addFilter(FilterInterface $filter)
/**
* Sets base features path.
*
- * @param string $path
+ * @param string $path Loaders base path
*/
public function setBasePath($path)
{
@@ -71,9 +71,9 @@ public function setBasePath($path)
/**
* Loads & filters resource with added loaders.
*
- * @param mixed $resource resource to load
+ * @param mixed $resource Resource to load
*
- * @return array features
+ * @return array
*/
public function load($resource)
{
@@ -120,9 +120,9 @@ public function load($resource)
/**
* Resolves loader by resource.
*
- * @param mixed $resoruce resource to load
+ * @param mixed $resoruce Resource to load
*
- * @return Behat\Gherkin\Loader\LoaderInterface loader for resource
+ * @return LoaderInterface
*/
public function resolveLoader($resource)
{
View
52 src/Behat/Gherkin/Keywords/ArrayKeywords.php
@@ -40,7 +40,7 @@
* )
* ));
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class ArrayKeywords implements KeywordsInterface
{
@@ -50,7 +50,7 @@ class ArrayKeywords implements KeywordsInterface
/**
* Initializes holder with keywords.
*
- * @param array $keywords
+ * @param array $keywords Keywords array
*/
public function __construct(array $keywords)
{
@@ -58,7 +58,9 @@ public function __construct(array $keywords)
}
/**
- * {@inheritdoc}
+ * Sets keywords holder language.
+ *
+ * @param string $language Language name
*/
public function setLanguage($language)
{
@@ -70,7 +72,9 @@ public function setLanguage($language)
}
/**
- * {@inheritdoc}
+ * Returns Feature keywords (splitted by "|").
+ *
+ * @return string
*/
public function getFeatureKeywords()
{
@@ -78,7 +82,9 @@ public function getFeatureKeywords()
}
/**
- * {@inheritdoc}
+ * Returns Background keywords (splitted by "|").
+ *
+ * @return string
*/
public function getBackgroundKeywords()
{
@@ -86,7 +92,9 @@ public function getBackgroundKeywords()
}
/**
- * {@inheritdoc}
+ * Returns Scenario keywords (splitted by "|").
+ *
+ * @return string
*/
public function getScenarioKeywords()
{
@@ -94,7 +102,9 @@ public function getScenarioKeywords()
}
/**
- * {@inheritdoc}
+ * Returns Scenario Outline keywords (splitted by "|").
+ *
+ * @return string
*/
public function getOutlineKeywords()
{
@@ -102,7 +112,9 @@ public function getOutlineKeywords()
}
/**
- * {@inheritdoc}
+ * Returns Examples keywords (splitted by "|").
+ *
+ * @return string
*/
public function getExamplesKeywords()
{
@@ -110,7 +122,9 @@ public function getExamplesKeywords()
}
/**
- * {@inheritdoc}
+ * Returns Given keywords (splitted by "|").
+ *
+ * @return string
*/
public function getGivenKeywords()
{
@@ -118,7 +132,9 @@ public function getGivenKeywords()
}
/**
- * {@inheritdoc}
+ * Returns When keywords (splitted by "|").
+ *
+ * @return string
*/
public function getWhenKeywords()
{
@@ -126,7 +142,9 @@ public function getWhenKeywords()
}
/**
- * {@inheritdoc}
+ * Returns Then keywords (splitted by "|").
+ *
+ * @return string
*/
public function getThenKeywords()
{
@@ -134,7 +152,9 @@ public function getThenKeywords()
}
/**
- * {@inheritdoc}
+ * Returns And keywords (splitted by "|").
+ *
+ * @return string
*/
public function getAndKeywords()
{
@@ -142,7 +162,9 @@ public function getAndKeywords()
}
/**
- * {@inheritdoc}
+ * Returns But keywords (splitted by "|").
+ *
+ * @return string
*/
public function getButKeywords()
{
@@ -150,7 +172,9 @@ public function getButKeywords()
}
/**
- * {@inheritdoc}
+ * Returns all step keywords (Given, When, Then, And, But).
+ *
+ * @return string
*/
public function getStepKeywords()
{
View
4 src/Behat/Gherkin/Keywords/CachedArrayKeywords.php
@@ -15,14 +15,14 @@
*
* $keywords = new Behat\Gherkin\Keywords\CachedArrayKeywords($file);
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class CachedArrayKeywords extends ArrayKeywords
{
/**
* Initializes holder with file.
*
- * @param string $file
+ * @param string $file Cached array path
*/
public function __construct($file)
{
View
28 src/Behat/Gherkin/Keywords/CucumberKeywords.php
@@ -17,14 +17,14 @@
*
* $keywords = new Behat\Gherkin\Keywords\CucumberKeywords($i18nYmlPath);
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class CucumberKeywords extends ArrayKeywords
{
/**
* Initializes holder with yaml string OR file.
*
- * @param string $yaml
+ * @param string $yaml Yaml string
*/
public function __construct($yaml)
{
@@ -32,7 +32,9 @@ public function __construct($yaml)
}
/**
- * {@inheritdoc}
+ * Returns Feature keywords (splitted by "|").
+ *
+ * @return string
*/
public function getGivenKeywords()
{
@@ -40,7 +42,9 @@ public function getGivenKeywords()
}
/**
- * {@inheritdoc}
+ * Returns When keywords (splitted by "|").
+ *
+ * @return string
*/
public function getWhenKeywords()
{
@@ -48,7 +52,9 @@ public function getWhenKeywords()
}
/**
- * {@inheritdoc}
+ * Returns Then keywords (splitted by "|").
+ *
+ * @return string
*/
public function getThenKeywords()
{
@@ -56,7 +62,9 @@ public function getThenKeywords()
}
/**
- * {@inheritdoc}
+ * Returns And keywords (splitted by "|").
+ *
+ * @return string
*/
public function getAndKeywords()
{
@@ -64,7 +72,9 @@ public function getAndKeywords()
}
/**
- * {@inheritdoc}
+ * Returns But keywords (splitted by "|").
+ *
+ * @return string
*/
public function getButKeywords()
{
@@ -74,9 +84,9 @@ public function getButKeywords()
/**
* Trim *| from the begining of the list.
*
- * @param string $keywordsString
+ * @param string $keywordsString Keywords string
*
- * @return string
+ * @return string
*/
private function prepareStepString($keywordsString)
{
View
50 src/Behat/Gherkin/Keywords/KeywordsDumper.php
@@ -15,7 +15,7 @@
/**
* Gherkin keywords dumper.
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class KeywordsDumper
{
@@ -25,7 +25,7 @@ class KeywordsDumper
/**
* Initializes dumper.
*
- * @param Behat\Gherkin\Keywords\KeywordsInterface $keywords
+ * @param KeywordsInterface $keywords Keywords instance
*/
public function __construct(KeywordsInterface $keywords)
{
@@ -38,7 +38,7 @@ public function __construct(KeywordsInterface $keywords)
*
* Callable should accept 2 arguments (array $keywords and Boolean $isShort)
*
- * @param callable $mapper
+ * @param callable $mapper Mapper function
*/
public function setKeywordsDumperFunction($mapper)
{
@@ -48,10 +48,10 @@ public function setKeywordsDumperFunction($mapper)
/**
* Defaults keywords dumper.
*
- * @param array $keywords keywords list
- * @param Boolean $isShort is short version
+ * @param array $keywords Keywords list
+ * @param Boolean $isShort Is short version
*
- * @return string
+ * @return string
*/
public function dumpKeywords(array $keywords, $isShort)
{
@@ -63,12 +63,12 @@ public function dumpKeywords(array $keywords, $isShort)
}
/**
- * Dump keyworded feature into string.
+ * Dumps keyworded feature into string.
*
- * @param string $language keywords language
- * @param Boolean $short dump short version
+ * @param string $language Keywords language
+ * @param Boolean $short Dump short version
*
- * @return string|array string for short version and array of features for extended
+ * @return string|array String for short version and array of features for extended
*/
public function dump($language, $short = true)
{
@@ -98,8 +98,8 @@ public function dump($language, $short = true)
/**
* Dumps feature example.
*
- * @param string $keyword item keyword
- * @param Boolean $short dump short version?
+ * @param string $keyword Item keyword
+ * @param Boolean $short Dump short version?
*
* @return string
*/
@@ -154,10 +154,10 @@ protected function dumpFeature($keyword, $short = true)
/**
* Dumps background example.
*
- * @param string $keyword item keyword
- * @param Boolean $short dump short version?
+ * @param string $keyword Item keyword
+ * @param Boolean $short Dump short version?
*
- * @return string
+ * @return string
*/
protected function dumpBackground($keyword, $short = true)
{
@@ -182,10 +182,10 @@ protected function dumpBackground($keyword, $short = true)
/**
* Dumps scenario example.
*
- * @param string $keyword item keyword
- * @param Boolean $short dump short version?
+ * @param string $keyword Item keyword
+ * @param Boolean $short Dump short version?
*
- * @return string
+ * @return string
*/
protected function dumpScenario($keyword, $short = true)
{
@@ -225,10 +225,10 @@ protected function dumpScenario($keyword, $short = true)
/**
* Dumps outline example.
*
- * @param string $keyword item keyword
- * @param Boolean $short dump short version?
+ * @param string $keyword Item keyword
+ * @param Boolean $short Dump short version?
*
- * @return string
+ * @return string
*/
protected function dumpOutline($keyword, $short = true)
{
@@ -283,11 +283,11 @@ protected function dumpOutline($keyword, $short = true)
/**
* Dumps step example.
*
- * @param string $keywords item keyword
- * @param string $text step text
- * @param Boolean $short dump short version?
+ * @param string $keywords Item keyword
+ * @param string $text Step text
+ * @param Boolean $short Dump short version?
*
- * @return string
+ * @return string
*/
protected function dumpStep($keywords, $text, $short = true)
{
View
36 src/Behat/Gherkin/Keywords/KeywordsInterface.php
@@ -13,91 +13,91 @@
/**
* Keywords holder interface.
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
interface KeywordsInterface
{
/**
* Sets keywords holder language.
*
- * @param string $language
+ * @param string $language Language name
*/
function setLanguage($language);
/**
* Returns Feature keywords (splitted by "|").
*
- * @return string
+ * @return string
*/
function getFeatureKeywords();
/**
* Returns Background keywords (splitted by "|").
*
- * @return string
+ * @return string
*/
function getBackgroundKeywords();
/**
* Returns Scenario keywords (splitted by "|").
*
- * @return string
+ * @return string
*/
function getScenarioKeywords();
/**
* Returns Scenario Outline keywords (splitted by "|").
*
- * @return string
+ * @return string
*/
function getOutlineKeywords();
/**
* Returns Examples keywords (splitted by "|").
*
- * @return string
+ * @return string
*/
function getExamplesKeywords();
/**
- * Returns Given keywords (splitted by "|")
+ * Returns Given keywords (splitted by "|").
*
- * @return string
+ * @return string
*/
function getGivenKeywords();
/**
- * Returns When keywords (splitted by "|")
+ * Returns When keywords (splitted by "|").
*
- * @return string
+ * @return string
*/
function getWhenKeywords();
/**
- * Returns Then keywords (splitted by "|")
+ * Returns Then keywords (splitted by "|").
*
- * @return string
+ * @return string
*/
function getThenKeywords();
/**
- * Returns And keywords (splitted by "|")
+ * Returns And keywords (splitted by "|").
*
- * @return string
+ * @return string
*/
function getAndKeywords();
/**
- * Returns But keywords (splitted by "|")
+ * Returns But keywords (splitted by "|").
*
- * @return string
+ * @return string
*/
function getButKeywords();
/**
* Returns all step keywords (splitted by "|").
*
- * @return string
+ * @return string
*/
function getStepKeywords();
}
View
52 src/Behat/Gherkin/Keywords/SymfonyTranslationKeywords.php
@@ -25,7 +25,7 @@
*
* $keywords = new Behat\Gherkin\Keywords\SymfonyTranslationKeywords($translator);
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class SymfonyTranslationKeywords implements KeywordsInterface
{
@@ -35,7 +35,7 @@ class SymfonyTranslationKeywords implements KeywordsInterface
/**
* Initializes keywords holder.
*
- * @param Symfony\Component\Translation\Translator $translator
+ * @param Translator $translator Translator instance
*/
public function __construct(Translator $translator)
{
@@ -43,7 +43,9 @@ public function __construct(Translator $translator)
}
/**
- * {@inheritdoc}
+ * Sets keywords holder language.
+ *
+ * @param string $language Language name
*/
public function setLanguage($language)
{
@@ -51,7 +53,9 @@ public function setLanguage($language)
}
/**
- * {@inheritdoc}
+ * Returns Feature keywords (splitted by "|").
+ *
+ * @return string
*/
public function getFeatureKeywords()
{
@@ -59,7 +63,9 @@ public function getFeatureKeywords()
}
/**
- * {@inheritdoc}
+ * Returns Background keywords (splitted by "|").
+ *
+ * @return string
*/
public function getBackgroundKeywords()
{
@@ -67,7 +73,9 @@ public function getBackgroundKeywords()
}
/**
- * {@inheritdoc}
+ * Returns Scenario keywords (splitted by "|").
+ *
+ * @return string
*/
public function getScenarioKeywords()
{
@@ -75,7 +83,9 @@ public function getScenarioKeywords()
}
/**
- * {@inheritdoc}
+ * Returns Scenario Outline keywords (splitted by "|").
+ *
+ * @return string
*/
public function getOutlineKeywords()
{
@@ -83,7 +93,9 @@ public function getOutlineKeywords()
}
/**
- * {@inheritdoc}
+ * Returns Examples keywords (splitted by "|").
+ *
+ * @return string
*/
public function getExamplesKeywords()
{
@@ -91,42 +103,54 @@ public function getExamplesKeywords()
}
/**
- * {@inheritdoc}
+ * Returns Given keywords (splitted by "|").
+ *
+ * @return string
*/
public function getGivenKeywords()
{
}
/**
- * {@inheritdoc}
+ * Returns When keywords (splitted by "|").
+ *
+ * @return string
*/
public function getWhenKeywords()
{
}
/**
- * {@inheritdoc}
+ * Returns Then keywords (splitted by "|").
+ *
+ * @return string
*/
public function getThenKeywords()
{
}
/**
- * {@inheritdoc}
+ * Returns And keywords (splitted by "|").
+ *
+ * @return string
*/
public function getAndKeywords()
{
}
/**
- * {@inheritdoc}
+ * Returns But keywords (splitted by "|").
+ *
+ * @return string
*/
public function getButKeywords()
{
}
/**
- * {@inheritdoc}
+ * Returns all step keywords (splitted by "|").
+ *
+ * @return string
*/
public function getStepKeywords()
{
View
77 src/Behat/Gherkin/Lexer.php
@@ -16,7 +16,7 @@
/**
* Gherkin lexer.
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class Lexer
{
@@ -30,7 +30,6 @@ class Lexer
private $stash = array();
private $inPyString = false;
private $pyStringSwallow = 0;
-
private $featureStarted = false;
private $allowMultilineArguments = false;
private $allowSteps = false;
@@ -38,7 +37,7 @@ class Lexer
/**
* Initializes lexer.
*
- * @param Behat\Gherkin\Keywords\KeywordsInterface $keywords keywords holder
+ * @param KeywordsInterface $keywords Keywords holder
*/
public function __construct(KeywordsInterface $keywords)
{
@@ -48,7 +47,7 @@ public function __construct(KeywordsInterface $keywords)
/**
* Sets lexer input.
*
- * @param string $input input string
+ * @param string $input Input string
*/
public function setInput($input)
{
@@ -77,7 +76,7 @@ public function setInput($input)
/**
* Sets keywords language.
*
- * @param string $language
+ * @param string $language Language name
*/
public function setLanguage($language)
{
@@ -88,7 +87,7 @@ public function setLanguage($language)
/**
* Returns next token or previously stashed one.
*
- * @return stdClass
+ * @return stdClass
*/
public function getAdvancedToken()
{
@@ -98,7 +97,7 @@ public function getAdvancedToken()
/**
* Defers token.
*
- * @param stdClass $token token to defer
+ * @param stdClass $token Token to defer
*/
public function deferToken(\stdClass $token)
{
@@ -109,9 +108,9 @@ public function deferToken(\stdClass $token)
/**
* Predicts for number of tokens.
*
- * @param integer $number number of tokens to predict
+ * @param integer $number Number of tokens to predict
*
- * @return stdClass predicted token
+ * @return stdClass
*/
public function predictToken($number = 1)
{
@@ -127,10 +126,10 @@ public function predictToken($number = 1)
/**
* Constructs token with specified parameters.
*
- * @param string $type token type
- * @param string $value token value
+ * @param string $type Token type
+ * @param string $value Token value
*
- * @return stdClass new token object
+ * @return stdClass
*/
public function takeToken($type, $value = null)
{
@@ -161,7 +160,7 @@ protected function consumeLine()
/**
* Returns stashed token or false if hasn't.
*
- * @return stdClass|boolean token if has stashed, false otherways
+ * @return stdClass|Boolean
*/
protected function getStashedToken()
{
@@ -171,7 +170,7 @@ protected function getStashedToken()
/**
* Returns deferred token or false if hasn't.
*
- * @return stdClass|boolean token if has deferred, false otherways
+ * @return stdClass|Boolean
*/
protected function getDeferredToken()
{
@@ -181,7 +180,7 @@ protected function getDeferredToken()
/**
* Returns next token from input.
*
- * @return stdClass
+ * @return stdClass
*/
protected function getNextToken()
{
@@ -206,10 +205,10 @@ protected function getNextToken()
/**
* Scans for token with specified regex.
*
- * @param string $regex regular expression
- * @param string $type expected token type
+ * @param string $regex Regular expression
+ * @param string $type Expected token type
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanInput($regex, $type)
{
@@ -227,10 +226,10 @@ protected function scanInput($regex, $type)
/**
* Scans for token with specified keywords.
*
- * @param string $keywords keywords (splitted with |)
- * @param string $type expected token type
+ * @param string $keywords Keywords (splitted with |)
+ * @param string $type Expected token type
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanInputForKeywords($keywords, $type)
{
@@ -267,7 +266,7 @@ protected function scanInputForKeywords($keywords, $type)
/**
* Scans EOS from input & returns it if found.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanEOS()
{
@@ -281,11 +280,9 @@ protected function scanEOS()
/**
* Returns keywords for provided type.
*
- * @param string $type
- *
- * @return string
+ * @param string $type Keyword type
*
- * @uses Behat\Gherkin\Keywords\KeywordsInterface
+ * @return string
*/
protected function getKeywords($type)
{
@@ -313,7 +310,7 @@ protected function getKeywords($type)
/**
* Scans Feature from input & returns it if found.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanFeature()
{
@@ -323,7 +320,7 @@ protected function scanFeature()
/**
* Scans Background from input & returns it if found.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanBackground()
{
@@ -333,7 +330,7 @@ protected function scanBackground()
/**
* Scans Scenario from input & returns it if found.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanScenario()
{
@@ -343,7 +340,7 @@ protected function scanScenario()
/**
* Scans Scenario Outline from input & returns it if found.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanOutline()
{
@@ -353,7 +350,7 @@ protected function scanOutline()
/**
* Scans Scenario Outline Examples from input & returns it if found.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanExamples()
{
@@ -363,7 +360,7 @@ protected function scanExamples()
/**
* Scans Step from input & returns it if found.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanStep()
{
@@ -388,7 +385,7 @@ protected function scanStep()
/**
* Scans PyString from input & returns it if found.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanPyStringOperator()
{
@@ -412,7 +409,7 @@ protected function scanPyStringOperator()
/**
* Scans PyString content.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanPyStringContent()
{
@@ -429,7 +426,7 @@ protected function scanPyStringContent()
/**
* Scans Table Row from input & returns it if found.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanTableRow()
{
@@ -457,7 +454,7 @@ protected function scanTableRow()
/**
* Scans Tags from input & returns it if found.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanTags()
{
@@ -480,7 +477,7 @@ protected function scanTags()
/**
* Scans Language specifier from input & returns it if found.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanLanguage()
{
@@ -498,7 +495,7 @@ protected function scanLanguage()
/**
* Scans Comment from input & returns it if found.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanComment()
{
@@ -516,7 +513,7 @@ protected function scanComment()
/**
* Scans Newline from input & returns it if found.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanNewline()
{
@@ -532,7 +529,7 @@ protected function scanNewline()
/**
* Scans text from input & returns it if found.
*
- * @return stdClass|null
+ * @return stdClass|null
*/
protected function scanText()
{
View
14 src/Behat/Gherkin/Loader/AbstractFileLoader.php
@@ -13,14 +13,16 @@
/**
* Abstract filesystem loader.
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
abstract class AbstractFileLoader implements FileLoaderInterface
{
protected $basePath;
/**
- * {@inheritdoc}
+ * Sets base features path.
+ *
+ * @param string $path Base loader path
*/
public function setBasePath($path)
{
@@ -30,9 +32,9 @@ public function setBasePath($path)
/**
* Finds relative path for provided absolute (relative to base features path).
*
- * @param string $path absolute path
+ * @param string $path Absolute path
*
- * @return string
+ * @return string
*/
protected function findRelativePath($path)
{
@@ -46,9 +48,9 @@ protected function findRelativePath($path)
/**
* Finds absolute path for provided relative (relative to base features path).
*
- * @param string $path relative path
+ * @param string $path Relative path
*
- * @return string
+ * @return string
*/
protected function findAbsolutePath($path)
{
View
50 src/Behat/Gherkin/Loader/ArrayLoader.php
@@ -15,12 +15,16 @@
/**
* From-array loader.
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class ArrayLoader implements LoaderInterface
{
/**
- * {@inheritdoc}
+ * Checks if current loader supports provided resource.
+ *
+ * @param mixed $resource Resource to load
+ *
+ * @return Boolean
*/
public function supports($resource)
{
@@ -28,7 +32,11 @@ public function supports($resource)
}
/**
- * {@inheritdoc}
+ * Loads features from provided resource.
+ *
+ * @param mixed $resource Resource to load
+ *
+ * @return array
*/
public function load($resource)
{
@@ -50,10 +58,10 @@ public function load($resource)
/**
* Loads feature from provided feature hash.
*
- * @param array $hash feature hash
- * @param integer $line feature definition line
+ * @param array $hash Feature hash
+ * @param integer $line Feature definition line
*
- * @return Behat\Gherkin\Node\FeatureNode
+ * @return FeatureNode
*/
protected function loadFeatureHash(array $hash, $line = 0)
{
@@ -92,9 +100,9 @@ protected function loadFeatureHash(array $hash, $line = 0)
/**
* Loads background from provided hash.
*
- * @param array $hash background hash
+ * @param array $hash Background hash
*
- * @return Behat\Gherkin\Node\BackgroundHash
+ * @return BackgroundNode
*/
protected function loadBackgroundHash(array $hash)
{
@@ -117,10 +125,10 @@ protected function loadBackgroundHash(array $hash)
/**
* Loads scenario from provided scenario hash.
*
- * @param array $hash scenario hash
- * @param integer $line scenario definition line
+ * @param array $hash Scenario hash
+ * @param integer $line Scenario definition line
*
- * @return Behat\Gherkin\Node\ScenarioNode
+ * @return ScenarioNode
*/
protected function loadScenarioHash(array $hash, $line = 0)
{
@@ -146,10 +154,10 @@ protected function loadScenarioHash(array $hash, $line = 0)
/**
* Loads outline from provided outline hash.
*
- * @param array $hash outline hash
- * @param integer $line outline definition line
+ * @param array $hash Outline hash
+ * @param integer $line Outline definition line
*
- * @return Behat\Gherkin\Node\OutlineNode
+ * @return OutlineNode
*/
protected function loadOutlineHash(array $hash, $line = 0)
{
@@ -186,10 +194,10 @@ protected function loadOutlineHash(array $hash, $line = 0)
/**
* Loads step from provided hash.
*
- * @param array $hash step hash
- * @param integer $line step definition line
+ * @param array $hash Step hash
+ * @param integer $line Step definition line
*
- * @return Behat\Gherkin\Node\StepNode
+ * @return StepNode
*/
protected function loadStepHash(array $hash, $line = 0)
{
@@ -213,9 +221,9 @@ protected function loadStepHash(array $hash, $line = 0)
/**
* Loads table from provided hash.
*
- * @param array $hash table hash
+ * @param array $hash Table hash
*
- * @return Behat\Gherkin\Node\TableNode
+ * @return TableNode
*/
protected function loadTableHash(array $hash)
{
@@ -231,9 +239,9 @@ protected function loadTableHash(array $hash)
/**
* Loads PyString from provided hash.
*
- * @param array $hash pystring hash
+ * @param array $hash PyString hash
*
- * @return Behat\Gherkin\Node\PyStringNode
+ * @return PyStringNode
*/
protected function loadPyStringHash(array $hash)
{
View
16 src/Behat/Gherkin/Loader/DirectoryLoader.php
@@ -17,7 +17,7 @@
/**
* Directory contents loader.
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class DirectoryLoader extends AbstractFileLoader
{
@@ -26,7 +26,7 @@ class DirectoryLoader extends AbstractFileLoader
/**
* Initializes loader.
*
- * @param Behat\Gherkin\Gherkin $gherkin
+ * @param Gherkin $gherkin Gherkin manager
*/
public function __construct(Gherkin $gherkin)
{
@@ -34,7 +34,11 @@ public function __construct(Gherkin $gherkin)
}
/**
- * {@inheritdoc}
+ * Checks if current loader supports provided resource.
+ *
+ * @param mixed $resource Resource to load
+ *
+ * @return Boolean
*/
public function supports($path)
{
@@ -43,7 +47,11 @@ public function supports($path)
}
/**
- * {@inheritdoc}
+ * Loads features from provided resource.
+ *
+ * @param mixed $resource Resource to load
+ *
+ * @return array
*/
public function load($path)
{
View
4 src/Behat/Gherkin/Loader/FileLoaderInterface.php
@@ -13,14 +13,14 @@
/**
* File Loader interface.
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
interface FileLoaderInterface extends LoaderInterface
{
/**
* Sets base features path.
*
- * @param string $path
+ * @param string $path Base loader path
*/
function setBasePath($path);
}
View
24 src/Behat/Gherkin/Loader/GherkinFileLoader.php
@@ -18,7 +18,7 @@
/**
* Gherkin *.feature files loader.
*
- * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class GherkinFileLoader extends AbstractFileLoader
{
@@ -28,8 +28,8 @@ class GherkinFileLoader extends AbstractFileLoader
/**
* Initializes loader.
*
- * @param Behat\Gherkin\Parser $parser
- * @param Behat\Gherkin\Cache\CacheInterface $cache
+ * @param Parser $parser Parser
+ * @param CacheInterface $cache Cache layer
*/
public function __construct(Parser $parser, CacheInterface $cache = null)
{
@@ -38,9 +38,9 @@ public function __construct(Parser $parser, CacheInterface $cache = null)
}
/**
- * Sets loader cache.
+ * Sets cache layer.
*
- * @param Behat\Gherkin\Cache\CacheInterface $cache cache instance
+ * @param CacheInterface $cache Cache layer
*/
public function setCache(CacheInterface $cache)
{
@@ -48,7 +48,11 @@ public function setCache(CacheInterface $cache)
}
/**
- * {@inheritdoc}
+ * Checks if current loader supports provided resource.
+ *
+ * @param mixed $resource Resource to load
+ *
+ * @return Boolean
*/
public function supports($path)
{
@@ -58,7 +62,11 @@ public function supports($path)
}
/**
- * {@inheritdoc}
+ * Loads features from provided resource.
+ *
+ * @param mixed $resource Resource to load
+ *
+ * @return array
*/
public function load($path)
{
@@ -81,7 +89,7 @@ public function load($path)
/**
* Parses feature at provided absolute path.
*
- * @param string $path
+ * @param string $path Feature path
*
* @return FeatureNode
*/
View
8 src/Behat/Gherkin/Loader/LoaderInterface.php
@@ -20,18 +20,18 @@
/**
* Checks if current loader supports provided resource.
*
- * @param string $resource
+ * @param mixed $resource Resource to load