. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Server IP : 172.67.165.3 / Your IP :
3.15.8.144 [
Web Server : LiteSpeed System : Linux altar63.supremepanel63.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : abranoticias ( 1103) PHP Version : 8.0.30 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/abranoticias/public_html/wp-content/plugins/anti-spam/libs/api-client/ |
Upload File : |
<?php namespace WBCR\Titan\Client; use ReflectionClass; /** * Class Loader * @package WBCR\Titan\Client\Response * * @author Alexander Gorenkov <g.a.androidjc2@ya.ru> * @version 1.0.0 * @copyright (c) 2020 Creative Motion */ abstract class Loader { /** * @param array $data * * @return static */ public static function from_array( $data ) { $params = []; $reflect = new ReflectionClass( static::class ); $constructor = $reflect->getConstructor(); $phpDoc = $constructor->getDocComment(); $parameters = $constructor->getParameters(); foreach ( $parameters as $parameter ) { $pos = $parameter->getPosition(); $name = $parameter->getName(); if ( ! isset( $data[ $name ] ) ) { $params[ $pos ] = null; continue; } $pattern = "/@param ([\w\\\|]+) \\\${$name}/sm"; preg_match( $pattern, $phpDoc, $matches ); if ( ! isset( $matches[1] ) ) { $params[ $pos ] = $data[ $name ]; continue; } $type = $matches[1]; if ( stripos( $type, 'WBCR' ) === false ) { $params[ $pos ] = $data[ $name ]; continue; } $type = explode( '|', $type ); if ( ! isset( $type[0] ) ) { $params[ $pos ] = $data[ $name ]; continue; } if ( ! class_exists( $type[0] ) || ! method_exists( $type[0], 'from_array' ) ) { $params[ $pos ] = $data[ $name ]; continue; } $params[ $pos ] = $type[0]::from_array( $data[ $name ] ); } return new static( ...$params ); } }