[TOOLS][CS-FIXER] Run new PHP CS Fixer config. Notably, adds strict_types

This commit is contained in:
2021-10-10 09:26:18 +01:00
committed by Diogo Peralta Cordeiro
parent 8ef2d3339f
commit 9109c61af5
327 changed files with 2246 additions and 2616 deletions

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types = 1);
namespace Plugin\ActivityPub\Util\Model\AS2ToEntity;
use App\Core\Event;
@@ -8,16 +10,12 @@ use App\Entity\Note;
use App\Util\Formatting;
use Component\FreeNetwork\Entity\FreenetworkActor;
use DateTime;
use Exception;
abstract class AS2ToNote
{
/**
* @param array $object
*
*@throws \Exception
*
* @return Note
*
*@throws Exception
*/
public static function translate(array $object, ?string $source = null): Note
{
@@ -27,7 +25,7 @@ abstract class AS2ToNote
'created' => new DateTime($object['published'] ?? 'now'),
'content' => $object['content'] ?? null,
'content_type' => 'text/html',
'url' => array_key_exists('url', $object) ? $object['url'] : $object['id'],
'url' => \array_key_exists('url', $object) ? $object['url'] : $object['id'],
'actor_id' => $actor_id,
'modified' => new DateTime(),
'source' => $source,
@@ -49,4 +47,4 @@ abstract class AS2ToNote
}
return $obj;
}
}
}