src/Events/php_exporter.php
public function get_event_name($event_line, $is_dispatch)
	{
		$event_text_line = $this->file_lines[$event_line];
		$event_text_line = ltrim($event_text_line, " \t");

		if ($is_dispatch)
		{
			$regex = '#\$([a-z](?:[a-z0-9_]|->)*)';
			$regex .= '->dispatch\(';
			$regex .= '\'%s\'';
			$regex .= '\);#';
		}
		else
		{
			$regex = '#extract\(\$([a-z](?:[a-z0-9_]|->)*)';
			$regex .= '->trigger_event\(';
			$regex .= '\'%s\'';
			$regex .= ', compact\(\$vars\)\)\);#';
		}

		$match = array();
		preg_match(sprintf($regex, $this->preg_match_event_name()), $event_text_line, $match);
		if (!isset($match[2]))
		{
			$match = array();
			preg_match(sprintf($regex, $this->preg_match_event_name_uppercase()), $event_text_line, $match);

			if (isset($match[2]))
			{
				$this->output->addMessage(Output::ERROR, sprintf('Event names should be all lowercase in %s for event %s', $this->current_clean_file, $match[2]));
			}
			else
			{
				throw new \LogicException("Can not find event name in line '{$event_text_line}' "
					. "in file '{$this->current_clean_file}:{$event_line}'", 1);
			}
		}

		return $match[2];
	}
public function get_event_name($event_line, $is_dispatch)
	{
		$event_text_line = $this->file_lines[$event_line];
		$event_text_line = ltrim($event_text_line, " \t");

		if ($is_dispatch)
		{
			$regex = '#\$([a-z](?:[a-z0-9_]|->)*)';
			$regex .= '->dispatch\(';
			$regex .= '\'%s\'';
			$regex .= '\);#';
		}
		else
		{
			$regex = '#extract\(\$([a-z](?:[a-z0-9_]|->)*)';
			$regex .= '->trigger_event\(';
			$regex .= '\'%s\'';
			$regex .= ', compact\(\$vars\)\)\);#';
		}

		$match = array();
		preg_match(sprintf($regex, $this->preg_match_event_name()), $event_text_line, $match);
		if (!isset($match[2]))
		{
			$match = array();
			preg_match(sprintf($regex, $this->preg_match_event_name_uppercase()), $event_text_line, $match);

			if (isset($match[2]))
			{
				$this->output->addMessage(Output::ERROR, sprintf('Event names should be all lowercase in %s for event %s', $this->current_clean_file, $match[2]));
			}
			else
			{
				throw new \LogicException("Can not find event name in line '{$event_text_line}' "
					. "in file '{$this->current_clean_file}:{$event_line}'", 1);
			}
		}

		return $match[2];
	}
Find the name of the event inside the dispatch() line

@param int  $event_line
@param bool $is_dispatch Do we look for dispatch() or trigger_event() ?

@return string    Name of the event
@throws \LogicException