[Flow] getters for option arrays (Surf)

Martin Kutschker masi-20l4 at typo3.org
Sun Nov 2 14:47:21 CET 2014


Hi!

I found code like this:

public function getOption($key) {
   return $this->options[$key];
}

If you ask for an option that has not been set, PHP will issue a notice 
which in turn be changed by Flow into an exception. I know I can fiddle 
around with the PHP configs (and Flow configs?), but shouldn't be the 
code changed to avoid this?

A  simple solution:

public function getOption($key) {
   return isset ($this->options[$key]) ? $this->options[$key] : NULL;
}

Regards,
Masi

PS: I ran into this issue with Surf when I tried to "describe" a 
deployment for which I have forgotten to set the hostname.


More information about the Flow mailing list