• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ICanBoogie / ICanBoogie / 11626221351

01 Nov 2024 07:54AM UTC coverage: 41.117%. Remained the same
11626221351

push

github

olvlvl
Rename PingController as PingResponder

81 of 197 relevant lines covered (41.12%)

0.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.0
/lib/SessionWithEvent.php
1
<?php
2

3
/*
4
 * This file is part of the ICanBoogie package.
5
 *
6
 * (c) Olivier Laviale <olivier.laviale@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
namespace ICanBoogie;
13

14
use ICanBoogie\Session\StartEvent;
15

16
/**
17
 * Extends the {@see Session} to emit {@see StartEvent} when the session starts.
18
 */
19
final class SessionWithEvent extends Session
20
{
21
    private static SessionWithEvent $instance;
22

23
    public static function for_app(Application $app): self
24
    {
25
        return self::$instance ??= new self($app->config->session);
2✔
26
    }
27

28
    /**
29
     * @inheritdoc
30
     *
31
     * Emits {@see StartEvent} when the session starts.
32
     */
33
    public function start(): bool
34
    {
35
        $started = parent::start();
×
36

37
        if ($started) {
×
38
            emit(new StartEvent($this));
×
39
        }
40

41
        return $started;
×
42
    }
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc