Code Duplication    Length = 16-16 lines in 2 locations

src/Parser/Internal/AbstractCommandDocBlockParser.php 1 location

@@ 137-152 (lines=16) @@
134
     * Store the data from a @default annotation in our argument or option store,
135
     * as appropriate.
136
     */
137
    protected function processDefaultTag($tag)
138
    {
139
        if (!$this->pregMatchNameAndDescription((string)$tag->getDescription(), $match)) {
140
            return;
141
        }
142
        $variableName = $match['name'];
143
        $defaultValue = $this->interpretDefaultValue($match['description']);
144
        if ($this->commandInfo->arguments()->exists($variableName)) {
145
            $this->commandInfo->arguments()->setDefaultValue($variableName, $defaultValue);
146
            return;
147
        }
148
        $variableName = $this->commandInfo->findMatchingOption($variableName);
149
        if ($this->commandInfo->options()->exists($variableName)) {
150
            $this->commandInfo->options()->setDefaultValue($variableName, $defaultValue);
151
        }
152
    }
153
154
    /**
155
     * Store the data from a @usage annotation in our example usage list.

src/Parser/Internal/BespokeDocBlockParser.php 1 location

@@ 97-112 (lines=16) @@
94
     * Store the data from a @default annotation in our argument or option store,
95
     * as appropriate.
96
     */
97
    protected function processDefaultTag($tag)
98
    {
99
        if (!$this->pregMatchNameAndDescription((string)$tag->getContent(), $match)) {
100
            return;
101
        }
102
        $variableName = $match['name'];
103
        $defaultValue = $this->interpretDefaultValue($match['description']);
104
        if ($this->commandInfo->arguments()->exists($variableName)) {
105
            $this->commandInfo->arguments()->setDefaultValue($variableName, $defaultValue);
106
            return;
107
        }
108
        $variableName = $this->commandInfo->findMatchingOption($variableName);
109
        if ($this->commandInfo->options()->exists($variableName)) {
110
            $this->commandInfo->options()->setDefaultValue($variableName, $defaultValue);
111
        }
112
    }
113
114
    /**
115
     * Store the data from a @usage annotation in our example usage list.