Set native property types

Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
This commit is contained in:
Michael Weimann 2022-12-15 19:50:56 +01:00
parent aff8826c99
commit b004f865b4
No known key found for this signature in database
GPG Key ID: 34F0524D4DA694A1
174 changed files with 548 additions and 781 deletions

View File

@ -8,6 +8,7 @@
<file>public/index.php</file>
<file>src</file>
<file>tests</file>
<exclude-pattern>/config/config.php</exclude-pattern>
<rule ref="PSR12" />
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
@ -31,5 +32,9 @@
<exclude-pattern>/includes</exclude-pattern>
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification" />
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
<exclude-pattern>/includes</exclude-pattern>
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" />
</rule>
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment" />
</ruleset>

View File

@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class AngelTypeFactory extends Factory
{
/** @var string */
protected $model = AngelType::class;
protected $model = AngelType::class; // phpcs:ignore
/**
* @return array

View File

@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class FaqFactory extends Factory
{
/** @var string */
protected $model = Faq::class;
protected $model = Faq::class; // phpcs:ignore
/**
* @return array

View File

@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class GroupFactory extends Factory
{
/** @var string */
protected $model = Group::class;
protected $model = Group::class; // phpcs:ignore
/**
* @return array

View File

@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class MessageFactory extends Factory
{
/** @var string */
protected $model = Message::class;
protected $model = Message::class; // phpcs:ignore
/**
* @return array

View File

@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class NewsCommentFactory extends Factory
{
/** @var string */
protected $model = NewsComment::class;
protected $model = NewsComment::class; // phpcs:ignore
/**
* @return array

View File

@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class NewsFactory extends Factory
{
/** @var string */
protected $model = News::class;
protected $model = News::class; // phpcs:ignore
/**
* @return array

View File

@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class PrivilegeFactory extends Factory
{
/** @var string */
protected $model = Privilege::class;
protected $model = Privilege::class; // phpcs:ignore
/**
* @return array

View File

@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class QuestionFactory extends Factory
{
/** @var string */
protected $model = Question::class;
protected $model = Question::class; // phpcs:ignore
/**
* @return array

View File

@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class RoomFactory extends Factory
{
/** @var string */
protected $model = Room::class;
protected $model = Room::class; // phpcs:ignore
/**
* @return array

View File

@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class ScheduleFactory extends Factory
{
/** @var string */
protected $model = Schedule::class;
protected $model = Schedule::class; // phpcs:ignore
/**
* @return array

View File

@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class ShiftTypeFactory extends Factory
{
/** @var string */
protected $model = ShiftType::class;
protected $model = ShiftType::class; // phpcs:ignore
/**
* @return array

View File

@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class ContactFactory extends Factory
{
/** @var string */
protected $model = Contact::class;
protected $model = Contact::class; // phpcs:ignore
/**
* @return array

View File

@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class LicenseFactory extends Factory
{
/** @var string */
protected $model = License::class;
protected $model = License::class; // phpcs:ignore
/**
* @return array

View File

@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class PasswordResetFactory extends Factory
{
/** @var string */
protected $model = PasswordReset::class;
protected $model = PasswordReset::class; // phpcs:ignore
/**
* @return array

View File

@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class PersonalDataFactory extends Factory
{
/** @var string */
protected $model = PersonalData::class;
protected $model = PersonalData::class; // phpcs:ignore
/**
* @return array

View File

@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class SettingsFactory extends Factory
{
/** @var string */
protected $model = Settings::class;
protected $model = Settings::class; // phpcs:ignore
/**
* @return array

View File

@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class StateFactory extends Factory
{
/** @var string */
protected $model = State::class;
protected $model = State::class; // phpcs:ignore
/**
* @return array

View File

@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class UserFactory extends Factory
{
/** @var string */
protected $model = User::class;
protected $model = User::class; // phpcs:ignore
/**
* @return array

View File

@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class UserAngelTypeFactory extends Factory
{
/** @var string */
protected $model = UserAngelType::class;
protected $model = UserAngelType::class; // phpcs:ignore
/**
* @return array

View File

@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class WorklogFactory extends Factory
{
/** @var string */
protected $model = Worklog::class;
protected $model = Worklog::class; // phpcs:ignore
/**
* @return array

View File

@ -6,7 +6,8 @@ use Engelsystem\Database\Migration\Migration;
class ImportInstallSql extends Migration
{
protected $oldTables = [
/** @var array<string> */
protected array $oldTables = [
'AngelTypes',
'EventConfig',
'GroupPrivileges',

View File

@ -7,7 +7,7 @@ use Engelsystem\Database\Migration\Migration;
class AddAngelSupporterPermissions extends Migration
{
/** @var string[] */
protected $data = [
protected array $data = [
'2-Engel',
'shiftentry_edit_angeltype_supporter',
];

View File

@ -8,7 +8,7 @@ use Illuminate\Database\Schema\Blueprint;
class ChangeUsersContactDectFieldSize extends Migration
{
/** @var array */
protected $tables = [
protected array $tables = [
'AngelTypes' => 'contact_dect',
'users_contact' => 'dect',
];

View File

@ -11,10 +11,8 @@ class SetAdminPassword extends Migration
{
use Reference;
/** @var Authenticator */
protected Authenticator $auth;
/** @var Config */
protected Config $config;
public function __construct(SchemaBuilder $schemaBuilder, Authenticator $auth, Config $config)

View File

@ -39,8 +39,7 @@ class ImportSchedule extends BaseController
/** @var LoggerInterface */
protected $log;
/** @var array */
protected $permissions = [
protected array $permissions = [
'schedule.import',
];

View File

@ -12,21 +12,19 @@ use Psr\Http\Server\MiddlewareInterface;
class Application extends Container
{
/** @var string|null */
protected $appPath = null;
protected ?string $appPath = null;
/** @var bool */
protected $isBootstrapped = false;
protected bool $isBootstrapped = false;
/** @var MiddlewareInterface[]|string[] */
protected $middleware;
protected array $middleware;
/**
* Registered service providers
*
* @var array
*/
protected $serviceProviders = [];
protected array $serviceProviders = [];
/**
* Application constructor.

View File

@ -11,7 +11,7 @@ class Config extends Fluent
*
* @var array
*/
protected $attributes = [];
protected $attributes = []; // phpcs:ignore
/**
* @param string|array $key

View File

@ -11,16 +11,11 @@ use Illuminate\Database\QueryException;
class ConfigServiceProvider extends ServiceProvider
{
/** @var array */
protected $configFiles = ['app.php', 'config.default.php', 'config.php'];
protected array $configFiles = ['app.php', 'config.default.php', 'config.php'];
/** @var EventConfig */
protected $eventConfig;
public function __construct(Application $app, EventConfig $eventConfig = null)
public function __construct(Application $app, protected ?EventConfig $eventConfig = null)
{
parent::__construct($app);
$this->eventConfig = $eventConfig;
}
public function register(): void

View File

@ -6,8 +6,7 @@ use Engelsystem\Application;
abstract class ServiceProvider
{
/** @var Application */
protected $app;
protected Application $app;
/**
* ServiceProvider constructor.

View File

@ -14,20 +14,16 @@ class FaqController extends BaseController
{
use HasUserNotifications;
/** @var LoggerInterface */
protected $log;
protected LoggerInterface $log;
/** @var Faq */
protected $faq;
protected Faq $faq;
/** @var Redirector */
protected $redirect;
protected Redirector $redirect;
/** @var Response */
protected $response;
protected Response $response;
/** @var array */
protected $permissions = [
protected array $permissions = [
'faq.view',
'faq.edit',
];

View File

@ -9,14 +9,12 @@ use Engelsystem\Models\LogEntry;
class LogsController extends BaseController
{
/** @var LogEntry */
protected $log;
protected LogEntry $log;
/** @var Response */
protected $response;
protected Response $response;
/** @var array */
protected $permissions = [
protected array $permissions = [
'admin_log',
];

View File

@ -15,23 +15,18 @@ class NewsController extends BaseController
{
use HasUserNotifications;
/** @var Authenticator */
protected $auth;
protected Authenticator $auth;
/** @var LoggerInterface */
protected $log;
protected LoggerInterface $log;
/** @var News */
protected $news;
protected News $news;
/** @var Redirector */
protected $redirect;
protected Redirector $redirect;
/** @var Response */
protected $response;
protected Response $response;
/** @var array */
protected $permissions = [
protected array $permissions = [
'admin_news',
];

View File

@ -16,23 +16,18 @@ class QuestionsController extends BaseController
{
use HasUserNotifications;
/** @var Authenticator */
protected $auth;
protected Authenticator $auth;
/** @var LoggerInterface */
protected $log;
protected LoggerInterface $log;
/** @var Question */
protected $question;
protected Question $question;
/** @var Redirector */
protected $redirect;
protected Redirector $redirect;
/** @var Response */
protected $response;
protected Response $response;
/** @var array */
protected $permissions = [
protected array $permissions = [
'question.add',
'question.edit',
];

View File

@ -16,26 +16,20 @@ class UserShirtController extends BaseController
{
use HasUserNotifications;
/** @var Authenticator */
protected $auth;
protected Authenticator $auth;
/** @var Config */
protected $config;
protected Config $config;
/** @var LoggerInterface */
protected $log;
protected LoggerInterface $log;
/** @var Redirector */
protected $redirect;
protected Redirector $redirect;
/** @var Response */
protected $response;
protected Response $response;
/** @var User */
protected $user;
protected User $user;
/** @var array */
protected $permissions = [
protected array $permissions = [
'editShirt' => 'user.edit.shirt',
'saveShirt' => 'user.edit.shirt',
];

View File

@ -19,29 +19,22 @@ class UserWorkLogController extends BaseController
{
use HasUserNotifications;
/** @var Authenticator */
protected $auth;
protected Authenticator $auth;
/** @var Config */
protected $config;
protected Config $config;
/** @var LoggerInterface */
protected $log;
protected LoggerInterface $log;
/** @var Worklog */
protected $worklog;
protected Worklog $worklog;
/** @var Redirector */
protected $redirect;
protected Redirector $redirect;
/** @var Response */
protected $response;
protected Response $response;
/** @var User */
protected $user;
protected User $user;
/** @var array */
protected $permissions = [
protected array $permissions = [
'admin_user_worklog',
];

View File

@ -6,8 +6,7 @@ use Engelsystem\Http\Response;
class ApiController extends BaseController
{
/** @var Response */
protected $response;
protected Response $response;
public function __construct(Response $response)
{

View File

@ -15,23 +15,18 @@ class AuthController extends BaseController
{
use HasUserNotifications;
/** @var Response */
protected $response;
protected Response $response;
/** @var SessionInterface */
protected $session;
protected SessionInterface $session;
/** @var Redirector */
protected $redirect;
protected Redirector $redirect;
/** @var Config */
protected $config;
protected Config $config;
/** @var Authenticator */
protected $auth;
protected Authenticator $auth;
/** @var array */
protected $permissions = [
protected array $permissions = [
'login' => 'login',
'postLogin' => 'login',
];

View File

@ -9,7 +9,7 @@ abstract class BaseController
use ValidatesRequest;
/** @var string[]|string[][] A list of Permissions required to access the controller or certain pages */
protected $permissions = [];
protected array $permissions = [];
/**
* Returns the list of permissions

View File

@ -8,14 +8,11 @@ use Engelsystem\Http\Response;
class CreditsController extends BaseController
{
/** @var Config */
protected $config;
protected Config $config;
/** @var Response */
protected $response;
protected Response $response;
/** @var Version */
protected $version;
protected Version $version;
public function __construct(Response $response, Config $config, Version $version)
{

View File

@ -11,11 +11,9 @@ use Engelsystem\Models\User\User;
class DesignController extends BaseController
{
/** @var Response */
protected $response;
protected Response $response;
/** @var Config */
protected $config;
protected Config $config;
public function __construct(Response $response, Config $config)
{

View File

@ -10,17 +10,14 @@ class FaqController extends BaseController
{
use HasUserNotifications;
/** @var Config */
protected $config;
protected Config $config;
/** @var Faq */
protected $faq;
protected Faq $faq;
/** @var Response */
protected $response;
protected Response $response;
/** @var string[] */
protected $permissions = [
protected array $permissions = [
'faq.view',
];

View File

@ -6,8 +6,7 @@ use Engelsystem\Http\Response;
class HealthController extends BaseController
{
/** @var Response */
protected $response;
protected Response $response;
public function __construct(Response $response)
{

View File

@ -9,14 +9,11 @@ use Engelsystem\Http\Response;
class HomeController extends BaseController
{
/** @var Authenticator */
protected $auth;
protected Authenticator $auth;
/** @var Config */
protected $config;
protected Config $config;
/** @var Redirector */
protected $redirect;
protected Redirector $redirect;
public function __construct(Authenticator $auth, Config $config, Redirector $redirect)
{

View File

@ -12,32 +12,26 @@ use Engelsystem\Models\User\User;
use Illuminate\Database\Query\Expression as QueryExpression;
use Illuminate\Support\Collection;
use Engelsystem\Http\Exceptions\HttpForbidden;
use Psr\Http\Message\RequestInterface;
class MessagesController extends BaseController
{
/** @var Authenticator */
protected $auth;
protected Authenticator $auth;
/** @var Redirector */
protected $redirect;
protected Redirector $redirect;
/** @var Response */
protected $response;
protected Response $response;
/** @var Response */
protected $request;
protected RequestInterface $request;
/** @var Database */
protected $db;
protected Database $db;
/** @var Message */
protected $message;
protected Message $message;
/** @var User */
protected $user;
protected User $user;
/** @var string[] */
protected $permissions = [
protected array $permissions = [
'user_messages',
];

View File

@ -13,23 +13,17 @@ use Psr\Log\LogLevel;
class Controller extends BaseController
{
/** @var Config */
protected $config;
protected Config $config;
/** @var MetricsEngine */
protected $engine;
protected MetricsEngine $engine;
/** @var Request */
protected $request;
protected Request $request;
/** @var Response */
protected $response;
protected Response $response;
/** @var Stats */
protected $stats;
protected Stats $stats;
/** @var Version */
protected $version;
protected Version $version;
public function __construct(
Response $response,

View File

@ -6,8 +6,7 @@ use Engelsystem\Renderer\EngineInterface;
class MetricsEngine implements EngineInterface
{
/** @var string */
protected $prefix = 'engelsystem_';
protected string $prefix = 'engelsystem_';
/**
* Render metrics

View File

@ -30,8 +30,7 @@ use Illuminate\Support\Collection;
class Stats
{
/** @var Database */
protected $db;
protected Database $db;
public function __construct(Database $db)
{

View File

@ -16,32 +16,24 @@ class NewsController extends BaseController
{
use HasUserNotifications;
/** @var Authenticator */
protected $auth;
protected Authenticator $auth;
/** @var NewsComment */
protected $comment;
protected NewsComment $comment;
/** @var Config */
protected $config;
protected Config $config;
/** @var LoggerInterface */
protected $log;
protected LoggerInterface $log;
/** @var News */
protected $news;
protected News $news;
/** @var Redirector */
protected $redirect;
protected Redirector $redirect;
/** @var Response */
protected $response;
protected Response $response;
/** @var Request */
protected $request;
protected Request $request;
/** @var array */
protected $permissions = [
protected array $permissions = [
'news',
'meetings' => 'user_meetings',
'comment' => 'news_comments',

View File

@ -25,29 +25,21 @@ class OAuthController extends BaseController
{
use HasUserNotifications;
/** @var Authenticator */
protected $auth;
protected Authenticator $auth;
/** @var AuthController */
protected $authController;
protected AuthController $authController;
/** @var Config */
protected $config;
protected Config $config;
/** @var LoggerInterface */
protected $log;
protected LoggerInterface $log;
/** @var OAuth */
protected $oauth;
protected OAuth $oauth;
/** @var Redirector */
protected $redirector;
protected Redirector $redirector;
/** @var Session */
protected $session;
protected Session $session;
/** @var UrlGenerator */
protected $url;
protected UrlGenerator $url;
public function __construct(
Authenticator $auth,

View File

@ -15,20 +15,16 @@ class PasswordResetController extends BaseController
{
use HasUserNotifications;
/** @var LoggerInterface */
protected $log;
protected LoggerInterface $log;
/** @var EngelsystemMailer */
protected $mail;
protected EngelsystemMailer $mail;
/** @var Response */
protected $response;
protected Response $response;
/** @var SessionInterface */
protected $session;
protected SessionInterface $session;
/** @var array */
protected $permissions = [
protected array $permissions = [
'reset' => 'login',
'postReset' => 'login',
'resetPassword' => 'login',

View File

@ -14,23 +14,18 @@ class QuestionsController extends BaseController
{
use HasUserNotifications;
/** @var Authenticator */
protected $auth;
protected Authenticator $auth;
/** @var LoggerInterface */
protected $log;
protected LoggerInterface $log;
/** @var Question */
protected $question;
protected Question $question;
/** @var Redirector */
protected $redirect;
protected Redirector $redirect;
/** @var Response */
protected $response;
protected Response $response;
/** @var string[] */
protected $permissions = [
protected array $permissions = [
'question.add',
];

View File

@ -15,23 +15,18 @@ class SettingsController extends BaseController
use HasUserNotifications;
use ChecksArrivalsAndDepartures;
/** @var Authenticator */
protected $auth;
protected Authenticator $auth;
/** @var Config */
protected $config;
protected Config $config;
/** @var LoggerInterface */
protected $log;
protected LoggerInterface $log;
/** @var Redirector */
protected $redirect;
protected Redirector $redirect;
/** @var Response */
protected $response;
protected Response $response;
/** @var string[] */
protected $permissions = [
protected array $permissions = [
'user_settings',
];

View File

@ -7,8 +7,7 @@ use PDO;
class Database
{
/** @var DatabaseConnection */
protected $connection;
protected DatabaseConnection $connection;
public function __construct(DatabaseConnection $connection)
{

View File

@ -9,8 +9,7 @@ use PDO;
/** @deprecated */
class Db
{
/** @var CapsuleManager */
protected static $dbManager;
protected static CapsuleManager $dbManager;
/**
* Set the database connection manager

View File

@ -19,17 +19,14 @@ class Migrate
/** @var string */
public const DOWN = 'down';
/** @var Application */
protected $app;
protected Application $app;
/** @var SchemaBuilder */
protected $schema;
protected SchemaBuilder $schema;
/** @var callable */
protected $output;
/** @var string */
protected $table = 'migrations';
protected string $table = 'migrations';
/**
* Migrate constructor

View File

@ -6,8 +6,7 @@ use Illuminate\Database\Schema\Builder as SchemaBuilder;
abstract class Migration
{
/** @var SchemaBuilder */
protected $schema;
protected SchemaBuilder $schema;
/**
* Migration constructor.

View File

@ -8,7 +8,7 @@ use Illuminate\Support\Str;
class EventDispatcher
{
/** @var callable[] */
protected $listeners;
protected array $listeners;
public function listen(array|string $events, callable|string $listener): void
{

View File

@ -12,14 +12,11 @@ use Symfony\Component\Mailer\Exception\TransportException;
class News
{
/** @var LoggerInterface */
protected $log;
protected LoggerInterface $log;
/** @var EngelsystemMailer */
protected $mailer;
protected EngelsystemMailer $mailer;
/** @var UserSettings */
protected $settings;
protected UserSettings $settings;
public function __construct(
LoggerInterface $log,

View File

@ -12,13 +12,11 @@ use Psr\Log\LoggerInterface;
class OAuth2
{
/** @var Authenticator */
protected Authenticator $auth;
/** @var array */
protected array $config;
/** @var LoggerInterface */
protected LoggerInterface $log;
public function __construct(Config $config, LoggerInterface $log, Authenticator $auth)

View File

@ -10,14 +10,12 @@ use Throwable;
class Handler
{
/** @var string */
protected $environment;
protected string $environment;
/** @var HandlerInterface[] */
protected $handler = [];
protected array $handler = [];
/** @var Request */
protected $request;
protected ?Request $request = null;
/** @var string */
public const ENV_PRODUCTION = 'prod';

View File

@ -8,8 +8,7 @@ use Throwable;
class Legacy implements HandlerInterface
{
/** @var LoggerInterface */
protected $log;
protected ?LoggerInterface $log = null;
public function render(Request $request, Throwable $e): void
{

View File

@ -13,8 +13,7 @@ use Whoops\Run as WhoopsRunner;
class Whoops extends Legacy implements HandlerInterface
{
/** @var Application */
protected $app;
protected Application $app;
/**
* Whoops constructor.

View File

@ -4,10 +4,8 @@ namespace Engelsystem\Helpers;
class Assets
{
/** @var string */
protected string $assetsPath;
/** @var string */
protected string $manifestFile = 'manifest.json';
/**

View File

@ -11,28 +11,21 @@ use Symfony\Component\HttpFoundation\Session\Session;
class Authenticator
{
/** @var User|null */
protected ?User $user = null;
/** @var ServerRequestInterface */
protected ServerRequestInterface $request;
/** @var Session */
protected Session $session;
/** @var UserRepository */
protected UserRepository $userRepository;
/** @var string[] */
protected array $permissions = [];
/** @var int|string|null */
protected $passwordAlgorithm = PASSWORD_DEFAULT;
protected int|string|null $passwordAlgorithm = PASSWORD_DEFAULT;
/** @var int */
protected int $defaultRole = 20;
/** @var int */
protected int $guestRole = 10;
public function __construct(ServerRequestInterface $request, Session $session, UserRepository $userRepository)

View File

@ -9,25 +9,20 @@ class Conference
use CalculatesTime;
/** @var string required */
protected $title;
protected string $title;
/** @var string required */
protected $acronym;
protected string $acronym;
/** @var string|null */
protected $start;
protected ?string $start = null;
/** @var string|null */
protected $end;
protected ?string $end = null;
/** @var int|null */
protected $days;
protected ?int $days = null;
/** @var string|null */
protected $timeslotDuration;
protected ?string $timeslotDuration = null;
/** @var string|null */
protected $baseUrl;
protected ?string $baseUrl = null;
/**
* Event constructor.

View File

@ -9,19 +9,19 @@ use Carbon\Carbon;
class Day
{
/** @var string required */
protected $date;
protected string $date;
/** @var Carbon required */
protected $start;
protected Carbon $start;
/** @var Carbon required */
protected $end;
protected Carbon $end;
/** @var int required */
protected $index;
protected int $index;
/** @var Room[] */
protected $room;
protected array $room;
/**
* Day constructor.

View File

@ -11,70 +11,66 @@ class Event
use CalculatesTime;
/** @var string required globally unique */
protected $guid;
protected string $guid;
/** @var int required globally unique */
protected $id;
protected int $id;
/** @var Room required, string in XML */
protected $room;
protected Room $room;
/** @var string required */
protected $title;
protected string $title;
/** @var string required */
protected $subtitle;
protected string $subtitle;
/** @var string required */
protected $type;
protected string $type;
/** @var Carbon required */
protected $date;
protected Carbon $date;
/** @var string required time (hh:mm:ss || hh:mm) */
protected $start;
protected string $start;
/** @var string required (h?h:mm:ss || h?h:mm) */
protected $duration;
protected string $duration;
/** @var string required */
protected $abstract;
protected string $abstract;
/** @var string required globally unique */
protected $slug;
protected string $slug;
/** @var string required */
protected $track;
protected string $track;
/** @var string|null */
protected $logo;
protected ?string $logo = null;
/** @var string[] id => name */
protected $persons;
protected array $persons;
/** @var string|null two letter code */
protected $language;
protected ?string $language = null;
/** @var string|null */
protected $description;
protected ?string $description = null;
/** @var string|null license (and opt out in XML, null if not recorded, empty if no license defined) */
protected $recording;
protected ?string $recording = null;
/** @var array href => title */
protected $links;
protected array $links;
/** @var array href => name */
protected $attachments;
protected array $attachments;
/** @var string|null */
protected $url;
protected ?string $url = null;
/** @var string|null */
protected $videoDownloadUrl;
protected ?string $videoDownloadUrl = null;
/** @var Carbon Calculated */
protected $endDate;
protected Carbon $endDate;
/**
* Event constructor.

View File

@ -7,10 +7,10 @@ namespace Engelsystem\Helpers\Schedule;
class Room
{
/** @var string required */
protected $name;
protected string $name;
/** @var Event[] */
protected $event;
protected array $event;
/**
* Room constructor.

View File

@ -8,14 +8,12 @@ use Carbon\Carbon;
class Schedule
{
/** @var string */
protected $version;
protected string $version;
/** @var Conference */
protected $conference;
protected Conference $conference;
/** @var Day[] */
protected $day;
protected array $day;
/**
* @param Day[] $days

View File

@ -9,22 +9,20 @@ use SimpleXMLElement;
class XmlParser
{
/** @var SimpleXMLElement */
protected $scheduleXML;
protected SimpleXMLElement $scheduleXML;
/** @var Schedule */
protected $schedule;
protected Schedule $schedule;
public function load(string $xml): bool
{
$this->scheduleXML = simplexml_load_string($xml);
$scheduleXML = simplexml_load_string($xml);
if (!$this->scheduleXML) {
if (!$scheduleXML) {
return false;
}
$this->scheduleXML = $scheduleXML;
$this->parseXml();
return true;
}

View File

@ -13,8 +13,7 @@ use Symfony\Component\HttpFoundation\Session\Session;
class TranslationServiceProvider extends ServiceProvider
{
/** @var GettextTranslator */
protected $translators = [];
protected GettextTranslator|array $translators = [];
public function register(): void
{

View File

@ -5,13 +5,11 @@ namespace Engelsystem\Helpers\Translation;
class Translator
{
/** @var string[] */
protected $locales;
protected array $locales;
/** @var string */
protected $locale;
protected string $locale;
/** @var string */
protected $fallbackLocale;
protected string $fallbackLocale;
/** @var callable */
protected $getTranslatorCallback;

View File

@ -6,14 +6,11 @@ use Engelsystem\Config\Config;
class Version
{
/** @var Config */
protected $config;
protected Config $config;
/** @vat string */
protected $storage;
protected string $storage;
/** @var string */
protected $versionFile = 'VERSION';
protected string $versionFile = 'VERSION';
public function __construct(string $storage, Config $config)
{

View File

@ -7,11 +7,10 @@ use Throwable;
class HttpException extends RuntimeException
{
/** @var int */
protected $statusCode;
protected int $statusCode;
/** @var array */
protected $headers = [];
protected array $headers = [];
/**
* @param array $headers

View File

@ -8,8 +8,7 @@ use Throwable;
class ValidationException extends RuntimeException
{
/** @var Validator */
protected $validator;
protected Validator $validator;
/**
* @param Throwable|null $previous

View File

@ -4,14 +4,11 @@ namespace Engelsystem\Http;
class Redirector
{
/** @var Request */
protected $request;
protected Request $request;
/** @var Response */
protected $response;
protected Response $response;
/** @var UrlGeneratorInterface */
protected $url;
protected UrlGeneratorInterface $url;
public function __construct(Request $request, Response $response, UrlGeneratorInterface $url)
{

View File

@ -12,27 +12,13 @@ class Response extends SymfonyResponse implements ResponseInterface
{
use MessageTrait;
/**
* @var SessionInterface
*/
protected $session;
/** @var Renderer */
protected $renderer;
/**
* @param array $headers
*/
public function __construct(
string $content = '',
int $status = 200,
array $headers = [],
Renderer $renderer = null,
SessionInterface $session = null
protected ?Renderer $renderer = null,
protected ?SessionInterface $session = null
) {
$this->renderer = $renderer;
$this->session = $session;
parent::__construct($content, $status, $headers);
}

View File

@ -7,8 +7,7 @@ use Engelsystem\Http\Request;
trait ValidatesRequest
{
/** @var Validator */
protected $validator;
protected Validator $validator;
/**
* @param array $rules

View File

@ -10,13 +10,13 @@ use Respect\Validation\Validator as RespectValidator;
class Validator
{
/** @var string[] */
protected $errors = [];
protected array $errors = [];
/** @var array */
protected $data = [];
protected array $data = [];
/** @var array */
protected $mapping = [
protected array $mapping = [
'accepted' => 'TrueVal',
'int' => 'IntVal',
'float' => 'FloatVal',
@ -24,7 +24,7 @@ class Validator
];
/** @var array */
protected $nestedRules = ['optional', 'not'];
protected array $nestedRules = ['optional', 'not'];
/**
* @param array $data

View File

@ -11,7 +11,8 @@ use Throwable;
class Logger extends AbstractLogger
{
protected $allowedLevels = [
/** @var array<string> */
protected $allowedLevels = [ // phpcs:ignore
LogLevel::ALERT,
LogLevel::CRITICAL,
LogLevel::DEBUG,
@ -22,8 +23,7 @@ class Logger extends AbstractLogger
LogLevel::WARNING,
];
/** @var LogEntry */
protected $log;
protected LogEntry $log;
public function __construct(LogEntry $log)
{

View File

@ -8,8 +8,7 @@ use Stringable;
class UserAwareLogger extends Logger
{
/** @var Authenticator */
protected $auth;
protected Authenticator $auth;
/**
* Logs with an arbitrary level and prepends the user

View File

@ -9,14 +9,11 @@ use Symfony\Component\Mailer\MailerInterface;
class EngelsystemMailer extends Mailer
{
/** @var Renderer|null */
protected $view;
protected ?Renderer $view = null;
/** @var Translator|null */
protected $translation;
protected ?Translator $translation = null;
/** @var string */
protected $subjectPrefix = null;
protected ?string $subjectPrefix = null;
/**
* @param Renderer|null $view

View File

@ -7,14 +7,11 @@ use Symfony\Component\Mime\Email;
class Mailer
{
/** @var MailerInterface */
protected $mailer;
protected MailerInterface $mailer;
/** @var string */
protected $fromAddress = '';
protected string $fromAddress = '';
/** @var string */
protected $fromName = null;
protected ?string $fromName = null;
public function __construct(MailerInterface $mailer)
{

View File

@ -8,8 +8,7 @@ use Symfony\Component\Mailer\Transport\AbstractTransport;
class LogTransport extends AbstractTransport
{
/** @var LoggerInterface */
protected $logger;
protected LoggerInterface $logger;
public function __construct(LoggerInterface $logger)
{

View File

@ -10,8 +10,7 @@ use Psr\Http\Server\RequestHandlerInterface;
class AddHeaders implements MiddlewareInterface
{
/** @var Config */
protected $config;
protected Config $config;
public function __construct(Config $config)
{

View File

@ -15,8 +15,7 @@ class CallableHandler implements MiddlewareInterface, RequestHandlerInterface
/** @var callable */
protected $callable;
/** @var Container */
protected $container;
protected ?Container $container = null;
/**
* @param callable $callable The callable that should be wrapped

View File

@ -15,22 +15,16 @@ class Dispatcher implements MiddlewareInterface, RequestHandlerInterface
use ResolvesMiddlewareTrait;
/** @var MiddlewareInterface[]|string[] */
protected $stack;
protected array $stack;
/** @var Application */
protected $container;
/** @var RequestHandlerInterface */
protected $next;
protected RequestHandlerInterface $next;
/**
* @param MiddlewareInterface[]|string[] $stack
* @param Application|null $container
*/
public function __construct(array $stack = [], Application $container = null)
public function __construct(array $stack = [], protected ?Application $container = null)
{
$this->stack = $stack;
$this->container = $container;
}
/**

View File

@ -16,18 +16,16 @@ use Twig\Loader\LoaderInterface as TwigLoader;
class ErrorHandler implements MiddlewareInterface
{
/** @var TwigLoader */
protected $loader;
protected TwigLoader $loader;
/** @var string */
protected $viewPrefix = 'errors/';
protected string $viewPrefix = 'errors/';
/**
* A list of inputs that are not saved from form input
*
* @var array
*/
protected $formIgnore = [
protected array $formIgnore = [
'password',
'password_confirmation',
'password2',

View File

@ -12,8 +12,7 @@ use Throwable;
class ExceptionHandler implements MiddlewareInterface
{
/** @var ContainerInterface */
protected $container;
protected ContainerInterface $container;
public function __construct(ContainerInterface $container)
{

View File

@ -13,7 +13,8 @@ use Psr\Http\Server\RequestHandlerInterface;
class LegacyMiddleware implements MiddlewareInterface
{
protected $free_pages = [
/** @var array<string> */
protected array $free_pages = [
'admin_event_config',
'angeltypes',
'atom',
@ -28,11 +29,9 @@ class LegacyMiddleware implements MiddlewareInterface
'admin_shifts_history',
];
/** @var ContainerInterface */
protected $container;
protected ContainerInterface $container;
/** @var Authenticator */
protected $auth;
protected Authenticator $auth;
public function __construct(ContainerInterface $container, Authenticator $auth)
{

View File

@ -16,8 +16,7 @@ class RequestHandler implements MiddlewareInterface
{
use ResolvesMiddlewareTrait;
/** @var Application */
protected $container;
protected Application $container;
public function __construct(Application $container)
{

View File

@ -12,14 +12,11 @@ use Psr\Http\Server\RequestHandlerInterface;
class RouteDispatcher implements MiddlewareInterface
{
/** @var FastRouteDispatcher */
protected $dispatcher;
protected FastRouteDispatcher $dispatcher;
/** @var ResponseInterface */
protected $response;
protected ResponseInterface $response;
/** @var MiddlewareInterface|null */
protected $notFound;
protected ?MiddlewareInterface $notFound = null;
/**
* @param ResponseInterface $response Default response

View File

@ -11,11 +11,10 @@ use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface;
class SessionHandler implements MiddlewareInterface
{
/** @var SessionStorageInterface */
protected $session;
protected SessionStorageInterface $session;
/** @var string[] */
protected $paths = [];
protected array $paths = [];
/**
* @param array $paths

View File

@ -12,14 +12,11 @@ use Symfony\Component\HttpFoundation\Session\Session;
class SetLocale implements MiddlewareInterface
{
/** @var Authenticator */
protected $auth;
protected Authenticator $auth;
/** @var Translator */
protected $translator;
protected Translator $translator;
/** @var Session */
protected $session;
protected Session $session;
public function __construct(Translator $translator, Session $session, Authenticator $auth)
{

View File

@ -11,8 +11,7 @@ use Symfony\Component\HttpFoundation\Session\SessionInterface;
class VerifyCsrfToken implements MiddlewareInterface
{
/** @var SessionInterface */
protected $session;
protected SessionInterface $session;
public function __construct(SessionInterface $session)
{

View File

@ -43,8 +43,8 @@ class AngelType extends BaseModel
{
use HasFactory;
/** @var string[] */
protected $fillable = [
/** @var array<string> */
protected $fillable = [ // phpcs:ignore
'name',
'description',
@ -60,7 +60,7 @@ class AngelType extends BaseModel
];
/** @var array<string, string> */
protected $casts = [
protected $casts = [ // phpcs:ignore
'restricted' => 'boolean',
'requires_driver_license' => 'boolean',
'no_self_signup' => 'boolean',

View File

@ -16,5 +16,5 @@ use Illuminate\Database\Query\Builder as QueryBuilder;
abstract class BaseModel extends Model
{
/** @var bool Disable timestamps by default because of "Datensparsamkeit" */
public $timestamps = false;
public $timestamps = false; // phpcs:ignore
}

View File

@ -19,19 +19,19 @@ use Illuminate\Database\Query\Builder as QueryBuilder;
class EventConfig extends BaseModel
{
/** @var string The primary key for the model */
protected $primaryKey = 'name';
protected $primaryKey = 'name'; // phpcs:ignore
/** @var bool Indicates if the IDs are auto-incrementing */
public $incrementing = false;
public $incrementing = false; // phpcs:ignore
/** @var string Required because it is not event_configs */
protected $table = 'event_config';
protected $table = 'event_config'; // phpcs:ignore
/** @var array Values that are mass assignable */
protected $fillable = ['name', 'value'];
protected $fillable = ['name', 'value']; // phpcs:ignore
/** @var array The configuration values that should be cast to native types */
protected $valueCasts = [
/** @var array<string, string> The configuration values that should be cast to native types */
protected array $valueCasts = [
'buildup_start' => 'datetime_human',
'event_start' => 'datetime_human',
'event_end' => 'datetime_human',
@ -40,7 +40,7 @@ class EventConfig extends BaseModel
];
/** @var bool It could be interesting to know when a value changed the last time */
public $timestamps = true;
public $timestamps = true; // phpcs:ignore
/**
* Value accessor

View File

@ -24,13 +24,13 @@ class Faq extends BaseModel
use HasFactory;
/** @var bool Enable timestamps */
public $timestamps = true;
public $timestamps = true; // phpcs:ignore
/** @var string The models table */
public $table = 'faq';
public $table = 'faq'; // phpcs:ignore
/** @var string[] */
protected $fillable = [
/** @var array<string> */
protected $fillable = [ // phpcs:ignore
'question',
'text',
];

Some files were not shown because too many files have changed in this diff Show More