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

Adding PHPStan #193

Merged
merged 13 commits into from
Apr 7, 2023
13 changes: 13 additions & 0 deletions .github/workflows/coding-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Code Quality

on:
push:
branches:
- main
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
coding-quality:
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
coding-quality:
code-quality:

Copy link
Contributor

Choose a reason for hiding this comment

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

Something I forgot to update in the original repo.

uses: alleyinteractive/.github/.github/workflows/php-code-quality.yml@main
2 changes: 1 addition & 1 deletion bin/create-block/templates/javascript/index.php.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @see https://developer.wordpress.org/reference/functions/register_block_type/
*/
function {{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init() {
function {{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init(): void {
// Register the block by passing the location of block.json.
register_block_type(
__DIR__
Expand Down
2 changes: 1 addition & 1 deletion bin/create-block/templates/typescript/index.php.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @see https://developer.wordpress.org/reference/functions/register_block_type/
*/
function {{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init() {
function {{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init(): void {
// Register the block by passing the location of block.json.
register_block_type(
__DIR__
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"require-dev": {
"alleyinteractive/alley-coding-standards": "^1.0",
"mantle-framework/testkit": "^0.10",
"nunomaduro/collision": "^5.0"
"nunomaduro/collision": "^5.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this required? Since @mantle-framework/testkit already bundles it...

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed!

"szepeviktor/phpstan-wordpress": "^1.1"
},
"config": {
"allow-plugins": {
Expand All @@ -47,8 +48,10 @@
"phpcbf": "phpcbf .",
"phpcs": "phpcs .",
"phpunit": "phpunit",
"phpstan": "phpstan --memory-limit=512M",
"test": [
"@phpcs",
"@phpstan",
"@phpunit"
]
}
Expand Down
Loading