@@ -6,7 +6,6 @@ |
||
6 | 6 | use Cake\Database\Expression\QueryExpression; |
7 | 7 | use Cake\Event\Event; |
8 | 8 | use Cake\Event\EventManager; |
9 | -use Cake\ORM\Entity; |
|
10 | 9 | use Cake\ORM\Table; |
11 | 10 | use Saito\Event\SaitoEventManager; |
12 | 11 |
@@ -132,7 +132,7 @@ |
||
132 | 132 | */ |
133 | 133 | protected function _setting($name) |
134 | 134 | { |
135 | - $setting = Configure::read('Saito.Settings.' . $name); |
|
135 | + $setting = Configure::read('Saito.Settings.'.$name); |
|
136 | 136 | if ($setting !== null) { |
137 | 137 | return $setting; |
138 | 138 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | /** |
63 | 63 | * attaches event-listener |
64 | 64 | * |
65 | - * @param string|SaitoEventListener $key key |
|
65 | + * @param \Saito\Cache\EntriesCacheSupportCachelet $key key |
|
66 | 66 | * @param null $callable function if $key is set |
67 | 67 | * @return void |
68 | 68 | * @throws InvalidArgumentException |
@@ -55,7 +55,7 @@ |
||
55 | 55 | { |
56 | 56 | $data = ($event->getData()) ?: []; |
57 | 57 | $data += ['subject' => $event->getSubject()]; |
58 | - $name = 'Event.Saito.' . $event->getName(); |
|
58 | + $name = 'Event.Saito.'.$event->getName(); |
|
59 | 59 | $this->dispatch($name, $data); |
60 | 60 | } |
61 | 61 |
@@ -9,6 +9,7 @@ |
||
9 | 9 | { |
10 | 10 | /** |
11 | 11 | * {@inheritDoc} |
12 | + * @param string $type |
|
12 | 13 | */ |
13 | 14 | public function __construct($type = null, $data = []) |
14 | 15 | { |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function __construct($type = null, $data = []) |
14 | 14 | { |
15 | - $message = 'Request was blackholed. Type: ' . $type; |
|
15 | + $message = 'Request was blackholed. Type: '.$type; |
|
16 | 16 | $this->__Logger = new ExceptionLogger; |
17 | 17 | $this->__Logger->write($message, $data); |
18 | 18 | parent::__construct($message, 400); |
@@ -43,7 +43,7 @@ |
||
43 | 43 | /** |
44 | 44 | * Checks if answering an entry is allowed |
45 | 45 | * |
46 | - * @return bool |
|
46 | + * @return string|boolean |
|
47 | 47 | */ |
48 | 48 | public function isAnsweringForbidden() |
49 | 49 | { |
@@ -167,7 +167,7 @@ |
||
167 | 167 | { |
168 | 168 | if (!$this->isRoot()) { |
169 | 169 | throw new \RuntimeException( |
170 | - 'Posting with id ' . $this->get('id') . ' is no root posting.' |
|
170 | + 'Posting with id '.$this->get('id').' is no root posting.' |
|
171 | 171 | ); |
172 | 172 | } |
173 | 173 | if (!$this->_CurrentUser->get('last_refresh')) { |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Saito\Posting\Basic\BasicPostingInterface; |
6 | 6 | use Saito\Posting\Basic\BasicPostingTrait; |
7 | -use Saito\Posting\Decorator\PostingTrait; |
|
8 | 7 | use Saito\Posting\Decorator\UserPostingTrait; |
9 | 8 | use Saito\Thread\Thread; |
10 | 9 | use Saito\User\CurrentUser\CurrentUser; |
@@ -102,7 +102,7 @@ |
||
102 | 102 | { |
103 | 103 | $postings = []; |
104 | 104 | $this->map( |
105 | - function ($node) use (&$postings) { |
|
105 | + function($node) use (&$postings) { |
|
106 | 106 | $postings[$node->get('id')] = $node; |
107 | 107 | }, |
108 | 108 | false |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Saito\Smiley; |
4 | 4 | |
5 | 5 | use Cake\Cache\Cache; |
6 | -use Cake\Core\Configure; |
|
7 | 6 | use Cake\ORM\TableRegistry; |
8 | 7 | |
9 | 8 | class SmileyLoader |
@@ -21,7 +21,7 @@ |
||
21 | 21 | if ($this->_smilies !== null) { |
22 | 22 | return $this->_smilies; |
23 | 23 | } |
24 | - $this->_smilies = Cache::remember('Saito.Smilies.data', function () { |
|
24 | + $this->_smilies = Cache::remember('Saito.Smilies.data', function() { |
|
25 | 25 | $Smilies = TableRegistry::get('Smilies'); |
26 | 26 | $smiliesRaw = $Smilies->find() |
27 | 27 | ->contain(['SmileyCodes']) |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | /** |
29 | 29 | * Constructor |
30 | 30 | * |
31 | - * @param array $smileyData data |
|
31 | + * @param SmileyLoader $smileyData data |
|
32 | 32 | */ |
33 | 33 | public function __construct(SmileyLoader $smileyData) |
34 | 34 | { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | /** |
62 | 62 | * Set Helper |
63 | 63 | * |
64 | - * @param Helper $Helper helper |
|
64 | + * @param HtmlHelper $Helper helper |
|
65 | 65 | * @return self |
66 | 66 | */ |
67 | 67 | public function setHelper(HtmlHelper $Helper): self |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @param string $string string |
80 | 80 | * @param array $replacements replacements |
81 | - * @return mixed |
|
81 | + * @return string |
|
82 | 82 | */ |
83 | 83 | protected function _debug($string, $replacements) |
84 | 84 | { |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | { |
133 | 133 | $delimiter = '/'; |
134 | 134 | foreach ($codes['codes'] as $key => $code) { |
135 | - $codes['quoted'][$key] = $delimiter . |
|
135 | + $codes['quoted'][$key] = $delimiter. |
|
136 | 136 | // a smiley can't be concatenated to a string and requires a |
137 | 137 | // whitespace in front |
138 | - '(^|(?<=(\s)))' . |
|
139 | - preg_quote($code, $delimiter) . |
|
138 | + '(^|(?<=(\s)))'. |
|
139 | + preg_quote($code, $delimiter). |
|
140 | 140 | $delimiter; |
141 | 141 | } |
142 | 142 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | //= pixel image smileys |
168 | 168 | } else { |
169 | 169 | $replacements['html'][$k] = $this->HtmlHelper->image( |
170 | - 'smilies/' . $smiley['image'], |
|
170 | + 'smilies/'.$smiley['image'], |
|
171 | 171 | [ |
172 | 172 | 'alt' => $smiley['code'], |
173 | 173 | 'class' => 'saito-smiley-image', |
@@ -13,7 +13,6 @@ |
||
13 | 13 | namespace Saito\Test; |
14 | 14 | |
15 | 15 | use App\Test\Fixture\UserFixture; |
16 | - |
|
17 | 16 | use Cake\Core\Configure; |
18 | 17 | use Cake\Event\Event; |
19 | 18 | use Cake\Event\EventManager; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Saito - The Threaded Web Forum |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $Mock = $this->getMockForTableParent($table, $methods); |
130 | 130 | EventManager::instance()->on( |
131 | 131 | 'Controller.initialize', |
132 | - function (Event $event) use ($table, $Mock) { |
|
132 | + function(Event $event) use ($table, $Mock) { |
|
133 | 133 | $Controller = $event->getSubject(); |
134 | 134 | $Controller->{$table} = $Mock; |
135 | 135 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $this->configRequest([ |
154 | 154 | 'headers' => [ |
155 | 155 | 'Accept' => 'application/json', |
156 | - 'Authorization' => 'bearer ' . $jwtToken, |
|
156 | + 'Authorization' => 'bearer '.$jwtToken, |
|
157 | 157 | ] |
158 | 158 | ]); |
159 | 159 | } |
@@ -4,9 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Cake\ORM\Table; |
6 | 6 | use Cake\ORM\TableRegistry; |
7 | -use Saito\App\Registry; |
|
8 | 7 | use Saito\Test\SaitoTestCase; |
9 | -use Saito\User\SaitoUser; |
|
10 | 8 | |
11 | 9 | abstract class SaitoTableTestCase extends SaitoTestCase |
12 | 10 | { |