⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.144
Server IP:
157.245.143.252
Server:
Linux www 6.11.0-9-generic #9-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 14 13:19:59 UTC 2024 x86_64
Server Software:
nginx/1.26.0
PHP Version:
8.3.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
php
/
Composer
/
Package
/
Loader
/
View File Name :
JsonLoader.php
* Jordi Boggiano
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Package\Loader; use Composer\Json\JsonFile; use Composer\Package\BasePackage; use Composer\Package\CompletePackage; use Composer\Package\CompleteAliasPackage; use Composer\Package\RootPackage; use Composer\Package\RootAliasPackage; /** * @author Konstantin Kudryashiv
*/ class JsonLoader { /** @var LoaderInterface */ private $loader; public function __construct(LoaderInterface $loader) { $this->loader = $loader; } /** * @param string|JsonFile $json A filename, json string or JsonFile instance to load the package from * @return CompletePackage|CompleteAliasPackage|RootPackage|RootAliasPackage */ public function load($json): BasePackage { if ($json instanceof JsonFile) { $config = $json->read(); } elseif (file_exists($json)) { $config = JsonFile::parseJson(file_get_contents($json), $json); } elseif (is_string($json)) { $config = JsonFile::parseJson($json); } else { throw new \InvalidArgumentException(sprintf( "JsonLoader: Unknown \$json parameter %s. Please report at https://github.com/composer/composer/issues/new.", gettype($json) )); } return $this->loader->load($config); } }