Skip to content

Commit 5045b00

Browse files
committed
Boyscouting
1 parent 5eccda2 commit 5045b00

File tree

12 files changed

+36
-28
lines changed

12 files changed

+36
-28
lines changed

src/FaqOff/Endpoints/Admin/Authors.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Soatok\FaqOff\Endpoints\Admin;
44

55
use Interop\Container\Exception\ContainerException;
6-
use ParagonIE\Ionizer\InvalidDataException;
76
use Psr\Http\Message\{
87
RequestInterface,
98
ResponseInterface

src/FaqOff/Endpoints/Admin/CustomContent.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
RuntimeError,
2020
SyntaxError
2121
};
22+
2223
/**
2324
* Class CustomContent
2425
* @package Soatok\FaqOff\Endpoints\Admin

src/FaqOff/Endpoints/Admin/Settings.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Soatok\FaqOff\Endpoints\Admin;
44

55
use Interop\Container\Exception\ContainerException;
6-
use ParagonIE\Ionizer\InvalidDataException;
76
use Psr\Http\Message\{
87
RequestInterface,
98
ResponseInterface
@@ -37,7 +36,6 @@ class Settings extends BackendEndpoint
3736
* @param string $file
3837
* @return ResponseInterface
3938
* @throws ContainerException
40-
* @throws InvalidDataException
4139
* @throws LoaderError
4240
* @throws RuntimeError
4341
* @throws SyntaxError
@@ -87,7 +85,6 @@ protected function editFile(
8785
* @param array $routerParams
8886
* @return ResponseInterface
8987
* @throws ContainerException
90-
* @throws InvalidDataException
9188
* @throws LoaderError
9289
* @throws RuntimeError
9390
* @throws SyntaxError

src/FaqOff/Endpoints/Admin/Themes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
ResponseInterface
99
};
1010
use Slim\Container;
11+
use Soatok\FaqOff\BackendEndpoint;
1112
use Soatok\FaqOff\Filter\{
1213
CreateThemeFilter,
1314
EditThemeFilter
1415
};
15-
use Soatok\FaqOff\BackendEndpoint;
1616
use Soatok\FaqOff\MessageOnceTrait;
1717
use Soatok\FaqOff\Splices\Themes as ThemeSplice;
1818
use Twig\Error\{

src/FaqOff/Endpoints/GenericError.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
declare(strict_types=1);
33
namespace Soatok\FaqOff\Endpoints;
44

5-
use Psr\Http\Message\RequestInterface;
6-
use Psr\Http\Message\ResponseInterface;
5+
use Psr\Http\Message\{
6+
RequestInterface,
7+
ResponseInterface
8+
};
79
use Slim\Http\Request;
810
use Soatok\FaqOff\FrontendEndpoint;
911
use Soatok\FaqOff\MessageOnceTrait;

src/FaqOff/Endpoints/HomePage.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,22 @@
33
namespace Soatok\FaqOff\Endpoints;
44

55
use Interop\Container\Exception\ContainerException;
6-
use Psr\Http\Message\RequestInterface;
7-
use Psr\Http\Message\ResponseInterface;
6+
use Psr\Http\Message\{
7+
RequestInterface,
8+
ResponseInterface
9+
};
810
use Slim\Container;
9-
use Soatok\AnthroKit\Endpoint;
1011
use Soatok\FaqOff\FrontendEndpoint;
1112
use Soatok\FaqOff\MessageOnceTrait;
12-
use Soatok\FaqOff\Splices\Authors;
13-
use Soatok\FaqOff\Splices\Notices;
14-
use Twig\Error\LoaderError;
15-
use Twig\Error\RuntimeError;
16-
use Twig\Error\SyntaxError;
13+
use Soatok\FaqOff\Splices\{
14+
Authors,
15+
Notices
16+
};
17+
use Twig\Error\{
18+
LoaderError,
19+
RuntimeError,
20+
SyntaxError
21+
};
1722

1823
/**
1924
* Class HomePage

src/FaqOff/Endpoints/Manage/AJAX.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
namespace Soatok\FaqOff\Endpoints\Manage;
44

55
use League\CommonMark\CommonMarkConverter;
6-
use Psr\Http\Message\RequestInterface;
7-
use Psr\Http\Message\ResponseInterface;
6+
use Psr\Http\Message\{
7+
RequestInterface,
8+
ResponseInterface
9+
};
810
use Slim\Http\StatusCode;
911
use Soatok\FaqOff\BackendEndpoint;
1012
use Soatok\FaqOff\Filter\ContributorAjaxFilter;

src/FaqOff/Endpoints/Manage/Author.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
ResponseInterface
99
};
1010
use Slim\Container;
11+
use Soatok\FaqOff\BackendEndpoint;
1112
use Soatok\FaqOff\Filter\{
1213
CreateAuthorFilter,
1314
CreateCollectionFilter,
1415
EditAuthorFilter
1516
};
16-
use Soatok\FaqOff\BackendEndpoint;
1717
use Soatok\FaqOff\MessageOnceTrait;
1818
use Soatok\FaqOff\Splices\{
1919
Authors,

src/FaqOff/Endpoints/Manage/Entries.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ protected function createEntry(
115115
$post['attach-to'] ?? [],
116116
$post['index-me'],
117117
$post['question_box'],
118-
$question['questionid'] ?? null
118+
$question['questionid'] ?? null,
119+
!empty($post['opengraph_image_url'])
120+
? $post['opengraph_image_url']
121+
: null
119122
);
120123
if ($newEntryId) {
121124
$this->messageOnce('Entry created successfully', 'success');

src/FaqOff/Endpoints/Manage/Invite.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
};
1717
use Soatok\FaqOff\BackendEndpoint;
1818
use Soatok\FaqOff\MessageOnceTrait;
19-
use Soatok\FaqOff\Splices\Accounts;
2019

2120
/**
2221
* Class Invite

src/FaqOff/Splices/Entry.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public function countHit(
101101
* @param bool $indexMe
102102
* @param bool $allowQuestions
103103
* @param int|null $questionId
104+
* @param string|null $opengraphImageUrl
104105
* @return int|null
105106
* @throws \Exception
106107
*/
@@ -112,7 +113,8 @@ public function create(
112113
array $attachTo,
113114
bool $indexMe = false,
114115
bool $allowQuestions = false,
115-
?int $questionId = null
116+
?int $questionId = null,
117+
?string $opengraphImageUrl = null
116118
): ?int {
117119
$now = (new \DateTime())->format(\DateTime::ISO8601);
118120
$newEntryId = $this->db->insertGet(
@@ -126,9 +128,7 @@ public function create(
126128
'modified' => $now,
127129
'contents' => $contents,
128130
'uniqueid' => Base32::encode(random_bytes(20)),
129-
'opengraph_image_url' => !empty($postData['opengraph_image_url'])
130-
? $postData['opengraph_image_url']
131-
: null,
131+
'opengraph_image_url' => $opengraphImageUrl,
132132
'allow_questions' => $allowQuestions,
133133
],
134134
'entryid'
@@ -492,8 +492,8 @@ public function update(int $entryId, array $post): bool
492492
'options' => json_encode($options),
493493
'modified' => (new \DateTime())
494494
->format(\DateTime::ISO8601),
495-
'opengraph_image_url' => !empty($postData['opengraph_image_url'])
496-
? $postData['opengraph_image_url']
495+
'opengraph_image_url' => !empty($post['opengraph_image_url'])
496+
? $post['opengraph_image_url']
497497
: null,
498498
'allow_questions' => $post['question_box']
499499
],

src/FaqOff/Splices/EntryCollection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public function create(int $authorId, array $data): ?int
4545
'theme' => $data['theme'] < 1 ? null : $data['theme'],
4646
'title' => $data['title'],
4747
'url' => $url,
48-
'opengraph_image_url' => !empty($postData['opengraph_image_url'])
49-
? $postData['opengraph_image_url']
48+
'opengraph_image_url' => !empty($data['opengraph_image_url'])
49+
? $data['opengraph_image_url']
5050
: null,
5151
'allow_questions' => $data['question_box']
5252
],

0 commit comments

Comments
 (0)