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 declare(strict_types=1); namespace Pest\Plugins; use Pest\Contracts\Plugins\Handl..

Decoded Output download

<?php

declare(strict_types=1);

namespace Pest\Plugins;

use Pest\Contracts\Plugins\HandlesArguments;

/**
 * @internal
 */
final class Environment implements HandlesArguments
{
    /**
     * The continuous integration environment.
     */
    public const CI = 'ci';

    /**
     * The local environment.
     */
    public const LOCAL = 'local';

    /**
     * The current environment.
     */
    private static ?string $name = null;

    /**
     * {@inheritdoc}
     */
    public function handleArguments(array $arguments): array
    {
        foreach ($arguments as $index => $argument) {
            if ($argument === '--ci') {
                unset($arguments[$index]);

                self::$name = self::CI;
            }
        }

        return array_values($arguments);
    }

    /**
     * Gets the environment name.
     */
    public static function name(?string $name = null): string
    {
        if (is_string($name)) {
            self::$name = $name;
        }

        return self::$name ?? self::LOCAL;
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace Pest\Plugins;

use Pest\Contracts\Plugins\HandlesArguments;

/**
 * @internal
 */
final class Environment implements HandlesArguments
{
    /**
     * The continuous integration environment.
     */
    public const CI = 'ci';

    /**
     * The local environment.
     */
    public const LOCAL = 'local';

    /**
     * The current environment.
     */
    private static ?string $name = null;

    /**
     * {@inheritdoc}
     */
    public function handleArguments(array $arguments): array
    {
        foreach ($arguments as $index => $argument) {
            if ($argument === '--ci') {
                unset($arguments[$index]);

                self::$name = self::CI;
            }
        }

        return array_values($arguments);
    }

    /**
     * Gets the environment name.
     */
    public static function name(?string $name = null): string
    {
        if (is_string($name)) {
            self::$name = $name;
        }

        return self::$name ?? self::LOCAL;
    }
}

Function Calls

None

Variables

None

Stats

MD5 00f3b8de23ea308e40642e21a6d3839b
Eval Count 0
Decode Time 100 ms