mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 09:31:51 +01:00
Regex > createSlug() method > returns slug for given value
This commit is contained in:
@@ -48,6 +48,7 @@ class MimeTypesTest extends BaseTestCase
|
||||
2. [Collection of elements](Collection-of-elements.md)
|
||||
3. [Exceptions](Exceptions.md)
|
||||
4. [Static methods](Static-methods.md)
|
||||
1. [Regex](Static-methods/Regex.md)
|
||||
5. [Value Objects](Value-Objects.md)
|
||||
|
||||
[‹ Back to `Readme`](../README.md)
|
||||
|
||||
@@ -46,6 +46,7 @@ var_dump($simpleCollection->has('dolor')); // bool(true)
|
||||
2. [**Collection of elements**](Collection-of-elements.md)
|
||||
3. [Exceptions](Exceptions.md)
|
||||
4. [Static methods](Static-methods.md)
|
||||
1. [Regex](Static-methods/Regex.md)
|
||||
5. [Value Objects](Value-Objects.md)
|
||||
|
||||
[‹ Back to `Readme`](../README.md)
|
||||
|
||||
@@ -57,6 +57,7 @@ class UnknownSimpleTypeException extends UnknownTypeException
|
||||
2. [Collection of elements](Collection-of-elements.md)
|
||||
3. [**Exceptions**](Exceptions.md)
|
||||
4. [Static methods](Static-methods.md)
|
||||
1. [Regex](Static-methods/Regex.md)
|
||||
5. [Value Objects](Value-Objects.md)
|
||||
|
||||
[‹ Back to `Readme`](../README.md)
|
||||
|
||||
@@ -19,6 +19,7 @@ var_dump($firstElement); // string(5) "lorem"
|
||||
2. [Collection of elements](Collection-of-elements.md)
|
||||
3. [Exceptions](Exceptions.md)
|
||||
4. [**Static methods**](Static-methods.md)
|
||||
1. [Regex](Static-methods/Regex.md)
|
||||
5. [Value Objects](Value-Objects.md)
|
||||
|
||||
[‹ Back to `Readme`](../README.md)
|
||||
|
||||
44
docs/Static-methods/Regex.md
Normal file
44
docs/Static-methods/Regex.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Meritoo Common Library
|
||||
|
||||
Common and useful classes, methods, exceptions etc.
|
||||
|
||||
# Regex
|
||||
|
||||
*Useful methods related to regular expressions*
|
||||
|
||||
Class: `Meritoo\Common\Utilities\Regex`
|
||||
File: `src/Utilities/Regex.php`
|
||||
|
||||
### createSlug($value)
|
||||
|
||||
*Returns slug for given value*
|
||||
|
||||
##### Arguments
|
||||
|
||||
- `string $value` - Value that should be transformed to slug
|
||||
|
||||
##### Example 1
|
||||
|
||||
- value: non-scalar or `null`
|
||||
- result: `false`
|
||||
|
||||
##### Example 2
|
||||
|
||||
- value: `""` (an empty string)
|
||||
- result: `""` (an empty string)
|
||||
|
||||
##### Example 3
|
||||
|
||||
- value: `"Lorem ipsum. Dolor sit 12.34 amet."`
|
||||
- result: `"lorem-ipsum-dolor-sit-1234-amet"`
|
||||
|
||||
# More
|
||||
|
||||
1. [Base test case (with common methods and data providers)](../Base-test-case.md)
|
||||
2. [Collection of elements](../Collection-of-elements.md)
|
||||
3. [Exceptions](../Exceptions.md)
|
||||
4. [Static methods](../Static-methods.md)
|
||||
1. [**Regex**](../Static-methods/Regex.md)
|
||||
5. [Value Objects](../Value-Objects.md)
|
||||
|
||||
[‹ Back to `Readme`](../../README.md)
|
||||
@@ -48,6 +48,7 @@ New instance can be created using:
|
||||
2. [Collection of elements](Collection-of-elements.md)
|
||||
3. [Exceptions](Exceptions.md)
|
||||
4. [Static methods](Static-methods.md)
|
||||
1. [Regex](Static-methods/Regex.md)
|
||||
5. [**Value Objects**](Value-Objects.md)
|
||||
|
||||
[‹ Back to `Readme`](../README.md)
|
||||
|
||||
Reference in New Issue
Block a user