Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fsylum committed Jan 21, 2024
1 parent d8d603e commit 2f6aa26
Show file tree
Hide file tree
Showing 244 changed files with 8,734 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.yaml]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
pint.json export-ignore
phpstan.neon export-ignore
phpunit.xml export-ignore
tests export-ignore
51 changes: 51 additions & 0 deletions .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Code Analysis

on:
pull_request:
push:
branches:
- main

env:
COMPOSER_ROOT_VERSION: "dev-main"

jobs:
code_analysis:
runs-on: ubuntu-latest

strategy:
matrix:
actions:
-
name: 'Composer Validate'
run: composer validate

-
name: 'Pint'
run: composer pint-test

-
name: 'Rector Dry Run'
run: composer rector-dry-run

-
name: 'PHPStan'
run: composer phpstan

-
name: 'PHPUnit'
run: composer phpunit

name: ${{ matrix.actions.name }}

steps:
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none

- uses: ramsey/composer-install@v2

- run: ${{ matrix.actions.run }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/vendor
.idea/
.phpunit.result.cache
.phpunit.cache
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Rector Rules for WordPress

This package is a [Rector](https://github.com/rectorphp/rector) extension developed to provide upgrades rules for WordPress.

## Install

Install the `rector-wordpress` package as dependency:

```bash
composer require fsylum/rector-wordpress --dev
```

## Use Sets

To add a set to your config, use `Fsylum\RectorWordPress\Set\WordPressSetList` class and pick one of the constants:

```php
use Fsylum\RectorWordPress\Set\WordPressSetList;
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
WordPressSetList::WP_6_4
]);
};
```
44 changes: 44 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "fsylum/rector-wordpress",
"description": "Rector upgrades rules for WordPress",
"type": "rector-extension",
"license": "MIT",
"autoload": {
"psr-4": {
"Fsylum\\RectorWordPress\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Fsylum\\RectorWordPress\\Tests\\": "tests"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.2",
"rector/rector": "^0.19.2"
},
"require-dev": {
"phpunit/phpunit": "^10.5",
"phpstan/phpstan": "^1.10",
"laravel/pint": "^1.13",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpstan/phpstan-strict-rules": "^1.5",
"webmozart/assert": "^1.11"
},
"scripts": {
"phpstan": "vendor/bin/phpstan analyse --ansi",
"phpunit": "vendor/bin/phpunit tests",
"pint-test": "vendor/bin/pint --test",
"pint": "vendor/bin/pint",
"rector-dry-run": "vendor/bin/rector process --dry-run --ansi",
"rector": "vendor/bin/rector process --ansi"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
}
}
Loading

0 comments on commit 2f6aa26

Please sign in to comment.