Completed
Push — 3.x ( 377254...28590d )
by San
02:50
created

BaseContext   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 4
dl 0
loc 27
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getTranslationResources() 0 4 1
A castToInt() 0 4 1
A getMinkContext() 0 8 1
1
<?php
2
3
namespace Behatch\Context;
4
5
use Behat\Behat\Context\TranslatableContext;
6
use Behat\MinkExtension\Context\RawMinkContext;
7
8
abstract class BaseContext extends RawMinkContext implements TranslatableContext
9
{
10
    use \Behatch\Html;
11
    use \Behatch\Asserter;
12
13
    public static function getTranslationResources()
14
    {
15
        return glob(__DIR__ . '/../../i18n/*.xliff');
16
    }
17
18
    /**
19
     * @transform /^(0|[1-9]\d*)(?:st|nd|rd|th)?$/
20
     */
21
    public function castToInt($count)
22
    {
23
        return intval($count);
24
    }
25
26
    protected function getMinkContext()
27
    {
28
        $context = new \Behat\MinkExtension\Context\MinkContext();
29
        $context->setMink($this->getMink());
30
        $context->setMinkParameters($this->getMinkParameters());
31
32
        return $context;
33
    }
34
}
35