Code Duplication    Length = 6-6 lines in 2 locations

src/ServiceClient.php 2 locations

@@ 92-97 (lines=6) @@
89
    {
90
        // Modify provided callbacks to track results.
91
        $results = [];
92
        $options['fulfilled'] = function ($v, $k) use (&$results, $options) {
93
            if (isset($options['fulfilled'])) {
94
                $options['fulfilled']($v, $k);
95
            }
96
            $results[$k] = $v;
97
        };
98
        $options['rejected'] = function ($v, $k) use (&$results, $options) {
99
            if (isset($options['rejected'])) {
100
                $options['rejected']($v, $k);
@@ 98-103 (lines=6) @@
95
            }
96
            $results[$k] = $v;
97
        };
98
        $options['rejected'] = function ($v, $k) use (&$results, $options) {
99
            if (isset($options['rejected'])) {
100
                $options['rejected']($v, $k);
101
            }
102
            $results[$k] = $v;
103
        };
104
105
        // Execute multiple commands synchronously, then sort and return the results.
106
        return $this->executeAllAsync($commands, $options)