File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11<?php namespace xp \lambda ;
22
3- use com \amazon \aws \lambda \{Environment , Context };
4- use lang \{XPClass , Throwable };
3+ use com \amazon \aws \lambda \{Context , Environment , Handler };
4+ use lang \{XPClass , Throwable , IllegalArgumentException };
55use util \UUID ;
66use util \cmd \Console ;
77
@@ -23,9 +23,14 @@ class RunLambda {
2323 * @param string $handler
2424 * @param string... $events
2525 * @throws lang.ClassLoadingException
26+ * @throws lang.IllegalArgumentException
2627 */
2728 public function __construct ($ handler = 'Handler ' , ... $ events ) {
2829 $ this ->impl = XPClass::forName ($ handler );
30+ if (!$ this ->impl ->isSubclassOf (Handler::class)) {
31+ throw new IllegalArgumentException ('Class ' .$ handler .' is not a lambda handler ' );
32+ }
33+
2934 $ this ->events = $ events ?: ['{} ' ];
3035 }
3136
You can’t perform that action at this time.
0 commit comments