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 Clockwork\Request; // Data structure representing custom user data class ..

Decoded Output download

<?php namespace Clockwork\Request;

// Data structure representing custom user data
class UserData
{
	// Data items
	protected $data = [];

	// Data title
	protected $title;

	// Add generic user data
	public function data(array $data, $key = null)
	{
		if ($key !== null) {
			return $this->data[$key] = new UserDataItem($data);
		}

		return $this->data[] = new UserDataItem($data);
	}

	// Add user data shown as counters
	public function counters(array $data)
	{
		return $this->data($data)
			->showAs('counters');
	}

	// Add user data shown as table
	public function table($title, array $data)
	{
		return $this->data($data)
			->showAs('table')
			->title($title);
	}

	// Set data title
	public function title($title)
	{
		$this->title = $title;
		return $this;
	}

	// Transform data and all contents to a serializable array with metadata
	public function toArray()
	{
		return array_merge(
			array_map(function ($data) { return $data->toArray(); }, $this->data),
			[ '__meta' => array_filter([ 'title' => $this->title ]) ]
		);
	}
}
 ?>

Did this file decode correctly?

Original Code

<?php namespace Clockwork\Request;

// Data structure representing custom user data
class UserData
{
	// Data items
	protected $data = [];

	// Data title
	protected $title;

	// Add generic user data
	public function data(array $data, $key = null)
	{
		if ($key !== null) {
			return $this->data[$key] = new UserDataItem($data);
		}

		return $this->data[] = new UserDataItem($data);
	}

	// Add user data shown as counters
	public function counters(array $data)
	{
		return $this->data($data)
			->showAs('counters');
	}

	// Add user data shown as table
	public function table($title, array $data)
	{
		return $this->data($data)
			->showAs('table')
			->title($title);
	}

	// Set data title
	public function title($title)
	{
		$this->title = $title;
		return $this;
	}

	// Transform data and all contents to a serializable array with metadata
	public function toArray()
	{
		return array_merge(
			array_map(function ($data) { return $data->toArray(); }, $this->data),
			[ '__meta' => array_filter([ 'title' => $this->title ]) ]
		);
	}
}

Function Calls

None

Variables

None

Stats

MD5 29ac3ee59ab07b0822e84ea5f28a88f6
Eval Count 0
Decode Time 114 ms