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 /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@..
Decoded Output download
<?php
/*
* 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 Symfony\Bridge\PsrHttpMessage\Tests\Fixtures;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UploadedFileInterface;
/**
* @author Kvin Dunglas <[email protected]>
*/
class UploadedFile implements UploadedFileInterface
{
public function __construct(
private readonly string $filePath,
private readonly ?int $size = null,
private readonly int $error = \UPLOAD_ERR_OK,
private readonly ?string $clientFileName = null,
private readonly ?string $clientMediaType = null,
) {
}
public function getStream(): StreamInterface
{
return new Stream(file_get_contents($this->filePath));
}
public function moveTo($targetPath): void
{
rename($this->filePath, $targetPath);
}
public function getSize(): ?int
{
return $this->size;
}
public function getError(): int
{
return $this->error;
}
public function getClientFilename(): ?string
{
return $this->clientFileName;
}
public function getClientMediaType(): ?string
{
return $this->clientMediaType;
}
}
?>
Did this file decode correctly?
Original Code
<?php
/*
* 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 Symfony\Bridge\PsrHttpMessage\Tests\Fixtures;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UploadedFileInterface;
/**
* @author Kvin Dunglas <[email protected]>
*/
class UploadedFile implements UploadedFileInterface
{
public function __construct(
private readonly string $filePath,
private readonly ?int $size = null,
private readonly int $error = \UPLOAD_ERR_OK,
private readonly ?string $clientFileName = null,
private readonly ?string $clientMediaType = null,
) {
}
public function getStream(): StreamInterface
{
return new Stream(file_get_contents($this->filePath));
}
public function moveTo($targetPath): void
{
rename($this->filePath, $targetPath);
}
public function getSize(): ?int
{
return $this->size;
}
public function getError(): int
{
return $this->error;
}
public function getClientFilename(): ?string
{
return $this->clientFileName;
}
public function getClientMediaType(): ?string
{
return $this->clientMediaType;
}
}
Function Calls
None |
Stats
MD5 | 710510ab521958da2b8cbd0713b9f197 |
Eval Count | 0 |
Decode Time | 103 ms |