Skip to content

Commit 969291d

Browse files
authored
Merge pull request #474 from kbsali/464-strict-types
declare strict_types in all files
2 parents 9e16d0e + 98f41f3 commit 969291d

145 files changed

Lines changed: 328 additions & 31 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
'@PER-CS3x0' => true,
1515
'@PER-CS3x0:risky' => true,
1616
'@PHPUnit100Migration:risky' => true,
17+
'declare_strict_types' => true,
1718
'linebreak_after_opening_tag' => true,
1819
'ordered_imports' => true,
1920
'no_empty_phpdoc' => true,

src/Redmine/Api.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Redmine;
46

57
/**

src/Redmine/Api/AbstractApi.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Redmine\Api;
46

57
use InvalidArgumentException;

src/Redmine/Api/Attachment.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Redmine\Api;
46

57
use Redmine\Client\Client;

src/Redmine/Api/CustomField.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Redmine\Api;
46

57
use Redmine\Client\Client;
@@ -149,7 +151,7 @@ public function listing($forceUpdate = false, array $params = [])
149151
{
150152
@trigger_error('`' . __METHOD__ . '()` is deprecated since v2.7.0, use `' . self::class . '::listNames()` instead.', E_USER_DEPRECATED);
151153

152-
return $this->doListing($forceUpdate, $params);
154+
return $this->doListing((bool) $forceUpdate, $params);
153155
}
154156

155157
/**

src/Redmine/Api/Group.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Redmine\Api;
46

57
use Redmine\Client\Client;
@@ -275,7 +277,7 @@ public function remove($id)
275277
{
276278
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
277279
'DELETE',
278-
'/groups/' . $id . '.xml',
280+
'/groups/' . strval($id) . '.xml',
279281
));
280282

281283
return $this->lastResponse->getContent();
@@ -295,7 +297,7 @@ public function addUser($id, $userId)
295297
{
296298
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
297299
'POST',
298-
'/groups/' . $id . '/users.xml',
300+
'/groups/' . strval($id) . '/users.xml',
299301
XmlSerializer::createFromArray(['user_id' => $userId])->getEncoded(),
300302
));
301303

@@ -322,7 +324,7 @@ public function removeUser($id, $userId)
322324
{
323325
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
324326
'DELETE',
325-
'/groups/' . $id . '/users/' . $userId . '.xml',
327+
'/groups/' . strval($id) . '/users/' . strval($userId) . '.xml',
326328
));
327329

328330
return $this->lastResponse->getContent();

src/Redmine/Api/Issue.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Redmine\Api;
46

57
use Redmine\Client\Client;

src/Redmine/Api/IssueCategory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Redmine\Api;
46

57
use Redmine\Client\Client;
@@ -175,7 +177,7 @@ public function listing($project, $forceUpdate = false)
175177
{
176178
@trigger_error('`' . __METHOD__ . '()` is deprecated since v2.7.0, use `' . self::class . '::listNamesByProject()` instead.', E_USER_DEPRECATED);
177179

178-
return $this->doListing($project, $forceUpdate);
180+
return $this->doListing($project, (bool) $forceUpdate);
179181
}
180182

181183
/**

src/Redmine/Api/IssuePriority.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Redmine\Api;
46

57
use Redmine\Client\Client;

src/Redmine/Api/IssueRelation.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Redmine\Api;
46

57
use Redmine\Client\Client;

0 commit comments

Comments
 (0)