Completed
Pull Request — 3.1 (#290)
by
unknown
09:17
created

AnnotatedDefinitionProposal::generateSnippet()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 3
1
<?php
2
/**
3
 * @file
4
 * Override the output of proposed methods to match Drupal coding standards.
5
 */
6
7
namespace Drupal\DrupalExtension\Definition\Proposal;
8
9
use Behat\Behat\Definition\Proposal\AnnotatedDefinitionProposal as BaseAnnotatedDefinitionProposal;
10
11
class AnnotatedDefinitionProposal extends BaseAnnotatedDefinitionProposal {
12
  protected function generateSnippet($regex, $methodName, array $args) {
13
    return sprintf(<<<PHP
14
  /**
15
   * @%s /^%s$/
16
   */
17
  public function %s(%s) {
18
    throw new PendingException();
19
  }
20
PHP
21
      , '%s', $regex, $methodName, implode(', ', $args)
22
    );
23
  }
24
}
25