Skip to content

Commit

Permalink
update: up the dep toolkit/stdlib to 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Nov 30, 2021
1 parent a8dfd71 commit c9581db
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.0] # 7.2, 7.3,
php: [8.0, 8.1] # 7.2, 7.3,
os: [ubuntu-latest, macOS-latest] # windows-latest,
# include: # will not testing on php 7.2
# - os: 'ubuntu-latest'
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,6 @@ jobs:
php kite.phar git cl prev last --style gh-release --no-merges --fetch-tags --unshallow --file changelog.md
cat changelog.md
# https://github.com/meeDamian/github-release
# - name: Create release and upload assets
# uses: meeDamian/github-release@2.0
# with:
# gzip: false
# token: ${{ secrets.GITHUB_TOKEN }}
# tag: ${{ env.RELEASE_TAG }}
# name: ${{ env.RELEASE_TAG }}
# body: |
# ${{ steps.changelog.outputs.CHLOGBODY }}
# files: kite-${{ env.RELEASE_TAG }}.phar

# https://github.com/softprops/action-gh-release
- name: Create release and upload assets
uses: softprops/action-gh-release@v1
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ composer require phppkg/ini

example ini:

```text
```ini
; comments line
// comments line
# comments line
Expand All @@ -44,19 +44,19 @@ multi-line = '''
this is
a multi
line string
'''
'''

# simple inline list array
inlineList = [ab, 23, 34.5]

# simple multi-line list array, equals the 'simpleList'
# simple multi-line list array, equals the 'simpleList1'
simpleList[] = 567
simpleList[] = "some value"

# simple multi-line list array
[simpleList1]
[] = 567
[] = "some value"
- = 567
- = "some value"

# simple k-v map
[simpleMap]
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"require": {
"php": ">8.0",
"ext-mbstring": "*",
"toolkit/stdlib":"~1.0"
"toolkit/stdlib":"~2.0"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions src/IniParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ protected function collectValue(string $key, mixed $val): void
// in section. eg: [arrayName] -> $sectionName='arrayName'
$section = $this->sectionName;

// is list array value. eg `[] = "arr_elem_one"`
if ($key === '[]') {
// is list array value. eg `- = "arr_elem_one"` `[] = "arr_elem_one"`
if ($key === '-' || $key === '[]') {
if (!isset($this->data[$section]) || !is_array($this->data[$section])) {
$this->data[$section] = [];
}
Expand Down
4 changes: 2 additions & 2 deletions test/IniParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ public function testParseIni_full(): void
# simple inline list array
inlineList = [ab, 23, 34.5]
# simple multi-line list array, equals the 'simpleList'
# simple multi-line list array, equals the 'simpleList1'
simpleList[] = 567
simpleList[] = "some value"
# simple multi-line list array
[simpleList1]
[] = 567
[] = "some value"
- = "some value"
# simple k-v map
[simpleMap]
Expand Down
4 changes: 2 additions & 2 deletions test/IniTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ abstract class IniTestCase extends TestCase
* $ret = $rftMth->invokeArgs($obj, $invokeArgs);
* ```
*
* @param string|object $class
* @param object|string $class
* @param string $method
*
* @return ReflectionMethod
* @throws ReflectionException
*/
protected static function getMethod($class, string $method): ReflectionMethod
protected static function getMethod(object|string $class, string $method): ReflectionMethod
{
$refMth = new ReflectionMethod($class, $method);
$refMth->setAccessible(true);
Expand Down
Empty file removed test/testdata/.keep
Empty file.

0 comments on commit c9581db

Please sign in to comment.