);
$parts = explode('.', $callback);
foreach ($parts as $part) {
- if (!preg_match($pattern, $part) || in_array($part, $reserved, true)) {
+ if (!preg_match($pattern, $part) || \in_array($part, $reserved, true)) {
throw new \InvalidArgumentException('The callback name is not valid.');
}
}
*/
public function setData($data = array())
{
- if (defined('HHVM_VERSION')) {
+ if (\defined('HHVM_VERSION')) {
// HHVM does not trigger any warnings and let exceptions
// thrown from a JsonSerializable object pass through.
// If only PHP did the same...
try {
$data = json_encode($data, $this->encodingOptions);
} catch (\Exception $e) {
- if ('Exception' === get_class($e) && 0 === strpos($e->getMessage(), 'Failed calling ')) {
+ if ('Exception' === \get_class($e) && 0 === strpos($e->getMessage(), 'Failed calling ')) {
throw $e->getPrevious() ?: $e;
}
throw $e;