name = $name; $this->if = $if; $this->then = $then; $this->dependencies = $dependencies; } /** * @since 3.0 * * @return string */ public function getName() { return $this->name; } /** * @since 3.0 * * @return [] */ public function getDependencies() { return $this->dependencies; } /** * @note < 7.1 unexpected 'if' (T_IF), expecting identifier (T_STRING) ... * * @since 3.0 * * @return [] */ public function when( $key = null ) { if ( $key === null ) { return $this->if; } if ( isset( $this->if[$key] ) ) { return $this->if[$key]; } return []; } /** * @since 3.0 * * @return [] */ public function then( $key = null ) { if ( $key === null ) { return $this->then; } if ( isset( $this->then[$key] ) ) { return $this->then[$key]; } return []; } }