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

NEW Add script for setting phpstan config #33

Merged

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Jan 29, 2024

This PR assumes #32 is merged first, as that changes how is_module() works.

This PR does the following:

  • Add new is_theme() function to determine if a module is specifically a theme
  • Add new check_dir_exists() function to check if a directory exists or not
  • Adds new phpstan.php script for CMS 5 projects
    • is only processed for modules which aren't themes
    • is only processed if one of the relevant directories exists
    • adds phpstan.neon.dist configuration file
    • adds silverstripe/standards and phpstan/extension-installer dev dependencies

Issue

* Check that a directory exists relative to the root of the module being processed
*
* Example usage:
* check_file_exists('src')
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* check_file_exists('src')
* check_dir_exists('src')

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops. Fixed.

scripts/cms5/phpstan.php Show resolved Hide resolved
scripts/cms5/phpstan.php Show resolved Hide resolved
scripts/cms5/phpstan.php Show resolved Hide resolved
@emteknetnz emteknetnz merged commit 0b81085 into silverstripe:main Jan 29, 2024
1 check passed
@emteknetnz emteknetnz deleted the pulls/main/add-phpstan-config branch January 29, 2024 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants