@@ -1,6 +1,6 @@ |
||
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 |
@@ -1,6 +1,6 @@ |
||
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 |
@@ -1,6 +1,6 @@ |
||
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 |
@@ -1,6 +1,6 @@ |
||
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 |
@@ -1,6 +1,6 @@ |
||
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 |
@@ -1,6 +1,6 @@ |
||
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 |
@@ -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 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $Uploads = TableRegistry::get('ImageUploader.Uploads'); |
34 | 34 | $upload = $Uploads->get(1); |
35 | 35 | |
36 | - $file = new File(Configure::read('Saito.Settings.uploadDirectory') . $upload->get('name')); |
|
36 | + $file = new File(Configure::read('Saito.Settings.uploadDirectory').$upload->get('name')); |
|
37 | 37 | $raw = (new SimpleImage()) |
38 | 38 | ->fromNew(500, 500, 'blue') |
39 | 39 | ->toString($upload->get('type')); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | Plugin::configureCache(); // cache isn't bootstraped through request yet |
45 | 45 | $this->assertFalse(Cache::read($upload->get('id'), Plugin::CACHE_KEY)); |
46 | 46 | |
47 | - $this->get('/api/v2/uploads/thumb/1?h=' . $upload->get('hash')); |
|
47 | + $this->get('/api/v2/uploads/thumb/1?h='.$upload->get('hash')); |
|
48 | 48 | |
49 | 49 | $cache = Cache::read($upload->get('id'), Plugin::CACHE_KEY); |
50 | 50 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $this->assertSame(300, imagesx($image)); |
53 | 53 | $this->assertSame(300, imagesy($image)); |
54 | 54 | $this->assertSame($upload->get('type'), $cache['type']); |
55 | - $this->assertResponseEquals($cache['raw'], (string)$this->_response->getBody()); |
|
55 | + $this->assertResponseEquals($cache['raw'], (string) $this->_response->getBody()); |
|
56 | 56 | $this->assertHeader('content-type', 'image/png'); |
57 | 57 | |
58 | 58 | //// cleanup |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $Uploads = TableRegistry::get('ImageUploader.Uploads'); |
72 | 72 | $upload = $Uploads->get(1); |
73 | 73 | |
74 | - $file = new File(Configure::read('Saito.Settings.uploadDirectory') . $upload->get('name')); |
|
74 | + $file = new File(Configure::read('Saito.Settings.uploadDirectory').$upload->get('name')); |
|
75 | 75 | $raw = (new SimpleImage()) |
76 | 76 | ->fromNew(100, 100, 'blue') |
77 | 77 | ->toString($upload->get('type')); |
@@ -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 |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function thumb(): Response |
37 | 37 | { |
38 | - $id = (int)$this->request->getParam('id'); |
|
39 | - ['hash' => $fingerprint, 'type' => $type, 'raw' => $raw] = Cache::remember((string)$id, function () use ($id) { |
|
38 | + $id = (int) $this->request->getParam('id'); |
|
39 | + ['hash' => $fingerprint, 'type' => $type, 'raw' => $raw] = Cache::remember((string) $id, function() use ($id) { |
|
40 | 40 | $Uploads = $this->loadModel('ImageUploader.Uploads'); |
41 | 41 | $document = $Uploads->get($id); |
42 | 42 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | return compact('hash', 'raw', 'type'); |
56 | 56 | }, Plugin::CACHE_KEY); |
57 | 57 | |
58 | - $hash = (string)$this->request->getQuery('h'); |
|
58 | + $hash = (string) $this->request->getQuery('h'); |
|
59 | 59 | if ($hash !== $fingerprint) { |
60 | 60 | throw new SaitoForbiddenException( |
61 | 61 | "Attempt to access image-thumbnail $id." |
@@ -1,6 +1,6 @@ |
||
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 |