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 Pagekit\User\Annotation; /** * @Annotation */ class Access { /** ..

Decoded Output download

<?php

namespace Pagekit\User\Annotation;

/**
 * @Annotation
 */
class Access
{
    /**
     * @var string
     */
    protected $expression;

    /**
     * @var bool
     */
    protected $admin = null;

    /**
     * Constructor.
     *
     * @param  array $data
     * @throws \BadMethodCallException
     */
    public function __construct(array $data)
    {
        foreach ($data as $key => $value) {

            if ($key == 'value') {
                $key = 'expression';
            }

            if (!method_exists($this, $method = 'set'.$key)) {
                throw new \BadMethodCallException(sprintf("Unknown property '%s' on annotation '%s'.", $key, get_class($this)));
            }

            $this->$method($value);
        }
    }

    /**
     * Gets the access expression.
     *
     * @return string
     */
    public function getExpression()
    {
        return $this->expression;
    }

    /**
     * Sets the access expression.
     *
     * @param string
     */
    public function setExpression($expression)
    {
        $this->expression = $expression;
    }

    /**
     * Gets admin option.
     *
     * @return bool
     */
    public function getAdmin()
    {
        return $this->admin;
    }

    /**
     * Sets the admin option.
     *
     * @param bool $admin
     */
    public function setAdmin($admin)
    {
        $this->admin = $admin;
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Pagekit\User\Annotation;

/**
 * @Annotation
 */
class Access
{
    /**
     * @var string
     */
    protected $expression;

    /**
     * @var bool
     */
    protected $admin = null;

    /**
     * Constructor.
     *
     * @param  array $data
     * @throws \BadMethodCallException
     */
    public function __construct(array $data)
    {
        foreach ($data as $key => $value) {

            if ($key == 'value') {
                $key = 'expression';
            }

            if (!method_exists($this, $method = 'set'.$key)) {
                throw new \BadMethodCallException(sprintf("Unknown property '%s' on annotation '%s'.", $key, get_class($this)));
            }

            $this->$method($value);
        }
    }

    /**
     * Gets the access expression.
     *
     * @return string
     */
    public function getExpression()
    {
        return $this->expression;
    }

    /**
     * Sets the access expression.
     *
     * @param string
     */
    public function setExpression($expression)
    {
        $this->expression = $expression;
    }

    /**
     * Gets admin option.
     *
     * @return bool
     */
    public function getAdmin()
    {
        return $this->admin;
    }

    /**
     * Sets the admin option.
     *
     * @param bool $admin
     */
    public function setAdmin($admin)
    {
        $this->admin = $admin;
    }
}

Function Calls

None

Variables

None

Stats

MD5 15f2e110dfde2a5a5ee91995b852c4c6
Eval Count 0
Decode Time 88 ms