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 Symplify\EasyCodingStandard\Configuration; use..

Decoded Output download

<?php

declare(strict_types=1);

namespace Symplify\EasyCodingStandard\Configuration;

use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;

final class InitPathsResolver
{
    /**
     * @return string[]
     */
    public function resolve(string $projectDirectory): array
    {
        $rootDirectoryFinder = Finder::create()
            ->directories()
            ->depth(0)
            // system files
            ->notPath('#(vendor|var|stubs|temp|templates|tmp|e2e|bin|build|database|storage|migrations)#')
            ->in($projectDirectory)
            ->sortByName();

        /** @var SplFileInfo[] $rootDirectoryFileInfos */
        $rootDirectoryFileInfos = iterator_to_array($rootDirectoryFinder);

        $projectDirectories = [];

        foreach ($rootDirectoryFileInfos as $rootDirectoryFileInfo) {
            if (! $this->hasDirectoryFileInfoPhpFiles($rootDirectoryFileInfo)) {
                continue;
            }

            $projectDirectories[] = $rootDirectoryFileInfo->getRelativePathname();
        }

        return $projectDirectories;
    }

    private function hasDirectoryFileInfoPhpFiles(SplFileInfo $rootDirectoryFileInfo): bool
    {
        // is directory with PHP files?
        $phpFilesFinder = Finder::create()
            ->files()
            ->in($rootDirectoryFileInfo->getPathname())
            ->name('*.php');

        return count($phpFilesFinder) !== 0;
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace Symplify\EasyCodingStandard\Configuration;

use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;

final class InitPathsResolver
{
    /**
     * @return string[]
     */
    public function resolve(string $projectDirectory): array
    {
        $rootDirectoryFinder = Finder::create()
            ->directories()
            ->depth(0)
            // system files
            ->notPath('#(vendor|var|stubs|temp|templates|tmp|e2e|bin|build|database|storage|migrations)#')
            ->in($projectDirectory)
            ->sortByName();

        /** @var SplFileInfo[] $rootDirectoryFileInfos */
        $rootDirectoryFileInfos = iterator_to_array($rootDirectoryFinder);

        $projectDirectories = [];

        foreach ($rootDirectoryFileInfos as $rootDirectoryFileInfo) {
            if (! $this->hasDirectoryFileInfoPhpFiles($rootDirectoryFileInfo)) {
                continue;
            }

            $projectDirectories[] = $rootDirectoryFileInfo->getRelativePathname();
        }

        return $projectDirectories;
    }

    private function hasDirectoryFileInfoPhpFiles(SplFileInfo $rootDirectoryFileInfo): bool
    {
        // is directory with PHP files?
        $phpFilesFinder = Finder::create()
            ->files()
            ->in($rootDirectoryFileInfo->getPathname())
            ->name('*.php');

        return count($phpFilesFinder) !== 0;
    }
}

Function Calls

None

Variables

None

Stats

MD5 3f43617ba01e8bf40b5d7b0adc7d94a9
Eval Count 0
Decode Time 103 ms