Skip to content

Commit a71fa62

Browse files
committed
Merge remote-tracking branch 'origin/0.2.x-merge-up-into-0.3.x_JAA0MMnJ' into 0.3.x
# Conflicts: # CHANGELOG.md
2 parents 794709d + 748ddf6 commit a71fa62

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@ All notable changes to this project will be documented in this file, in reverse
2424

2525
- Nothing.
2626

27+
## 0.2.1 - 2021-09-17
28+
29+
30+
-----
31+
32+
### Release Notes for [0.2.1](https://github.com/open-code-modeling/php-filter/milestone/7)
33+
34+
0.2.x bugfix release (patch)
35+
36+
### 0.2.1
37+
38+
- Total issues resolved: **1**
39+
- Total pull requests resolved: **0**
40+
- Total contributors: **1**
41+
42+
#### bug
43+
44+
- [18: Support separator slash](https://github.com/open-code-modeling/php-filter/issues/18) thanks to @sandrokeil
45+
2746
## 0.2.0 - 2021-07-27
2847

2948

src/Filter/NormalizeLabel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ public function __invoke(string $value): string
2929
// Strip multi-spaces and tabs with a single space
3030
$normalizedName = \preg_replace(['/\s{2,}/', '/[\t\n]/'], ' ', $normalizedName);
3131

32-
return \trim($normalizedName);
32+
return \trim(\trim($normalizedName), '/');
3333
}
3434
}

src/FilterFactory.php

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public static function snakeCaseFilter(): callable
4949
new Filter\StringToLower(),
5050
new Filter\Word\SeparatorToSeparator(' ', '_'),
5151
new Filter\Word\SeparatorToSeparator('-', '_'),
52+
new Filter\Word\SeparatorToSeparator('/', '_'),
5253
);
5354
}
5455

@@ -65,6 +66,7 @@ public static function camelCaseFilter(): callable
6566
new Filter\StringToLower(),
6667
new Filter\Word\UnderscoreToCamelCase(),
6768
new Filter\Word\SeparatorToSeparator(' ', '-'),
69+
new Filter\Word\SeparatorToSeparator('/', '-'),
6870
new Filter\Word\DashToCamelCase()
6971
)
7072
);
@@ -83,6 +85,7 @@ public static function pascalCaseFilter(): callable
8385
new Filter\StringToLower(),
8486
new Filter\Word\UnderscoreToCamelCase(),
8587
new Filter\Word\SeparatorToSeparator(' ', '-'),
88+
new Filter\Word\SeparatorToSeparator('/', '-'),
8689
new Filter\Word\DashToCamelCase()
8790
)
8891
);
@@ -109,6 +112,7 @@ public static function constantNameFilter(): callable
109112
new Filter\Word\CamelCaseToUnderscore(),
110113
new Filter\Word\SeparatorToSeparator(' ', '_'),
111114
new Filter\Word\SeparatorToSeparator('-', '_'),
115+
new Filter\Word\SeparatorToSeparator('/', '_'),
112116
new Filter\StringToUpper()
113117
);
114118
}

tests/FilterFactoryTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public function providerForLabel(): Generator
2727
yield 'add-building' => ['add-building'];
2828
yield 'addBuilding' => ['addBuilding'];
2929
yield 'AddBuilding' => ['AddBuilding'];
30+
yield 'Add/Building' => ['Add/Building'];
31+
yield '/Add/Building/' => ['/Add/Building/'];
3032
yield ' Add Building ' => [' Add Building '];
3133
yield 'Add building ' => ['Add building '];
3234
yield 'Add BUILDING ' => ['Add BUILDING '];

0 commit comments

Comments
 (0)