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\Core\DataProvider;
/**
* @author Beau Simensen <[email protected]>
*/
class DataProviderManager
{
/**
* Data providers
*
* @var array
*/
protected $dataProviders = [];
public function registerDataProvider(string $name, DataProviderInterface $dataProvider): void
{
$this->dataProviders[$name] = $dataProvider;
}
/**
* List of registered data provider names.
*
* @return string[]
*/
public function dataProviders(): array
{
return array_keys($this->dataProviders);
}
/**
* Get a data provider by name.
*
* @throws \InvalidArgumentException
*/
public function dataProvider(string $name): DataProviderInterface
{
if (isset($this->dataProviders[$name])) {
return $this->dataProviders[$name];
}
throw new \InvalidArgumentException(sprintf(
"Requested data provider '%s' could not be found; does the content type exist, or provider not specified?",
$name
));
}
}
?>
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\Core\DataProvider;
/**
* @author Beau Simensen <[email protected]>
*/
class DataProviderManager
{
/**
* Data providers
*
* @var array
*/
protected $dataProviders = [];
public function registerDataProvider(string $name, DataProviderInterface $dataProvider): void
{
$this->dataProviders[$name] = $dataProvider;
}
/**
* List of registered data provider names.
*
* @return string[]
*/
public function dataProviders(): array
{
return array_keys($this->dataProviders);
}
/**
* Get a data provider by name.
*
* @throws \InvalidArgumentException
*/
public function dataProvider(string $name): DataProviderInterface
{
if (isset($this->dataProviders[$name])) {
return $this->dataProviders[$name];
}
throw new \InvalidArgumentException(sprintf(
"Requested data provider '%s' could not be found; does the content type exist, or provider not specified?",
$name
));
}
}
Function Calls
None |
Stats
MD5 | 7df06f4b83e33473d11fd93d98edf178 |
Eval Count | 0 |
Decode Time | 98 ms |