DashboardController::onOpen()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 2
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