Skip to content
GitLab
    • Explore Projects Groups Topics Snippets
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • fusiondirectory-integrator fusiondirectory-integrator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • fusiondirectoryfusiondirectory
  • fusiondirectory-integratorfusiondirectory-integrator
  • Merge requests
  • !40
An error occurred while fetching the assigned milestone of the selected merge_request.

Resolve "[Integrator] - Refactor of current logic and creation of fusiondirectory library."

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged dockx thibault requested to merge 30-integrator-refactor-of-current-logic-and-creation-of-fusiondirectory-library into dev 1 year ago
  • Overview 0
  • Commits 12
  • Pipelines 13
  • Changes 1

Related to #30 (closed)

Viewing commit d7bdf596
Prev Next
Show latest version
1 file
+ 25
− 8

    Preferences

    File browser
    Compare changes
  • Verified
    d7bdf596
    dockx thibault
    :sparkles: feat(Integrator) - refactor 5 · d7bdf596
    dockx thibault authored 11 months ago
    Refactor 5
src/FusionDirectory/Cli/Application.php
+ 25
− 8
  • View file @ d7bdf596

  • Edit in single-file editor

  • Open in Web IDE


@@ -66,12 +66,13 @@ class Application
}
/**
* Parse arguments
* @param array<string> $argv
* @param array $argv
* @param int $optind
* @return void
*/
protected function parseArgs (array $argv, int $optind): void
{
//
// optind comes from setopt method, counting the matches in existing options and arguments passed. If not equals, print usage.
if ((count($argv) - $optind) != count($this->args)) {
$this->usage($argv);
}
@@ -93,7 +94,7 @@ class Application
/**
* @return string
* Note : This method is used to format the available options in children applications.
* Note : This method is used to format the available options in children applications. Create short formats.
* This class is responsible to output the helpers info and thus receive options from children.
*/
protected function generateShortOptions (): string
@@ -157,6 +158,8 @@ class Application
* @param $option
* @param $getopt
* @return void
* Logic is that every options that are matched by an arguments will have an incremental int increased from zero.
* This allows to have a final array of arguments (validated) on which we can work on to execute related functions.
*/
private function handleShortOptions ($key, $option, &$getopt) : void
{
@@ -172,6 +175,13 @@ class Application
}
}
/**
* @param $key
* @param $option
* @param $getopt
* @return void
* Note : This method, like the handleShortOptions - incremented the integer. Arguments requiring data.
*/
private function processNonValueOption ($key, $option, &$getopt): void
{
if (!isset($getopt[$key])) {
@@ -186,6 +196,13 @@ class Application
$this->handleShortOptions($key, $option, $getopt);
}
/**
* @param $key
* @param $option
* @param $getopt
* @return void
* Note : Method which process arguments requiring data input. (See processNonValueOption for non data arguments).
*/
private function processValueOption ($key, $option, &$getopt): void
{
$key = substr($key, 0, -1);
@@ -240,10 +257,10 @@ class Application
}
/**
* Parse options and arguments from $argv
* @param array<string> $argv
*
* @return array<string,mixed>
* @param array $argv
* @return array
* Note : This is the main method to verify arguments passed and generated a final array which summarize valid arguments
* passed.
*/
protected function parseOptionsAndArgs (array $argv): array
{
Assignee
dockx thibault's avatar
dockx thibault
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 Participants
Reference:
Source branch: 30-integrator-refactor-of-current-logic-and-creation-of-fusiondirectory-library

Menu

Explore Projects Groups Topics Snippets