Skip to content

Commit 1400eb9

Browse files
thunderernorberttech
authored andcommitted
upgraded thunderer/shortcode dependency to ^0.7 (#112)
1 parent 248710b commit 1400eb9

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ StringHumanizer::truncateHtml($text, 75, '<b><i><u><em><strong><a><span>', '...'
7272

7373
```
7474

75+
**Remove shortcodes**
76+
77+
```php
78+
$text = 'A text with [short]random[/short] [codes]words[/codes].';
79+
StringHumanizer::removeShortcodes($text); // "A text with ."
80+
StringHumanizer::removeShortcodeTags($text); // "A text with random words."
81+
```
82+
7583
## Number
7684

7785
**Ordinalize**

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"friendsofphp/php-cs-fixer": "^2.14"
2323
},
2424
"require-dev": {
25-
"thunderer/shortcode": "~0.5",
25+
"thunderer/shortcode": "^0.7",
2626
"phpspec/phpspec": "^2",
2727
"phpunit/phpunit": "^4.5|^5.0"
2828
},

src/Coduo/PHPHumanizer/StringHumanizer.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ public static function truncateHtml($text, $charactersCount, $allowedTags = '',
6060
*/
6161
public static function removeShortcodes($text)
6262
{
63-
if (!\class_exists('Thunder\Shortcode\Processor\Processor')) {
64-
throw new \RuntimeException('Please add "thunderer/shortcode": ~0.5 to composer.json first');
63+
if (!class_exists('Thunder\Shortcode\Processor\Processor')) {
64+
throw new \RuntimeException('Please add "thunderer/shortcode": ^0.7 to composer.json first');
6565
}
66-
66+
6767
$processor = new ShortcodeProcessor();
6868

6969
return $processor->removeShortcodes($text);
@@ -75,10 +75,10 @@ public static function removeShortcodes($text)
7575
*/
7676
public static function removeShortcodeTags($text)
7777
{
78-
if (!\class_exists('Thunder\Shortcode\Processor\Processor')) {
79-
throw new \RuntimeException('Please add "thunderer/shortcode": ~0.5 to composer.json first');
78+
if (!class_exists('Thunder\Shortcode\Processor\Processor')) {
79+
throw new \RuntimeException('Please add "thunderer/shortcode": ^0.7 to composer.json first');
8080
}
81-
81+
8282
$processor = new ShortcodeProcessor();
8383

8484
return $processor->removeShortcodeTags($text);

0 commit comments

Comments
 (0)