Skip to content

Commit bb638a6

Browse files
author
dereuromark
committed
Fix typehints.
1 parent 04a5b7d commit bb638a6

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/Model/Behavior/SluggedBehavior.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ public function resetSlugs($params = []) {
384384
* @return void
385385
*/
386386
protected function _multiSlug(Entity $entity) {
387-
extract($this->_config);
387+
$label = $this->config('label');
388388
$field = current($label);
389389
$fields = (array)$entity->get($field);
390390

@@ -396,10 +396,10 @@ protected function _multiSlug(Entity $entity) {
396396
$res = $this->generateSlug($field[$locale], $entity);
397397
}
398398
}
399-
//$this->beforeRules($entity);
399+
400400
$locale[$locale] = $res;
401401
}
402-
$entity->set($slugField, $locale);
402+
$entity->set($this->config('slugField'), $locale);
403403
}
404404

405405
/**

src/Model/Table/TokensTable.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,14 @@ class TokensTable extends Table {
6868
/**
6969
* Stores new key in DB
7070
*
71+
* Checks if this key is already used (should be unique in table)
72+
*
7173
* @param string $type Type: necessary
7274
* @param string|null $key Key: optional key, otherwise a key will be generated
7375
* @param mixed|null $uid Uid: optional (if used, only this user can use this key)
7476
* @param string|array|null $content Content: up to 255 characters of content may be added (optional)
75-
* NOW: checks if this key is already used (should be unique in table)
76-
* @return string key on SUCCESS, boolean false otherwise
77+
*
78+
* @return string|bool Key on success, boolean false otherwise
7779
*/
7880
public function newKey($type, $key = null, $uid = null, $content = null) {
7981
if (!$type) {
@@ -118,7 +120,7 @@ public function newKey($type, $key = null, $uid = null, $content = null) {
118120
* @param string $key : necessary
119121
* @param mixed|null $uid : needs to be provided if this key has a user_id stored
120122
* @param bool $treatUsedAsInvalid
121-
* @return array|false Content - if successfully used or if already used (used=1), FALSE else
123+
* @return \Cake\ORM\Entity|false Content - if successfully used or if already used (used=1), FALSE else
122124
*/
123125
public function useKey($type, $key, $uid = null, $treatUsedAsInvalid = false) {
124126
if (!$type || !$key) {
@@ -128,7 +130,7 @@ public function useKey($type, $key, $uid = null, $treatUsedAsInvalid = false) {
128130
if ($uid) {
129131
$options['conditions'][$this->alias() . '.user_id'] = $uid;
130132
}
131-
$res = $this->find('first', $options);
133+
$res = $this->find('all', $options)->first();
132134
if (!$res) {
133135
return false;
134136
}

src/Shell/InflectShell.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ protected function _getMethod() {
138138
/**
139139
* Requests words to inflect
140140
*
141-
* @return array
141+
* @return string|null
142142
*/
143143
protected function _getWords() {
144144
$words = null;

0 commit comments

Comments
 (0)