AbstractClass.php 485 Bytes
<?php

/**
 * @Author: irul
 * @Date:   2019-09-27 20:55:56
 * @Last Modified by:   irul
 * @Last Modified time: 2019-10-01 23:43:21
 */

namespace Integrasi\Reklame\Base;

class AbstractClass
{
	/**
	 * get current namespace
	 * ref: https://stackoverflow.com/a/6776525
	 */
	protected static function getParentNamespace()
	{
		$currentClass = get_called_class(); // call on static
		$reflection   = new \ReflectionClass($currentClass);
		return $reflection->getNamespaceName();
	}
}