Skip to content

Commit

Permalink
Update default arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Aug 1, 2017
1 parent 67c3e76 commit e4cbd96
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Model/Behavior/SlugBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,15 @@ public function findSlugged(Query $query, array $options)
*
* @param \Cake\ORM\Entity|string $entity Entity to create slug for
* @param string $string String to create slug for.
* @param string $separator Separator.
* @param string|null $separator Separator.
* @return string Slug.
*/
public function slug($entity, $string = null, $separator = '-')
public function slug($entity, $string = null, $separator = null)
{
if ($separator === null) {
$separator = $this->config('separator');
}

if (is_string($entity)) {
if ($string !== null) {
$separator = $string;
Expand Down Expand Up @@ -295,7 +299,7 @@ public function slug($entity, $string = null, $separator = '-')
* @param string $separator Separator.
* @return string Unique slug.
*/
protected function _uniqueSlug(Entity $entity, $slug, $separator = '-')
protected function _uniqueSlug(Entity $entity, $slug, $separator)
{
$primaryKey = $this->_table->primaryKey();
$field = $this->_table->aliasField($this->config('field'));
Expand Down

0 comments on commit e4cbd96

Please sign in to comment.