X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/restate/platform/core/js-validation/src/Support
home
/
gfecatvj
/
sites
/
restate
/
platform
/
core
/
js-validation
/
src
/
Support
/
📁
..
📄
AccessProtectedTrait.php
(1.28 KB)
📄
DelegatedValidator.php
(4.42 KB)
📄
RuleListTrait.php
(2.72 KB)
📄
UseDelegatedValidatorTrait.php
(653 B)
📄
ValidationRuleParserProxy.php
(1.49 KB)
Editing: AccessProtectedTrait.php
<?php namespace Botble\JsValidation\Support; use Closure; trait AccessProtectedTrait { /** * Gets inaccessible property. * * @param $instance * @param $property * @return Closure */ protected function getProtected($instance, $property) { $closure = function ($property) { return $this->$property; }; $callback = $closure->bindTo($instance, $instance); return $callback($property); } /** * Calls inaccessible method. * * @param object|Closure $instance * @param $method * @param $args * @return mixed */ protected function callProtected($instance, $method, $args = []) { if (!($instance instanceof Closure)) { $instance = $this->createProtectedCaller($instance); } return call_user_func($instance, $method, $args); } /** * Create closure to call inaccessible method. * * @param $instance * @return Closure */ protected function createProtectedCaller($instance) { $closure = function ($method, $args) { $callable = [$this, $method]; return call_user_func_array($callable, $args); }; return $closure->bindTo($instance, $instance); } }
Upload File
Create Folder