@@ 81-88 (lines=8) @@ | ||
78 | ); |
|
79 | } |
|
80 | ||
81 | if (false == in_array($direction, array('asc', 'desc'))) |
|
82 | { |
|
83 | throw new \UnexpectedValueException( |
|
84 | sprintf( |
|
85 | '%1$s - direction field must be "asc" or "desc"', __METHOD__ |
|
86 | ) |
|
87 | ); |
|
88 | } |
|
89 | ||
90 | $path .= '?sort=' . $sort; |
|
91 | $path .= '&direction=' . $direction; |
@@ 67-70 (lines=4) @@ | ||
64 | // Sort direction default: when using full_name: asc, otherwise desc. |
|
65 | $direction = ($direction) ? : (('full_name' == $sort) ? 'asc' : 'desc'); |
|
66 | ||
67 | if (false == in_array($direction, array('asc', 'desc'))) |
|
68 | { |
|
69 | throw new \RuntimeException('Invalid sort order'); |
|
70 | } |
|
71 | ||
72 | // Build the request path. |
|
73 | $path = '/user/repos' |
|
@@ 114-117 (lines=4) @@ | ||
111 | // Sort direction default: when using full_name: asc, otherwise desc. |
|
112 | $direction = ($direction) ? : (('full_name' == $sort) ? 'asc' : 'desc'); |
|
113 | ||
114 | if (false == in_array($direction, array('asc', 'desc'))) |
|
115 | { |
|
116 | throw new \RuntimeException('Invalid sort order'); |
|
117 | } |
|
118 | ||
119 | // Build the request path. |
|
120 | $path = '/users/' . $user . '/repos' |