Skip to content

Commit

Permalink
Add initial functionality and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dlh01 committed Dec 26, 2023
1 parent f0e8d79 commit 3577ee0
Show file tree
Hide file tree
Showing 29 changed files with 3,159 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig helps maintain consistent coding styles for developers working on the same project across various editors and IDEs.
# See https://editorconfig.org.

root = true

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

[*.php]
indent_size = 4
indent_style = tab

[*.xml]
indent_size = 4
29 changes: 29 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# Exclude these files from release archives.
#
# This will also make the files unavailable when using Composer with `--prefer-dist`.
# If you develop using Composer, use `--prefer-source`.
#
# Via WPCS.
#
/.github export-ignore
/.editorconfig export-ignore
/.php-cs-fixer.dist.php export-ignore
/phpcs.xml export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/tests export-ignore

#
# Auto detect text files and perform LF normalization.
#
# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/
#
* text=auto

#
# The above will handle all files not found below.
#
*.md text
*.php text
*.inc text
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Summary

As titled.

## Notes for reviewers

None.

## Changelog entries

### Added

### Changed

### Deprecated

### Removed

### Fixed

### Security
14 changes: 14 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Code Quality

on:
pull_request:
branches:
- main
types: [opened, synchronize, reopened, ready_for_review]

jobs:
code-quality:
if: github.event.pull_request.draft == false
uses: alleyinteractive/.github/.github/workflows/php-code-quality.yml@main
with:
php: 8.1
14 changes: 14 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Coding Standards

on:
pull_request:
branches:
- main
types: [opened, synchronize, reopened, ready_for_review]

jobs:
coding-standards:
if: github.event.pull_request.draft == false
uses: alleyinteractive/.github/.github/workflows/php-coding-standards.yml@main
with:
php: 8.1
21 changes: 21 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Testing Suite

on:
pull_request:
branches:
- main
types: [opened, synchronize, reopened, ready_for_review]

jobs:
php-tests:
if: github.event.pull_request.draft == false
strategy:
matrix:
php: ["8.2", "8.1"]
wordpress: ["latest"]
multisite: [false, true]
uses: alleyinteractive/.github/.github/workflows/php-tests.yml@main
with:
php: ${{ matrix.php }}
wordpress: ${{ matrix.wordpress }}
multisite: ${{ matrix.multisite }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
vendor
composer.lock
.php_cs.cache
.phpunit.result.cache
.php-cs-fixer.cache
36 changes: 36 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* PHP-CS-Fixer configuration
*
* (c) Alley <info@alley.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package wp-type-extensions
*/

$finder = PhpCsFixer\Finder::create()->in(
[
__DIR__ . '/src/',
__DIR__ . '/tests/',
]
);

$config = new PhpCsFixer\Config();
$config->setRules(
[
'@PHP81Migration' => true,
'method_argument_space' => false, // Enabled by '@PHP81Migration' but generates invalid spacing for WordPress.
'heredoc_indentation' => false, // Enabled by '@PHP81Migration' but generates heredoc with syntax errors.

'final_class' => true,
'native_constant_invocation' => true,
'native_function_casing' => true,
'native_function_invocation' => true,
'native_function_type_declaration_casing' => true,
]
);
$config->setFinder( $finder );

return $config;
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

This library adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/en/1.0.0/).

## Unreleased

Nothing yet.

## 0.1.0

Initial release.
Loading

0 comments on commit 3577ee0

Please sign in to comment.