Cls
in package
Helper for working with classes and objects
Tags
Table of Contents
- equals() : bool
- Are two classes the same as one another?
- exists() : bool
- Wrapper for class_exists()
- extends() : bool
- Wrapper for is_subclass_of()
- getNamespace() : string
- Returns only a classes namespace name
- implements() : bool
- Does a class implement an interface?
- stripNamespace() : string
- Strip the namespace from a FQCN
- throwable() : bool
- Check to see if a class implements the \Throwable interface
Methods
equals()
Are two classes the same as one another?
public
static equals(string $classOne, string $classTwo) : bool
Parameters
- $classOne : string
- $classTwo : string
Return values
bool —exists()
Wrapper for class_exists()
public
static exists(string $class) : bool
Parameters
- $class : string
Tags
Return values
bool —extends()
Wrapper for is_subclass_of()
public
static extends(string $class, string $parent) : bool
Parameters
- $class : string
- $parent : string
Tags
Return values
bool —getNamespace()
Returns only a classes namespace name
public
static getNamespace(string $classname) : string
Parameters
- $classname : string
Tags
Return values
string —implements()
Does a class implement an interface?
public
static implements(string $class, string $interface) : bool
Parameters
- $class : string
- $interface : string
Tags
Return values
bool —stripNamespace()
Strip the namespace from a FQCN
public
static stripNamespace(string $classname) : string
Parameters
- $classname : string
Tags
Return values
string —throwable()
Check to see if a class implements the \Throwable interface
public
static throwable(string $exception) : bool
Parameters
- $exception : string