refactor: add phpstan and update code to adhere to level 5

- move and refactor Image.php from Libraries to Entities folder
- update some database field names
/ types
- update composer packages
This commit is contained in:
Yassine Doghri 2021-05-12 14:00:25 +00:00
commit 231d578d64
No known key found for this signature in database
GPG key ID: 3E7F89498B960C9F
148 changed files with 11189 additions and 11421 deletions

View file

@ -8,15 +8,14 @@
namespace ActivityPub\Controllers;
use ActivityPub\Entities\Actor;
use ActivityPub\Config\ActivityPub;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Exceptions\PageNotFoundException;
use ActivityPub\Entities\Note;
use CodeIgniter\HTTP\Exceptions\HTTPException;
use ActivityPub\Objects\OrderedCollectionObject;
use ActivityPub\Objects\OrderedCollectionPage;
use App\Entities\Actor;
use CodeIgniter\Controller;
use CodeIgniter\I18n\Time;
@ -325,13 +324,10 @@ class ActorController extends Controller
// parse activityPub id to get actor and domain
// check if actor and domain exist
try {
if ($parts = split_handle($this->request->getPost('handle'))) {
extract($parts);
$data = get_webfinger_data($username, $domain);
}
} catch (HTTPException $httpException) {
if (
!($parts = split_handle($this->request->getPost('handle'))) ||
!($data = get_webfinger_data($parts['username'], $parts['domain']))
) {
return redirect()
->back()
->withInput()