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 Cysha\Casino\Holdem\Game; use Assert\Assertion; use Cysha\Casino\Game\Ch..

Decoded Output download

<?php

namespace Cysha\Casino\Holdem\Game;

use Assert\Assertion;
use Cysha\Casino\Game\Chips;
use Cysha\Casino\Game\Client;
use Cysha\Casino\Game\Contracts\Player as PlayerContract;
use Ramsey\Uuid\Uuid;

class Player extends Client implements PlayerContract
{
    /**
     * @var Chips
     */
    private $chipStack;

    /**
     * PlayerTest constructor.
     *
     * @param string $name
     * @param Chips  $chips
     */
    public function __construct(Uuid $id, $name, Chips $wallet = null, Chips $chips = null)
    {
        parent::__construct($id, $name, $wallet);

        $this->chipStack = $chips ?? Chips::zero();
    }

    /**
     * @param Client $client
     * @param Chips  $chipCount
     *
     * @return PlayerContract
     */
    public static function fromClient(Client $client, Chips $chipCount = null): PlayerContract
    {
        return new self($client->id(), $client->name(), $client->wallet(), $chipCount);
    }

    /**
     * @param PlayerContract $object
     *
     * @return bool
     */
    public function equals(PlayerContract $object): bool
    {
        return static::class === get_class($object)
        && $this->id() === $object->id()
        && $this->name() === $object->name()
        && $this->wallet() === $object->wallet()
        && $this->chipStack() === $object->chipStack();
    }

    /**
     * @return Chips
     */
    public function chipStack(): Chips
    {
        return $this->chipStack;
    }

    /**
     * @param Chips $chips
     */
    public function bet(Chips $chips)
    {
        Assertion::greaterOrEqualThan($chips->amount(), 0);
        Assertion::lessOrEqualThan($chips->amount(), $this->chipStack()->amount());
        $this->chipStack()->subtract($chips);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Cysha\Casino\Holdem\Game;

use Assert\Assertion;
use Cysha\Casino\Game\Chips;
use Cysha\Casino\Game\Client;
use Cysha\Casino\Game\Contracts\Player as PlayerContract;
use Ramsey\Uuid\Uuid;

class Player extends Client implements PlayerContract
{
    /**
     * @var Chips
     */
    private $chipStack;

    /**
     * PlayerTest constructor.
     *
     * @param string $name
     * @param Chips  $chips
     */
    public function __construct(Uuid $id, $name, Chips $wallet = null, Chips $chips = null)
    {
        parent::__construct($id, $name, $wallet);

        $this->chipStack = $chips ?? Chips::zero();
    }

    /**
     * @param Client $client
     * @param Chips  $chipCount
     *
     * @return PlayerContract
     */
    public static function fromClient(Client $client, Chips $chipCount = null): PlayerContract
    {
        return new self($client->id(), $client->name(), $client->wallet(), $chipCount);
    }

    /**
     * @param PlayerContract $object
     *
     * @return bool
     */
    public function equals(PlayerContract $object): bool
    {
        return static::class === get_class($object)
        && $this->id() === $object->id()
        && $this->name() === $object->name()
        && $this->wallet() === $object->wallet()
        && $this->chipStack() === $object->chipStack();
    }

    /**
     * @return Chips
     */
    public function chipStack(): Chips
    {
        return $this->chipStack;
    }

    /**
     * @param Chips $chips
     */
    public function bet(Chips $chips)
    {
        Assertion::greaterOrEqualThan($chips->amount(), 0);
        Assertion::lessOrEqualThan($chips->amount(), $this->chipStack()->amount());
        $this->chipStack()->subtract($chips);
    }
}

Function Calls

None

Variables

None

Stats

MD5 c4de19e55b0be44727d3a5243af3b71d
Eval Count 0
Decode Time 98 ms