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); /* * This file is part of the Symfony package. * * (c)..

Decoded Output download

<?php

declare(strict_types=1);

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sculpin\Core\Console\Command;

use Sculpin\Bundle\SculpinBundle\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * @author Fabien Potencier <[email protected]>
 */
abstract class ContainerAwareCommand extends Command implements ContainerAwareInterface
{
    /**
     * @var ContainerInterface
     */
    private $container;

    /**
     * @return ContainerInterface
     *
     * @throws \RuntimeException    if the expected Sculpin Console Application instance could not be found
     */
    protected function getContainer(): ContainerInterface
    {
        if (null === $this->container) {
            $app = $this->getApplication();

            if (!$app instanceof Application) {
                throw new \RuntimeException('Sculpin Application not found!');
            }

            $this->container = $app->getKernel()->getContainer();
        }

        return $this->container;
    }

    /**
     * Set Container.
     *
     * @param ContainerInterface $container Container
     *
     * @see ContainerAwareInterface::setContainer()
     */
    public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sculpin\Core\Console\Command;

use Sculpin\Bundle\SculpinBundle\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * @author Fabien Potencier <[email protected]>
 */
abstract class ContainerAwareCommand extends Command implements ContainerAwareInterface
{
    /**
     * @var ContainerInterface
     */
    private $container;

    /**
     * @return ContainerInterface
     *
     * @throws \RuntimeException    if the expected Sculpin Console Application instance could not be found
     */
    protected function getContainer(): ContainerInterface
    {
        if (null === $this->container) {
            $app = $this->getApplication();

            if (!$app instanceof Application) {
                throw new \RuntimeException('Sculpin Application not found!');
            }

            $this->container = $app->getKernel()->getContainer();
        }

        return $this->container;
    }

    /**
     * Set Container.
     *
     * @param ContainerInterface $container Container
     *
     * @see ContainerAwareInterface::setContainer()
     */
    public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
    }
}

Function Calls

None

Variables

None

Stats

MD5 5c26a3132bf504a0e4e9d8ce2b5a954b
Eval Count 0
Decode Time 83 ms