ACIL FM
Dark
Refresh
Current DIR:
/home/mhhtmff/www/site/wp-content/plugins/otgs-installer-plugin/fp/core/traits
/
home
mhhtmff
www
site
wp-content
plugins
otgs-installer-plugin
fp
core
traits
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
Curryable.php
2.38 MB
chmod
View
DL
Edit
Rename
Delete
Edit file: /home/mhhtmff/www/site/wp-content/plugins/otgs-installer-plugin/fp/core/traits/Curryable.php
<?php namespace WPML\INSTALLER\FP; use BadMethodCallException; use Closure; trait Curryable { /** * The registered string curried methods. * * @var string[] */ protected static $curried = []; /** * Register a custom curried function. * * @param string $name * @param int $argCount * @param callable $fn * * @return void */ public static function curryN( $name, $argCount, callable $fn ) { static::$curried[ $name ] = [ $argCount, $fn ]; } /** * Checks if curried function is registered. * * @param string $name * * @return bool */ public static function hasCurry( $name ) { return isset( static::$curried[ $name ] ); } /** * Dynamically handle calls to the class. * * @param string $method * @param mixed[] $parameters * * @return mixed * * @throws \BadMethodCallException */ public static function __callStatic( $method, $parameters ) { if ( ! static::hasCurry( $method ) ) { throw new BadMethodCallException( "Method {$method} does not exist." ); } if ( static::$curried[ $method ][1] instanceof Closure ) { return call_user_func_array( self::curryItStaticCall( ...static::$curried[ $method ] ), $parameters ); } return call_user_func_array( static::$curried[ $method ][1], $parameters ); } /** * Dynamically handle calls to the class. * * @param string $method * @param mixed[] $parameters * * @return mixed * * @throws \BadMethodCallException */ public function __call( $method, $parameters ) { throw new BadMethodCallException( "Curryable does not support methods in object scope. This is a limitation of PHP 5.x." ); if ( ! static::hasCurry( $method ) ) { throw new BadMethodCallException( "Method {$method} does not exist." ); } if ( static::$curried[ $method ][1] instanceof Closure ) { return call_user_func_array( $this->curryItCall( ...self::$curried[ $method ] ), $parameters ); } return call_user_func_array( static::$curried[ $method ][1], $parameters ); } /** * @param int $count * @param \Closure $fn * * @return \Closure */ private function curryItCall( $count, Closure $fn ) { return curryN( $count, $fn->bindTo( $this, static::class ) ); } /** * @param int $count * @param \Closure $fn * * @return \Closure */ private static function curryItStaticCall( $count, Closure $fn ) { return curryN( $count, Closure::bind( $fn, null, static::class ) ); } }
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply