示例#1
0
 /**
  * Returns the path mapping states selected in the console arguments.
  *
  * @param Args $args The console arguments.
  *
  * @return int[] The selected {@link PathMappingState} constants.
  */
 private function getPathMappingStates(Args $args)
 {
     $states = array(PathMappingState::ENABLED => 'enabled', PathMappingState::NOT_FOUND => 'not-found', PathMappingState::CONFLICT => 'conflict');
     $states = array_filter($states, function ($option) use($args) {
         return $args->isOptionSet($option);
     });
     return array_keys($states) ?: PathMappingState::all();
 }
示例#2
0
 /**
  * Returns the path mapping states selected in the console arguments.
  *
  * @param Args $args The console arguments.
  *
  * @return int[] The selected {@link PathMappingState} constants.
  */
 private function getPathMappingStates(Args $args)
 {
     $states = array();
     if ($args->isOptionSet('enabled')) {
         $states[] = PathMappingState::ENABLED;
     }
     if ($args->isOptionSet('not-found')) {
         $states[] = PathMappingState::NOT_FOUND;
     }
     if ($args->isOptionSet('conflict')) {
         $states[] = PathMappingState::CONFLICT;
     }
     return $states ?: PathMappingState::all();
 }