Skip to content

Commit e13dead

Browse files
authored
Merge pull request #81 from chadicus/master
Add filter alias for Strings::concat
2 parents eb71cdd + ded5a64 commit e13dead

5 files changed

Lines changed: 194 additions & 275 deletions

File tree

.scrutinizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ build_failure_conditions:
1919
- 'elements.rating(< C).new.exists'
2020
- 'issues.label("coding-style").new.exists'
2121
- 'issues.severity(>= MAJOR).new.exists'
22-
- 'project.metric("scrutinizer.quality", < 6.37)'
22+
- 'project.metric("scrutinizer.quality", < 6.8)'

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,13 @@ The following checks that `$value` is a non-empty string.
224224
\TraderInteractive\Filter\Strings::filter($value);
225225
```
226226

227+
#### Strings::concat
228+
Aliased in the filterer as `concat`, this filter concatenates the given $value, $prefix and $suffix and returns the resulting string.
229+
```php
230+
$value = \TraderInteractive\Filter\Strings::concat('middle', 'begining_', '_end');
231+
assert($value === 'begining_middle_end');
232+
```
233+
227234
#### Strings::explode
228235
Aliased in the filterer as `explode`, this filter is essentially a wrapper around the built-in [`explode`](http://www.php.net/explode) method
229236
with the value first in order to work with the `Filterer`. It also defaults to using `,` as a delimiter. For example:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"traderinteractive/filter-dates": "^3.0",
3636
"traderinteractive/filter-floats": "^3.0",
3737
"traderinteractive/filter-ints": "^3.0",
38-
"traderinteractive/filter-strings": "^3.1"
38+
"traderinteractive/filter-strings": "^3.2.0"
3939
},
4040
"require-dev": {
4141
"php-coveralls/php-coveralls": "^1.0",

src/Filterer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ final class Filterer
1919
'arrayize' => '\\TraderInteractive\\Filter\\Arrays::arrayize',
2020
'bool' => '\\TraderInteractive\\Filter\\Booleans::filter',
2121
'bool-convert' => '\\TraderInteractive\\Filter\\Booleans::convert',
22+
'concat' => '\\TraderInteractive\\Filter\\Strings::concat',
2223
'date' => '\\TraderInteractive\\Filter\\DateTime::filter',
2324
'date-format' => '\\TraderInteractive\\Filter\\DateTime::format',
2425
'email' => '\\TraderInteractive\\Filter\\Email::filter',

0 commit comments

Comments
 (0)