HelloService   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A greet() 0 4 1
1
<?php
2
3
4
// This is the PEIP�s way of "hello world" done by configuration (no config)
5
// (Contrary to the scripted version) to decouple PEIP from your application
6
// this time a Gateway is created.
7
8
9
// requiring autoloader
10
require_once dirname(__FILE__).'/../misc/bootstrap.php';
11
12
// simple service class
13
class HelloService
14
{
15
    public function greet($name)
16
    {
17
        return 'Hello '.$name;
18
    }
19
}
20
21
// creating context instance from config file
22
$context = PEIP_XML_Context::createFromFile('config/config.xml');
23
24
// requiring the gateway instance
25
$Gateway = $context->getGateway('HelloWorldGateway');
26
27
// sending a string and receiving a string answer
28
echo $Gateway->sendAndReceive('World');
29