File tree Expand file tree Collapse file tree 1 file changed +26
-6
lines changed
src/Application/View/Extension Expand file tree Collapse file tree 1 file changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -87,10 +87,11 @@ public function phpConfig(string $name)
8787 */
8888 public function call (string $ callable , array $ parameters = [])
8989 {
90- if (is_callable ($ callable )) {
91- return call_user_func_array ($ callable , $ parameters );
90+ if (!is_callable ($ callable )) {
91+ \trigger_error (sprintf ('Invalid callable `%s`. ' , $ callable ), E_USER_WARNING );
92+ return null ;
9293 }
93- return null ;
94+ return call_user_func_array ( $ callable , $ parameters ) ;
9495 }
9596
9697 /**
@@ -103,10 +104,29 @@ public function call(string $callable, array $parameters = [])
103104 */
104105 public function getStatic ($ class , string $ property )
105106 {
106- if ((is_object ($ class ) || class_exists ($ class )) && property_exists ($ class , $ property )) {
107- return $ class ::$ $ property ;
107+ if (!is_object ($ class ) && !class_exists ($ class )) {
108+ \trigger_error (
109+ sprintf (
110+ 'Invalid class or object `%s`. ' ,
111+ \is_string ($ class ) ? $ class : \get_debug_type ($ class )
112+ ),
113+ E_USER_WARNING
114+ );
115+ return null ;
108116 }
109- return null ;
117+ if (!property_exists ($ class , $ property )) {
118+ \trigger_error (
119+ sprintf (
120+ 'Invalid property `%s::%s. ' ,
121+ \is_string ($ class ) ? $ class : \get_debug_type ($ class ),
122+ $ property
123+ ),
124+ E_USER_WARNING
125+ );
126+ return null ;
127+ }
128+
129+ return $ class ::$ $ property ;
110130 }
111131
112132 /**
You can’t perform that action at this time.
0 commit comments