File tree Expand file tree Collapse file tree 6 files changed +27
-9
lines changed Expand file tree Collapse file tree 6 files changed +27
-9
lines changed Original file line number Diff line number Diff line change 4
4
5
5
- Updated for Laravel 7.
6
6
7
+ ### v9.0.1 - 2020-03-06
8
+
9
+ ` FIXED `
10
+
11
+ - Regression on the getter and setter for the custom slug generator.
12
+
7
13
### v9.0.0 - 2019-08-30
8
14
9
15
- BC Break: PHP 7.2 is the minimum required PHP version
Original file line number Diff line number Diff line change @@ -61,18 +61,18 @@ public static function setTagsModel(string $model): void;
61
61
/**
62
62
* Returns the slug generator.
63
63
*
64
- * @return string
64
+ * @return \Closure| string
65
65
*/
66
- public static function getSlugGenerator (): string ;
66
+ public static function getSlugGenerator ();
67
67
68
68
/**
69
69
* Sets the slug generator.
70
70
*
71
- * @param string $name
71
+ * @param \Closure| string $name
72
72
*
73
73
* @return void
74
74
*/
75
- public static function setSlugGenerator (string $ name ): void ;
75
+ public static function setSlugGenerator ($ name ): void ;
76
76
77
77
/**
78
78
* Returns the entity Eloquent tag model object.
Original file line number Diff line number Diff line change @@ -82,15 +82,15 @@ public static function setTagsModel(string $model): void
82
82
/**
83
83
* {@inheritdoc}
84
84
*/
85
- public static function getSlugGenerator (): string
85
+ public static function getSlugGenerator ()
86
86
{
87
87
return static ::$ slugGenerator ;
88
88
}
89
89
90
90
/**
91
91
* {@inheritdoc}
92
92
*/
93
- public static function setSlugGenerator (string $ slugGenerator ): void
93
+ public static function setSlugGenerator ($ slugGenerator ): void
94
94
{
95
95
static ::$ slugGenerator = $ slugGenerator ;
96
96
}
Original file line number Diff line number Diff line change 11
11
* bundled with this package in the LICENSE file.
12
12
*
13
13
* @package Tags
14
- * @version 10.0.00
14
+ * @version 10.0.0
15
15
* @author Cartalyst LLC
16
16
* @license BSD License (3-clause)
17
17
* @copyright (c) 2011-2020, Cartalyst LLC
Original file line number Diff line number Diff line change 11
11
* bundled with this package in the LICENSE file.
12
12
*
13
13
* @package Tags
14
- * @version 10.0.00
14
+ * @version 10.0.0
15
15
* @author Cartalyst LLC
16
16
* @license BSD License (3-clause)
17
17
* @copyright (c) 2011-2020, Cartalyst LLC
Original file line number Diff line number Diff line change @@ -172,12 +172,24 @@ public function it_can_get_and_set_the_tags_model()
172
172
}
173
173
174
174
/** @test */
175
- public function it_can_get_and_set_the_slug_generator ()
175
+ public function it_can_get_and_set_the_slug_generator_as_a_string ()
176
176
{
177
177
$ post = new Post ();
178
178
179
179
$ post ->setSlugGenerator ('Illuminate\Support\Str::slug ' );
180
180
181
181
$ this ->assertSame ('Illuminate\Support\Str::slug ' , $ post ->getSlugGenerator ());
182
182
}
183
+
184
+ /** @test */
185
+ public function it_can_get_and_set_the_slug_generator_as_a_closure ()
186
+ {
187
+ $ post = new Post ();
188
+
189
+ $ post ->setSlugGenerator (function ($ value ) {
190
+ return str_replace (' ' , '_ ' , strtolower ($ value ));
191
+ });
192
+
193
+ $ this ->assertIsObject ($ post ->getSlugGenerator ());
194
+ }
183
195
}
You can’t perform that action at this time.
0 commit comments