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 LoversOfBehat\TableExtension\Context\Initiali..

Decoded Output download

<?php

declare(strict_types = 1);

namespace LoversOfBehat\TableExtension\Context\Initializer;

use Behat\Behat\Context\Context;
use Behat\Behat\Context\Initializer\ContextInitializer;
use Behat\Testwork\Hook\HookDispatcher;
use LoversOfBehat\TableExtension\Context\TableAwareInterface;
use LoversOfBehat\TableExtension\EnvironmentContainer;

class TableAwareInitializer implements ContextInitializer
{

    /**
     * The dispatcher for Behat hooks.
     *
     * @var \Behat\Testwork\Hook\HookDispatcher
     */
    protected $dispatcher;

    /**
     * The service that references the Behat test environment.
     *
     * @var EnvironmentContainer
     */
    protected $container;

    /**
     * The TableContext configuration array.
     *
     * @var array
     */
    protected $config;

    /**
     * Constructs a new TableAwareInitializer object.
     *
     * @param \Behat\Testwork\Hook\HookDispatcher $dispatcher
     *   The Behat hook dispatcher.
     * @param EnvironmentContainer $container
     *   The service that references the Behat test environment.
     * @param array $config
     *   The configuration for the extension, as defined in behat.yml.
     */
    public function __construct(HookDispatcher $dispatcher, EnvironmentContainer $container, array $config)
    {
        $this->dispatcher = $dispatcher;
        $this->container = $container;
        $this->config = $config;
    }

    /**
     * {@inheritdocs}
     */
    public function initializeContext(Context $context): void
    {
        if (!$context instanceof TableAwareInterface) {
            return;
        }
        $context->setDispatcher($this->dispatcher);
        $context->setEnvironmentContainer($this->container);
        $table_map = !empty($this->config['table_map']) ? $this->config['table_map'] : [];
        $context->setTableMap($table_map);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types = 1);

namespace LoversOfBehat\TableExtension\Context\Initializer;

use Behat\Behat\Context\Context;
use Behat\Behat\Context\Initializer\ContextInitializer;
use Behat\Testwork\Hook\HookDispatcher;
use LoversOfBehat\TableExtension\Context\TableAwareInterface;
use LoversOfBehat\TableExtension\EnvironmentContainer;

class TableAwareInitializer implements ContextInitializer
{

    /**
     * The dispatcher for Behat hooks.
     *
     * @var \Behat\Testwork\Hook\HookDispatcher
     */
    protected $dispatcher;

    /**
     * The service that references the Behat test environment.
     *
     * @var EnvironmentContainer
     */
    protected $container;

    /**
     * The TableContext configuration array.
     *
     * @var array
     */
    protected $config;

    /**
     * Constructs a new TableAwareInitializer object.
     *
     * @param \Behat\Testwork\Hook\HookDispatcher $dispatcher
     *   The Behat hook dispatcher.
     * @param EnvironmentContainer $container
     *   The service that references the Behat test environment.
     * @param array $config
     *   The configuration for the extension, as defined in behat.yml.
     */
    public function __construct(HookDispatcher $dispatcher, EnvironmentContainer $container, array $config)
    {
        $this->dispatcher = $dispatcher;
        $this->container = $container;
        $this->config = $config;
    }

    /**
     * {@inheritdocs}
     */
    public function initializeContext(Context $context): void
    {
        if (!$context instanceof TableAwareInterface) {
            return;
        }
        $context->setDispatcher($this->dispatcher);
        $context->setEnvironmentContainer($this->container);
        $table_map = !empty($this->config['table_map']) ? $this->config['table_map'] : [];
        $context->setTableMap($table_map);
    }
}

Function Calls

None

Variables

None

Stats

MD5 6f60e712f46b0a0077fd05fb3da66fef
Eval Count 0
Decode Time 96 ms