Skip to content

Commit 8363f95

Browse files
authored
Merge pull request KnpLabs#752 from acrobat/missing-has_projects-parameter
Added missing has_projects parameter to repo create
2 parents e54725e + efe3850 commit 8363f95

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/Github/Api/Repo.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ public function showById($id)
187187
* @param bool $hasDownloads `true` to enable downloads for this repository, `false` to disable them
188188
* @param int $teamId The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization.
189189
* @param bool $autoInit `true` to create an initial commit with empty README, `false` for no initial commit
190+
* @param bool $hasProjects `true` to enable projects for this repository or false to disable them.
190191
*
191192
* @return array returns repository data
192193
*/
@@ -200,7 +201,8 @@ public function create(
200201
$hasUncyclo = false,
201202
$hasDownloads = false,
202203
$teamId = null,
203-
$autoInit = false
204+
$autoInit = false,
205+
$hasProjects = true
204206
) {
205207
$path = null !== $organization ? '/orgs/'.$organization.'/repos' : '/user/repos';
206208

@@ -213,6 +215,7 @@ public function create(
213215
'has_wiki' => $hasUncyclo,
214216
'has_downloads' => $hasDownloads,
215217
'auto_init' => $autoInit,
218+
'has_projects' => $hasProjects,
216219
];
217220

218221
if ($organization && $teamId) {

test/Github/Tests/Api/RepoTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ public function shouldCreateRepositoryUsingNameOnly()
135135
'has_wiki' => false,
136136
'has_downloads' => false,
137137
'auto_init' => false,
138+
'has_projects' => true,
138139
])
139140
->will($this->returnValue($expectedArray));
140141

@@ -160,6 +161,7 @@ public function shouldCreateRepositoryForOrganization()
160161
'has_wiki' => false,
161162
'has_downloads' => false,
162163
'auto_init' => false,
164+
'has_projects' => true,
163165
])
164166
->will($this->returnValue($expectedArray));
165167

@@ -329,6 +331,7 @@ public function shouldCreateUsingAllParams()
329331
'has_wiki' => false,
330332
'has_downloads' => false,
331333
'auto_init' => false,
334+
'has_projects' => true,
332335
])
333336
->will($this->returnValue($expectedArray));
334337

0 commit comments

Comments
 (0)