_orderConfig = $orderConfig; } /** * @return array */ public function toOptionArray() { $state = $this->getState(); $statuses = $this->_orderConfig->getStateStatuses([$state]); $options = [ [ 'value' => '', 'label' => __('Use Magento\'s default status') ] ]; foreach ($statuses as $code => $label) { $options[] = [ 'value' => $code, 'label' => $label ]; } return $options; } }