Skip to content

Commit

Permalink
add return types
Browse files Browse the repository at this point in the history
  • Loading branch information
mrothauer committed Jan 15, 2025
1 parent 74a974b commit a883ea2
Show file tree
Hide file tree
Showing 32 changed files with 314 additions and 221 deletions.
2 changes: 1 addition & 1 deletion config/Migrations/20200107095607_SqlModeFixes.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class SqlModeFixes extends AbstractMigration
{
public function change()
public function change(): void
{
$this->execute("
ALTER TABLE `blocked_workshop_slugs` CHANGE `url` `url` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `status` `status` TINYINT(4) NULL DEFAULT NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class AddDefaultDefectDescription extends AbstractMigration
{
public function change()
public function change(): void
{
$this->execute("ALTER TABLE `info_sheets` CHANGE `defect_description` `defect_description` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;");
}
Expand Down
2 changes: 1 addition & 1 deletion config/Migrations/20210325100602_OnlineEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class OnlineEvent extends AbstractMigration
{
public function change()
public function change(): void
{
$this->execute("ALTER TABLE `events` ADD `is_online_event` TINYINT(4) UNSIGNED NOT NULL DEFAULT '0' AFTER `workshop_uid`;");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class AddAdditionalInfoSheetData extends AbstractMigration
{
public function change()
public function change(): void
{

$this->execute("
Expand Down
2 changes: 1 addition & 1 deletion config/Migrations/20210816093411_RenameTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class RenameTable extends AbstractMigration
{
public function change()
public function change(): void
{
$this->execute("RENAME TABLE form_field_options_extra_info TO form_field_options_extra_infos;");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class AddIso3CodeToCountries extends AbstractMigration
{
public function change()
public function change(): void
{
$sql = "CREATE TABLE IF NOT EXISTS `tmp_countries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand Down
2 changes: 1 addition & 1 deletion config/Migrations/20210927124302_GeoDataForUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class GeoDataForUsers extends AbstractMigration
{
public function change()
public function change(): void
{

$this->execute("ALTER TABLE `users` ADD `lat` DOUBLE NULL DEFAULT NULL AFTER `country_code`, ADD `lng` DOUBLE NULL DEFAULT NULL AFTER `lat`;");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class ChangeZeroDatesForMySql8 extends AbstractMigration
{

public function change()
public function change(): void
{

$tables = [
Expand Down
2 changes: 1 addition & 1 deletion config/Migrations/20220404070045_Knowledge.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class Knowledge extends AbstractMigration
{
public function change()
public function change(): void
{
$sql = "ALTER TABLE `roots` CHANGE `object_type` `object_type` ENUM('pages','users','posts','workshops','events','coaches','votings','photos','info_sheets','knowledges') CHARACTER SET ascii COLLATE ascii_bin NULL DEFAULT NULL;";
$this->execute($sql);
Expand Down
2 changes: 1 addition & 1 deletion config/Migrations/20221128184445_RemoveNewsletter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class RemoveNewsletter extends AbstractMigration
{
public function change()
public function change(): void
{
$this->execute("DROP table newsletters;");
}
Expand Down
1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ parameters:
- message: '#Access to an undefined property .*#'
- message: '#Cannot access property .*#'
- message: '#Call to an undefined method Authorization\\IdentityInterface::*.#'
- message: '#Method .* has no return type specified.#'
- message: '#Method .* has parameter .* with no type specified.#'
- message: '#Method .* has parameter .* with no value type specified in iterable type array.#'
- message: '#Method .* return type has no value type specified in iterable type array.#'
Expand Down
8 changes: 4 additions & 4 deletions src/View/Helper/MenuHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class MenuHelper extends Helper
{

public function render($array, $options)
public function render($array, $options): string
{
$tmpMenu = '<ul id="'.$options['id'].'" class="'.$options['class'].'">';
if (!empty($options['header'])) {
Expand All @@ -25,7 +25,7 @@ public function render($array, $options)
return $tmpMenu;
}

public function buildPageMenu($pages)
public function buildPageMenu($pages): array
{

$menu = [];
Expand Down Expand Up @@ -58,7 +58,7 @@ public function buildPageMenu($pages)
return $menu;
}

private function buildMenuItem($item, $index)
private function buildMenuItem($item, $index): string
{

$liClass = [];
Expand Down Expand Up @@ -89,7 +89,7 @@ private function buildMenuItem($item, $index)
return $tmpMenuItem;
}

private function renderMenuElement($slug, $name, $style = '', $class = [], $target = '')
private function renderMenuElement($slug, $name, $style = '', $class = [], $target = ''): string
{

if ($style != '') {
Expand Down
Loading

0 comments on commit a883ea2

Please sign in to comment.