PluginProbe
Assistant – Every Day Productivity Apps / 0.3.1
Assistant – Every Day Productivity Apps v0.3.1
1.5.5 trunk 0.1.0 0.2.0 0.2.1 0.2.2 0.3.0 0.3.1 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.6.0 0.7.0 0.7.0.2 0.7.0.3 0.7.0.4 0.7.0.5 0.7.0.6 0.7.0.7 0.7.0.8 0.7.0.9 0.7.1 1.0 All 71 releases
assistant / backend / src / System / Container / StandardReflector.php

StandardReflector.php in Assistant – Every Day Productivity Apps 0.3.1, at backend/src/System/Container/StandardReflector.php

41 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FL\Assistant\System\Container;
4
5 class StandardReflector implements Reflector {
6
7 public function getClass( $class ) {
8 return new \ReflectionClass( $class );
9 }
10
11 public function getCtor( $class ) {
12 $reflectionClass = new \ReflectionClass( $class );
13
14 return $reflectionClass->getConstructor();
15 }
16
17 public function getCtorParams( $class ) {
18 return ( $reflectedCtor = $this->getCtor( $class ) )
19 ? $reflectedCtor->getParameters()
20 : null;
21 }
22
23 public function getParamTypeHint( \ReflectionFunctionAbstract $function, \ReflectionParameter $param ) {
24 return ( $reflectionClass = $param->getClass() )
25 ? $reflectionClass->getName()
26 : null;
27 }
28
29 public function getFunction( $functionName ) {
30 return new \ReflectionFunction( $functionName );
31 }
32
33 public function getMethod( $classNameOrInstance, $methodName ) {
34 $className = is_string( $classNameOrInstance )
35 ? $classNameOrInstance
36 : get_class( $classNameOrInstance );
37
38 return new \ReflectionMethod( $className, $methodName );
39 }
40 }
41