Passed
Branch master (6e4050)
by Scott
02:58
created

TryCatch   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A id() 0 4 1
A synopsis() 0 4 1
A usage() 0 4 1
A examples() 0 11 1
1
<?php
2
namespace Desmond\functions\docs;
3
use Desmond\functions\Doc;
4
5
class TryCatch implements Doc
6
{
7
    public function id()
8
    {
9
        return 'try';
10
    }
11
12
    public function synopsis()
13
    {
14
        return 'Try something and catch any exceptions it might throw.';
15
    }
16
17
    public function usage()
18
    {
19
        return '(try <code:Mixed> <catch:List>)';
20
    }
21
22
    public function examples()
23
    {
24
        return [
25
            '
26
(try
27
  (some-stuff)
28
  (catch :error-message
29
    (print-line :error-message))
30
)'
31
        ];
32
    }
33
}
34