Completed
Push — master ( 24a9b5...f93101 )
by Siwapun
03:29
created

match()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
ccs 6
cts 6
cp 1
crap 1
1
<?php
2
namespace Aerophant\Ramda;
3
4
/**
5
 * @param string $pattern
6
 * @param string $string
7
 * @return array|\Closure
8
 */
9
function match()
10
{
11
  $match = function (string $pattern, string $string) {
12 2
    preg_match($pattern, $string, $matches);
13 2
    return $matches;
14 2
  };
15 2
  $arguments = func_get_args();
16 2
  $curried = curryN($match, 2);
17 2
  return call_user_func_array($curried, $arguments);
18
}
19