getCount()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
Return the number (count) of vowels in the given string.
4
5
We will consider a, e, i, o, and u as vowels for this Kata.
6
7
The input string will only consist of lower case letters and/or spaces.
8
*/
9
10
function getCount($str)
11
{
12
    // Use regex to get the count
13
    //return preg_match_all('/[aeiou]/i', $str, $matches);
14
    return preg_match_all('/[aeiou]/i', $str);
15
}
16