Skip to content

Commit 8ee3e6f

Browse files
committed
Apply fixes
1 parent 50fdacc commit 8ee3e6f

File tree

82 files changed

+2256
-1495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2256
-1495
lines changed

src/Behat/Gherkin/Cache/CacheInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Behat Gherkin.
4+
* This file is part of the Behat Gherkin Parser.
55
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
66
*
77
* For the full copyright and license information, please view the LICENSE
@@ -22,8 +22,8 @@ interface CacheInterface
2222
/**
2323
* Checks that cache for feature exists and is fresh.
2424
*
25-
* @param string $path Feature path
26-
* @param integer $timestamp The last time feature was updated
25+
* @param string $path Feature path
26+
* @param int $timestamp The last time feature was updated
2727
*
2828
* @return bool
2929
*/
@@ -41,7 +41,7 @@ public function read($path);
4141
/**
4242
* Caches feature node.
4343
*
44-
* @param string $path Feature path
44+
* @param string $path Feature path
4545
* @param FeatureNode $feature Feature instance
4646
*/
4747
public function write($path, FeatureNode $feature);

src/Behat/Gherkin/Cache/FileCache.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?php
22

33
/*
4-
* This file is part of the Behat Gherkin.
5-
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
6-
*
7-
* For the full copyright and license information, please view the LICENSE
8-
* file that was distributed with this source code.
9-
*/
4+
* This file is part of the Behat Gherkin Parser.
5+
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
1010

1111
namespace Behat\Gherkin\Cache;
1212

1313
use Behat\Gherkin\Exception\CacheException;
14-
use Behat\Gherkin\Node\FeatureNode;
1514
use Behat\Gherkin\Gherkin;
15+
use Behat\Gherkin\Node\FeatureNode;
1616

1717
/**
1818
* File cache.
@@ -27,13 +27,13 @@ class FileCache implements CacheInterface
2727
/**
2828
* Initializes file cache.
2929
*
30-
* @param string $path Path to the folder where to store caches.
30+
* @param string $path path to the folder where to store caches
3131
*
3232
* @throws CacheException
3333
*/
3434
public function __construct($path)
3535
{
36-
$this->path = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'v'.Gherkin::VERSION;
36+
$this->path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'v' . Gherkin::VERSION;
3737

3838
if (!is_dir($this->path)) {
3939
@mkdir($this->path, 0777, true);
@@ -47,8 +47,8 @@ public function __construct($path)
4747
/**
4848
* Checks that cache for feature exists and is fresh.
4949
*
50-
* @param string $path Feature path
51-
* @param integer $timestamp The last time feature was updated
50+
* @param string $path Feature path
51+
* @param int $timestamp The last time feature was updated
5252
*
5353
* @return bool
5454
*/
@@ -78,7 +78,7 @@ public function read($path)
7878
$feature = unserialize(file_get_contents($cachePath));
7979

8080
if (!$feature instanceof FeatureNode) {
81-
throw new CacheException(sprintf('Can not load cache for a feature "%s" from "%s".', $path, $cachePath ));
81+
throw new CacheException(sprintf('Can not load cache for a feature "%s" from "%s".', $path, $cachePath));
8282
}
8383

8484
return $feature;
@@ -87,7 +87,7 @@ public function read($path)
8787
/**
8888
* Caches feature node.
8989
*
90-
* @param string $path Feature path
90+
* @param string $path Feature path
9191
* @param FeatureNode $feature Feature instance
9292
*/
9393
public function write($path, FeatureNode $feature)
@@ -104,6 +104,6 @@ public function write($path, FeatureNode $feature)
104104
*/
105105
protected function getCachePathFor($path)
106106
{
107-
return $this->path.'/'.md5($path).'.feature.cache';
107+
return $this->path . '/' . md5($path) . '.feature.cache';
108108
}
109109
}

src/Behat/Gherkin/Cache/MemoryCache.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

33
/*
4-
* This file is part of the Behat Gherkin.
5-
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
6-
*
7-
* For the full copyright and license information, please view the LICENSE
8-
* file that was distributed with this source code.
9-
*/
4+
* This file is part of the Behat Gherkin Parser.
5+
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
1010

1111
namespace Behat\Gherkin\Cache;
1212

@@ -20,14 +20,14 @@
2020
*/
2121
class MemoryCache implements CacheInterface
2222
{
23-
private $features = array();
24-
private $timestamps = array();
23+
private $features = [];
24+
private $timestamps = [];
2525

2626
/**
2727
* Checks that cache for feature exists and is fresh.
2828
*
29-
* @param string $path Feature path
30-
* @param integer $timestamp The last time feature was updated
29+
* @param string $path Feature path
30+
* @param int $timestamp The last time feature was updated
3131
*
3232
* @return bool
3333
*/
@@ -55,12 +55,12 @@ public function read($path)
5555
/**
5656
* Caches feature node.
5757
*
58-
* @param string $path Feature path
58+
* @param string $path Feature path
5959
* @param FeatureNode $feature Feature instance
6060
*/
6161
public function write($path, FeatureNode $feature)
6262
{
63-
$this->features[$path] = $feature;
63+
$this->features[$path] = $feature;
6464
$this->timestamps[$path] = time();
6565
}
6666
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Behat Gherkin.
4+
* This file is part of the Behat Gherkin Parser.
55
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
66
*
77
* For the full copyright and license information, please view the LICENSE
@@ -10,13 +10,11 @@
1010

1111
namespace Behat\Gherkin\Exception;
1212

13-
use RuntimeException;
14-
1513
/**
1614
* Cache exception.
1715
*
1816
* @author Konstantin Kudryashov <ever.zet@gmail.com>
1917
*/
20-
class CacheException extends RuntimeException implements Exception
18+
class CacheException extends \RuntimeException implements Exception
2119
{
2220
}

src/Behat/Gherkin/Exception/Exception.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Behat Gherkin.
4+
* This file is part of the Behat Gherkin Parser.
55
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
66
*
77
* For the full copyright and license information, please view the LICENSE
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Behat Gherkin.
4+
* This file is part of the Behat Gherkin Parser.
55
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
66
*
77
* For the full copyright and license information, please view the LICENSE
@@ -10,8 +10,6 @@
1010

1111
namespace Behat\Gherkin\Exception;
1212

13-
use RuntimeException;
14-
15-
class LexerException extends RuntimeException implements Exception
13+
class LexerException extends \RuntimeException implements Exception
1614
{
1715
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Behat Gherkin.
4+
* This file is part of the Behat Gherkin Parser.
55
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
66
*
77
* For the full copyright and license information, please view the LICENSE
@@ -10,8 +10,6 @@
1010

1111
namespace Behat\Gherkin\Exception;
1212

13-
use RuntimeException;
14-
15-
class NodeException extends RuntimeException implements Exception
13+
class NodeException extends \RuntimeException implements Exception
1614
{
1715
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Behat Gherkin.
4+
* This file is part of the Behat Gherkin Parser.
55
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
66
*
77
* For the full copyright and license information, please view the LICENSE
@@ -10,8 +10,6 @@
1010

1111
namespace Behat\Gherkin\Exception;
1212

13-
use RuntimeException;
14-
15-
class ParserException extends RuntimeException implements Exception
13+
class ParserException extends \RuntimeException implements Exception
1614
{
1715
}

src/Behat/Gherkin/Filter/ComplexFilter.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Behat Gherkin.
4+
* This file is part of the Behat Gherkin Parser.
55
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
66
*
77
* For the full copyright and license information, please view the LICENSE
@@ -22,13 +22,11 @@ abstract class ComplexFilter implements ComplexFilterInterface
2222
/**
2323
* Filters feature according to the filter.
2424
*
25-
* @param FeatureNode $feature
26-
*
2725
* @return FeatureNode
2826
*/
2927
public function filterFeature(FeatureNode $feature)
3028
{
31-
$scenarios = array();
29+
$scenarios = [];
3230
foreach ($feature->getScenarios() as $scenario) {
3331
if (!$this->isScenarioMatch($feature, $scenario)) {
3432
continue;

src/Behat/Gherkin/Filter/ComplexFilterInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Behat Gherkin.
4+
* This file is part of the Behat Gherkin Parser.
55
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
66
*
77
* For the full copyright and license information, please view the LICENSE
@@ -23,7 +23,7 @@ interface ComplexFilterInterface extends FeatureFilterInterface
2323
/**
2424
* Checks if scenario or outline matches specified filter.
2525
*
26-
* @param FeatureNode $feature Feature node instance
26+
* @param FeatureNode $feature Feature node instance
2727
* @param ScenarioInterface $scenario Scenario or Outline node instance
2828
*
2929
* @return bool

0 commit comments

Comments
 (0)