DashboardController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A onOpen() 0 12 1
1
<?php
2
3
namespace BeyondCode\DuskDashboard\Ratchet\Http;
4
5
use GuzzleHttp\Psr7\Response;
6
use function GuzzleHttp\Psr7\str;
7
use Psr\Http\Message\RequestInterface;
8
use Ratchet\ConnectionInterface;
9
10
class DashboardController extends Controller
11
{
12
    public function onOpen(ConnectionInterface $connection, RequestInterface $request = null)
13
    {
14
        $connection->send(
15
            str(new Response(
0 ignored issues
show
Deprecated Code introduced by
The function GuzzleHttp\Psr7\str() has been deprecated with message: str will be removed in guzzlehttp/psr7:2.0. Use Message::toString instead.

This function 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 function will be removed from the class and what other function to use instead.

Loading history...
16
                200,
17
                ['Content-Type' => 'text/html'],
18
                file_get_contents(__DIR__.'/../../../resources/views/index.html')
19
            ))
20
        );
21
22
        $connection->close();
23
    }
24
}
25