Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start fixing phpstan fails #2002

Open
wants to merge 14 commits into
base: bucket/phpstan-and-fixes
Choose a base branch
from
Open

Conversation

Camwyn
Copy link
Member

@Camwyn Camwyn commented Oct 30, 2023

per https://theeventscalendar.atlassian.net/browse/TECENG-44

Fix issue with undefined $container

Address some of the things phpstan is surfacing.

@Camwyn Camwyn added the code review Status: requires a code review. label Oct 30, 2023
@Camwyn Camwyn self-assigned this Oct 30, 2023
Copy link
Contributor

@stratease stratease left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a src dir missing for this? Vendor?

image

@Camwyn
Copy link
Member Author

Camwyn commented Nov 1, 2023

Is there a src dir missing for this? Vendor?

image

Yeah, had to add the vendor-prefixed dir to the scanDirectories
Great catch!

Fixes:
Invalid param formats in docblocks.
    src/Tribe/Context.php

Invalid return statements:
    Tribe__Admin__Notices::register_transient()
    Tribe__Ajax__Dropdown::sort_terms_hierarchically()
    Tribe__Admin__Notice__Plugin_Upgrade_Notice::parse_for_upgrade_notice()
Unsafe usage of new static()
    Thrown in src/Common/Site_Health/Fields/Generic_Info_Field.php
        mitigated via an interface to enforce the constructor signature

Static access to instance property Tribe\Admin\Upsell_Notice\Main::$template.

Incorrect/unused use function in src/Tribe/Admin/Notices.php
@Camwyn Camwyn changed the base branch from release/B23.maria to master November 10, 2023 20:38
@Camwyn Camwyn changed the base branch from master to feature/phpstan November 14, 2023 21:34
phpstan.neon Outdated
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this shows as empty?

@Camwyn
Copy link
Member Author

Camwyn commented Nov 14, 2023

This PR has become the "fix" branch, see #2012 for the base "just add phpstan testing to TCMN"

@Camwyn Camwyn changed the title Add phpstan Start fixing phpstan fails Nov 14, 2023
* @param array<string,string>|string|null $value
* @param int $priority
*/
public function __construct( string $id, string $label, $value = null, int $priority = 50 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public function __construct( string $id, string $label, $value = null, int $priority = 50 );
public function __construct( string $id, string $label, $value = null, int $priority = 50 );

Am I seeing this correct? Spacing ok?

Base automatically changed from feature/phpstan to bucket/phpstan-and-fixes January 17, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code review Status: requires a code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants