PluginProbe
Assistant – Every Day Productivity Apps / 1.4.7
Assistant – Every Day Productivity Apps v1.4.7
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
← All changes | backend/src/System/Container/StandardReflector.php +51 -51 1.5.51.4.7 View file →
@@ -1,51 +1,51 @@
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 - if ( version_compare( PHP_VERSION, '8.0.0', '<' ) ) {
25 - return ( $reflectionClass = $param->getClass() )
26 - ? $reflectionClass->getName()
27 - : null;
28 - }
29 -
30 - $type = $param->getType();
31 -
32 - if ( 'ReflectionNamedType' === get_class( $type ) ) {
33 - $class = new \ReflectionClass( $type->getName() );
34 - return $class->getName();
35 - }
36 -
37 - return null;
38 - }
39 -
40 - public function getFunction( $functionName ) {
41 - return new \ReflectionFunction( $functionName );
42 - }
43 -
44 - public function getMethod( $classNameOrInstance, $methodName ) {
45 - $className = is_string( $classNameOrInstance )
46 - ? $classNameOrInstance
47 - : get_class( $classNameOrInstance );
48 -
49 - return new \ReflectionMethod( $className, $methodName );
50 - }
51 -}
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 + if ( version_compare( PHP_VERSION, '8.0.0', '<' ) ) {
25 + return ( $reflectionClass = $param->getClass() )
26 + ? $reflectionClass->getName()
27 + : null;
28 + }
29 +
30 + $type = $param->getType();
31 +
32 + if ( 'ReflectionNamedType' === get_class( $type ) ) {
33 + $class = new \ReflectionClass( $type->getName() );
34 + return $class->getName();
35 + }
36 +
37 + return null;
38 + }
39 +
40 + public function getFunction( $functionName ) {
41 + return new \ReflectionFunction( $functionName );
42 + }
43 +
44 + public function getMethod( $classNameOrInstance, $methodName ) {
45 + $className = is_string( $classNameOrInstance )
46 + ? $classNameOrInstance
47 + : get_class( $classNameOrInstance );
48 +
49 + return new \ReflectionMethod( $className, $methodName );
50 + }
51 +}