LocalConnectionFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * AppserverIo\RemoteMethodInvocation\LocalConnectionFactory
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2015 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/appserver-io/rmi
18
 * @link      http://www.appserver.io
19
 */
20
21
namespace AppserverIo\RemoteMethodInvocation;
22
23
use AppserverIo\Collections\ArrayList;
24
25
/**
26
 * Connection factory to create a new local context connection.
27
 *
28
 * @author    Tim Wagner <[email protected]>
29
 * @copyright 2015 TechDivision GmbH <[email protected]>
30
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
31
 * @link      https://github.com/appserver-io/rmi
32
 * @link      http://www.appserver.io
33
 *
34
 * @deprecated Use \AppserverIo\RemoteMethodInvocation\LocalProxy instead
35
 */
36
class LocalConnectionFactory
37
{
38
39
    /**
40
     * Private constructor to use class only in static context.
41
     */
42
    private function __construct()
43
    {
44
    }
45
46
    /**
47
     * Simple factory to create a new context connection
48
     * of the requested type.
49
     *
50
     * @return \AppserverIo\RemoteMethodInvocation\ConnectionInterface The requested context connection
51
     */
52
    public static function createContextConnection()
53
    {
54
55
        // initialize the remote method call parser and the session storage
56
        $sessions = new ArrayList();
57
58
        // initialize the local context connection
59
        $contextConnection = new LocalContextConnection();
0 ignored issues
show
Deprecated Code introduced by
The class AppserverIo\RemoteMethod...\LocalContextConnection has been deprecated with message: Use \AppserverIo\RemoteMethodInvocation\LocalProxy instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
60
        $contextConnection->injectSessions($sessions);
61
62
        // return the initialized connection
63
        return $contextConnection;
64
    }
65
}
66