Skip to content

Commit

Permalink
Merge pull request #10 from Micro-PHP/v1.6.1-release
Browse files Browse the repository at this point in the history
Add interfaces to ApplicationTerminatedEvent and ApplicationTerminate…
  • Loading branch information
Asisyas authored Jan 21, 2023
2 parents a91c942 + 676a653 commit 7a274d3
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/Business/Event/ApplicationReadyEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@

namespace Micro\Kernel\App\Business\Event;

use Micro\Component\EventEmitter\EventInterface;
use Micro\Kernel\App\AppKernelInterface;

readonly class ApplicationReadyEvent implements EventInterface
readonly class ApplicationReadyEvent implements ApplicationReadyEventInterface
{
public function __construct(private AppKernelInterface $appKernel, private string $environment)
{
Expand Down
35 changes: 35 additions & 0 deletions src/Business/Event/ApplicationReadyEventInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Micro framework package.
*
* (c) Stanislau Komar <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Micro\Kernel\App\Business\Event;

use Micro\Component\EventEmitter\EventInterface;
use Micro\Kernel\App\AppKernelInterface;

/**
* @author Stanislau Komar <[email protected]>
*/
interface ApplicationReadyEventInterface extends EventInterface
{
public function kernel(): AppKernelInterface;

/**
* Returns application environment. APP_ENV.
*/
public function environment(): string;

/**
* Returns PHP_SAPI env value by default.
*/
public function systemEnvironment(): string;
}
4 changes: 1 addition & 3 deletions src/Business/Event/ApplicationTerminatedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace Micro\Kernel\App\Business\Event;

use Micro\Component\EventEmitter\EventInterface;

class ApplicationTerminatedEvent implements EventInterface
readonly class ApplicationTerminatedEvent implements ApplicationTerminatedEventInterface
{
}
23 changes: 23 additions & 0 deletions src/Business/Event/ApplicationTerminatedEventInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Micro framework package.
*
* (c) Stanislau Komar <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Micro\Kernel\App\Business\Event;

use Micro\Component\EventEmitter\EventInterface;

/**
* @author Stanislau Komar <[email protected]>
*/
interface ApplicationTerminatedEventInterface extends EventInterface
{
}

0 comments on commit 7a274d3

Please sign in to comment.