PHP Classes

File: Event.php

Recommend this page to a friend!
  Classes of Yelson Ramirez Grönroos   PHP Event Dispatcher Class   Event.php   Download  
File: Event.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PHP Event Dispatcher Class
Call registered handlers when an event triggers
Author: By
Last change:
Date: 6 years ago
Size: 278 bytes
 

Contents

Class file image Download
<?php
namespace App;

use
ReflectionClass;

/**
 * Abstract event class
 */
abstract class Event
{
   
/**
     * Returns the short name of the child class.
     *
     * @return string
     */
   
public function getName() : string
   
{
        return (new
ReflectionClass($this))->getShortName();
    }
}