Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Dingo\Api\Transformer; use Closure; use RuntimeException; use Dingo\Api\H..

Decoded Output download

<?php
 namespace Dingo\Api\Transformer; use Closure; use RuntimeException; use Dingo\Api\Http\Request; use Illuminate\Support\Collection; use Illuminate\Container\Container; use Dingo\Api\Contract\Transformer\Adapter; use Illuminate\Contracts\Pagination\Paginator; use Illuminate\Http\Request as IlluminateRequest; class Factory { protected $container; protected $bindings = array(); protected $adapter; public function __construct(Container $container, Adapter $adapter) { $this->container = $container; $this->adapter = $adapter; } public function register($class, $resolver, array $parameters = array(), Closure $after = null) { return $this->bindings[$class] = $this->createBinding($resolver, $parameters, $after); } public function transform($response) { $binding = $this->getBinding($response); return $this->adapter->transform($response, $binding->resolveTransformer(), $binding, $this->getRequest()); } public function transformableResponse($response) { return $this->transformableType($response) && $this->hasBinding($response); } public function transformableType($value) { return is_object($value) || is_string($value); } public function getBinding($class) { if ($this->isCollection($class) && !$class->isEmpty()) { return $this->getBindingFromCollection($class); } $class = is_object($class) ? get_class($class) : $class; if (!$this->hasBinding($class)) { throw new RuntimeException("Unable to find bound transformer for "" . $class . "" class."); } return $this->bindings[$class]; } protected function createBinding($resolver, array $parameters = array(), Closure $callback = null) { return new Binding($this->container, $resolver, $parameters, $callback); } protected function getBindingFromCollection($collection) { return $this->getBinding($collection->first()); } protected function hasBinding($class) { if ($this->isCollection($class) && !$class->isEmpty()) { $class = $class->first(); } $class = is_object($class) ? get_class($class) : $class; return isset($this->bindings[$class]); } protected function isCollection($instance) { return $instance instanceof Collection || $instance instanceof Paginator; } public function getTransformerBindings() { return $this->bindings; } public function setAdapter($adapter) { if (is_callable($adapter)) { $adapter = call_user_func($adapter, $this->container); } $this->adapter = $adapter; } public function getAdapter() { return $this->adapter; } public function getRequest() { $request = $this->container["request"]; if ($request instanceof IlluminateRequest && !$request instanceof Request) { $request = (new Request())->createFromIlluminate($request); } return $request; } public function __call($method, $parameters) { return call_user_func_array(array($this->adapter, $method), $parameters); } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace Dingo\Api\Transformer; use Closure; use RuntimeException; use Dingo\Api\Http\Request; use Illuminate\Support\Collection; use Illuminate\Container\Container; use Dingo\Api\Contract\Transformer\Adapter; use Illuminate\Contracts\Pagination\Paginator; use Illuminate\Http\Request as IlluminateRequest; class Factory { protected $container; protected $bindings = array(); protected $adapter; public function __construct(Container $container, Adapter $adapter) { $this->container = $container; $this->adapter = $adapter; } public function register($class, $resolver, array $parameters = array(), Closure $after = null) { return $this->bindings[$class] = $this->createBinding($resolver, $parameters, $after); } public function transform($response) { $binding = $this->getBinding($response); return $this->adapter->transform($response, $binding->resolveTransformer(), $binding, $this->getRequest()); } public function transformableResponse($response) { return $this->transformableType($response) && $this->hasBinding($response); } public function transformableType($value) { return is_object($value) || is_string($value); } public function getBinding($class) { if ($this->isCollection($class) && !$class->isEmpty()) { return $this->getBindingFromCollection($class); } $class = is_object($class) ? get_class($class) : $class; if (!$this->hasBinding($class)) { throw new RuntimeException("\125\x6e\141\x62\x6c\145\x20\x74\157\x20\146\151\156\144\x20\x62\157\165\156\x64\40\x74\162\141\x6e\163\x66\x6f\x72\x6d\x65\162\40\146\x6f\x72\40\42" . $class . "\42\x20\x63\154\141\x73\x73\x2e"); } return $this->bindings[$class]; } protected function createBinding($resolver, array $parameters = array(), Closure $callback = null) { return new Binding($this->container, $resolver, $parameters, $callback); } protected function getBindingFromCollection($collection) { return $this->getBinding($collection->first()); } protected function hasBinding($class) { if ($this->isCollection($class) && !$class->isEmpty()) { $class = $class->first(); } $class = is_object($class) ? get_class($class) : $class; return isset($this->bindings[$class]); } protected function isCollection($instance) { return $instance instanceof Collection || $instance instanceof Paginator; } public function getTransformerBindings() { return $this->bindings; } public function setAdapter($adapter) { if (is_callable($adapter)) { $adapter = call_user_func($adapter, $this->container); } $this->adapter = $adapter; } public function getAdapter() { return $this->adapter; } public function getRequest() { $request = $this->container["\162\x65\x71\x75\x65\x73\164"]; if ($request instanceof IlluminateRequest && !$request instanceof Request) { $request = (new Request())->createFromIlluminate($request); } return $request; } public function __call($method, $parameters) { return call_user_func_array(array($this->adapter, $method), $parameters); } }

Function Calls

None

Variables

None

Stats

MD5 2fd1ef3ef018547dff9e275bd6d68e9f
Eval Count 0
Decode Time 94 ms