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 a part of Sculpin. * * (c) Dragonfly..

Decoded Output download

<?php

declare(strict_types=1);

/*
 * This file is a part of Sculpin.
 *
 * (c) Dragonfly Development Inc.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sculpin\Bundle\ContentTypesBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Reference;

class MapPass implements CompilerPassInterface
{
    public function process(ContainerBuilder $container): void
    {
        $typesId = self::generateId('types');
        $types = $container->getParameter($typesId);

        foreach ($types as $type) {
            $mapId = self::generateTypesId($type, 'map');

            if (false === $container->hasDefinition($mapId)) {
                continue;
            }

            $definition = $container->getDefinition($mapId);

            foreach ($container->findTaggedServiceIds($mapId) as $id => $tagAttributes) {
                foreach ($tagAttributes as $attributes) {
                    $definition->addMethodCall('addMap', [new Reference($id)]);
                }
            }
        }
    }

    private static function generateId(string $value): string
    {
        return implode('.', ['sculpin_content_types', $value]);
    }

    private static function generateTypesId(string $type, string $value): string
    {
        return implode('.', ['sculpin_content_types.types', $type, $value]);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

/*
 * This file is a part of Sculpin.
 *
 * (c) Dragonfly Development Inc.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sculpin\Bundle\ContentTypesBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Reference;

class MapPass implements CompilerPassInterface
{
    public function process(ContainerBuilder $container): void
    {
        $typesId = self::generateId('types');
        $types = $container->getParameter($typesId);

        foreach ($types as $type) {
            $mapId = self::generateTypesId($type, 'map');

            if (false === $container->hasDefinition($mapId)) {
                continue;
            }

            $definition = $container->getDefinition($mapId);

            foreach ($container->findTaggedServiceIds($mapId) as $id => $tagAttributes) {
                foreach ($tagAttributes as $attributes) {
                    $definition->addMethodCall('addMap', [new Reference($id)]);
                }
            }
        }
    }

    private static function generateId(string $value): string
    {
        return implode('.', ['sculpin_content_types', $value]);
    }

    private static function generateTypesId(string $type, string $value): string
    {
        return implode('.', ['sculpin_content_types.types', $type, $value]);
    }
}

Function Calls

None

Variables

None

Stats

MD5 894232569b276b9d74c0de554744d08f
Eval Count 0
Decode Time 68 ms