1 | <?php |
||
31 | class SessionAwareCommand extends PommAwareCommand |
||
32 | { |
||
33 | private $session; |
||
34 | |||
35 | protected $config_name; |
||
36 | |||
37 | /** |
||
38 | * execute |
||
39 | * |
||
40 | * Set pomm dependent variables. |
||
41 | * |
||
42 | * @see Command |
||
43 | */ |
||
44 | protected function execute(InputInterface $input, OutputInterface $output) |
||
49 | |||
50 | /** |
||
51 | * configureRequiredArguments |
||
52 | * |
||
53 | * In order to keep the same argument order for all commands, it is |
||
54 | * necessary to be able to declare base required fields before subcommands. |
||
55 | * |
||
56 | * @access protected |
||
57 | * @return PommAwareCommand $this |
||
58 | */ |
||
59 | protected function configureRequiredArguments() |
||
71 | |||
72 | /** |
||
73 | * getSession |
||
74 | * |
||
75 | * Return a session. |
||
76 | * |
||
77 | * @access protected |
||
78 | * @return Session |
||
79 | */ |
||
80 | protected function getSession() |
||
92 | |||
93 | /** |
||
94 | * mustBeModelManagerSession |
||
95 | * |
||
96 | * Check if a session is a \PommProject\ModelManager\Session. |
||
97 | * |
||
98 | * @access protected |
||
99 | * @param Session $session |
||
100 | * @throws GeneratorException |
||
101 | * @return Session |
||
102 | */ |
||
103 | protected function mustBeModelManagerSession(Session $session) |
||
116 | |||
117 | /** |
||
118 | * setSession |
||
119 | * |
||
120 | * When testing, it is useful to provide directly the session to be used. |
||
121 | * |
||
122 | * @access public |
||
123 | * @param Session $session |
||
124 | * @return PommAwareCommand |
||
125 | */ |
||
126 | public function setSession(Session $session) |
||
132 | } |
||
133 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.