Skip to content

Commit be00157

Browse files
committed
Use PHP 7.1 type declarations.
1 parent db77904 commit be00157

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: php
22
php:
3-
- '7.0'
43
- '7.1'
4+
- '7.2'
55
- nightly
66

77
install:

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"phing/phing": "^2.0.0"
1414
},
1515
"require": {
16-
"php": ">=7.0.0",
17-
"setbased/helper-code-store": "^1.2.0"
16+
"php": ">=7.1.0",
17+
"setbased/helper-code-store": "^2.0.0"
1818
},
1919
"autoload": {
2020
"psr-4": {
@@ -27,6 +27,6 @@
2727
}
2828
},
2929
"config": {
30-
"bin-dir": "bin"
30+
"bin-dir": "bin/"
3131
}
3232
}

src/PhpCodeStore.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?php
2-
//----------------------------------------------------------------------------------------------------------------------
2+
33
namespace SetBased\Helper\CodeStore;
44

5-
//----------------------------------------------------------------------------------------------------------------------
65
/**
76
* A helper class for automatically generating PHP code with proper indentation.
87
*/
@@ -18,7 +17,7 @@ class PhpCodeStore extends CodeStore
1817
* @since 1.0.0
1918
* @api
2019
*/
21-
public function __construct($indentation = 2, $width = 120)
20+
public function __construct(int $indentation = 2, int $width = 120)
2221
{
2322
parent::__construct($indentation, $width);
2423

@@ -29,7 +28,7 @@ public function __construct($indentation = 2, $width = 120)
2928
/**
3029
* {@inheritdoc}
3130
*/
32-
protected function indentationMode($line)
31+
protected function indentationMode(string $line): int
3332
{
3433
$mode = 0;
3534

test/CodeStoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
//----------------------------------------------------------------------------------------------------------------------
2+
33
namespace SetBased\Helper\CodeStore\Test;
44

55
use PHPUnit\Framework\TestCase;

0 commit comments

Comments
 (0)