Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
65bb7d8
Repo set up
dpanta94 Sep 24, 2025
9db4972
Moved implementation from models
dpanta94 Sep 24, 2025
c839624
Fix tests
dpanta94 Sep 24, 2025
e2ab170
Merge c839624e32ebbcfb887d68a70bc4dd7c0366104c into c7dc99a29082a0ca2…
dpanta94 Sep 24, 2025
de4f8a2
chore: autopublish 2025-09-24T17:45:49Z
github-actions[bot] Sep 24, 2025
178e7a1
remove WC from phpstan config
dpanta94 Sep 24, 2025
4601d9f
Fixing phpcs issues
dpanta94 Sep 24, 2025
45e0778
Fixing phpstan issues
dpanta94 Sep 24, 2025
80848e2
Fix constructor overwrite
dpanta94 Sep 24, 2025
8d4d71a
Fix lowercase Datetime
dpanta94 Sep 24, 2025
7303951
Updated translation of defaults
dpanta94 Sep 29, 2025
827dc23
Update schema/models to their latest versions
dpanta94 Sep 30, 2025
6277cae
add empty new lines
dpanta94 Sep 30, 2025
cde3e1d
Upgraded models/schema
dpanta94 Oct 1, 2025
1fdccc9
remove contructor overwrite
dpanta94 Oct 1, 2025
1ae70e4
Fix phpcs and phpstan
dpanta94 Oct 1, 2025
3e16117
Clean cache of definitions
dpanta94 Oct 1, 2025
225d54b
Updating models and making sure tests are passing
dpanta94 Oct 1, 2025
bea1450
Merge 225d54be731cd8b34d0bac0296c996197859483b into c7dc99a29082a0ca2…
dpanta94 Oct 1, 2025
67dd968
chore: autopublish 2025-10-01T19:48:39Z
github-actions[bot] Oct 1, 2025
157133c
Update schema requirements
dpanta94 Oct 1, 2025
8c78f83
Fix static analysis
dpanta94 Oct 1, 2025
effab56
Fix phpcs
dpanta94 Oct 1, 2025
70dab24
Fixing a bug on setting the attributes
dpanta94 Oct 1, 2025
b26ee9a
Updating schema version
dpanta94 Oct 1, 2025
4298592
Updated schema version
dpanta94 Oct 2, 2025
25a8a1c
Remove __call method from contract
dpanta94 Oct 2, 2025
6039db8
updated initial version to be a minor release
dpanta94 Oct 2, 2025
76e363c
Update src/SchemaModel.php
dpanta94 Oct 2, 2025
f3ab055
Update src/SchemaModel.php
dpanta94 Oct 2, 2025
c4c13d1
Merge f3ab055b0bc04cb57b02d18261d828b8eed8cf62 into c7dc99a29082a0ca2…
dpanta94 Oct 2, 2025
55bb14f
chore: autopublish 2025-10-02T13:08:13Z
github-actions[bot] Oct 2, 2025
e1d4b2b
phpcs and TBD replacements
dpanta94 Oct 2, 2025
02ada2f
Merge remote-tracking branch 'origin/feat/repo-set-up' into feat/repo…
dpanta94 Oct 2, 2025
a55645d
Specifying the abstract instead of the interface to take advantage of…
dpanta94 Oct 2, 2025
8083b12
Fix tests
dpanta94 Oct 2, 2025
ee24f20
Fix static analysis
dpanta94 Oct 2, 2025
1da00a3
Fix phpcs
dpanta94 Oct 2, 2025
2bf9505
Update license to GPL3
dpanta94 Oct 2, 2025
fa1f441
use our own exceptions
dpanta94 Oct 2, 2025
0b13268
Changes to match newer models API
dpanta94 Oct 2, 2025
cdc9956
Merge 0b132687a0a28ebf2d9f7d4545dbd3db8b59c01f into c7dc99a29082a0ca2…
dpanta94 Oct 2, 2025
70b6896
chore: autopublish 2025-10-02T20:15:20Z
github-actions[bot] Oct 2, 2025
246de7f
Make relationships more dynamic
dpanta94 Oct 3, 2025
704d675
Merge 246de7f6e00cbbcfa2a545b47c4ba2963bc34dc1 into c7dc99a29082a0ca2…
dpanta94 Oct 3, 2025
5ff0dba
chore: autopublish 2025-10-03T17:35:54Z
github-actions[bot] Oct 3, 2025
4a42541
added docblock
dpanta94 Oct 3, 2025
7605f34
Fix static analysis
dpanta94 Oct 3, 2025
14914c8
Fix phpcs
dpanta94 Oct 3, 2025
28d05f8
Fix implementation after latest changes in models library
dpanta94 Oct 7, 2025
e155d35
Update model contact referenced
dpanta94 Oct 7, 2025
d881f63
Upgrade to models v2
dpanta94 Oct 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = true

[*.{neon,neon.dist}]
indent_style = tab

[**.{jshintrc,json,scss-lint,yml}]
indent_style = space
indent_size = 2
57 changes: 57 additions & 0 deletions .env.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This file will be consumed by both the CI and the tests.
# Some environment variables might not apply to one but might apply to the other: modify with care.

# What version of WordPress we want to install and test against.
# This has to be compatible with the `wp core download` command, see https://developer.wordpress.org/cli/commands/core/download/.
WP_VERSION=latest

# This is where, in the context of the CI, we'll install and configure WordPress.
# See `.travis.yml` for more information.
WP_ROOT_FOLDER=/tmp/wordpress

# The WordPress installation will be served from the Docker container.
# See `dev/docker/ci-compose.yml` for more information.
WP_URL=http://localhost:8080
WP_DOMAIN=localhost:8080

# The credentials that will be used to access the site in acceptance tests
# in methods like `$I->loginAsAdmin();`.
WP_ADMIN_USERNAME=admin
WP_ADMIN_PASSWORD=password

WP_DB_PORT=4306

# The databse is served from the Docker `db` container.
# See `dev/docker/ci-compose.yml` for more information.
WP_TABLE_PREFIX=wp_
WP_DB_HOST=127.0.0.1:4306
WP_DB_NAME=wordpress
WP_DB_USER=root
WP_DB_PASSWORD=

# The test databse is served from the Docker `db` container.
# See `dev/docker/ci-compose.yml` for more information.
WP_TEST_DB_HOST=127.0.0.1:4306
WP_TEST_DB_NAME=test
WP_TEST_DB_USER=root
WP_TEST_DB_PASSWORD=

# We're using Selenium and Chrome for acceptance testing.
# In CI context we're starting a Docker container to handle that.
# See the `dev/docker/ci-compose.yml` file.
CHROMEDRIVER_HOST=localhost
CHROMEDRIVER_PORT=4444

# The URL of the WordPress installation from the point of view of the Chromedriver container.
# Why not just use `wordpress`? While Chrome will accept an `http://wordpress` address WordPress
# will not, we call the WordPress container with a seemingly looking legit URL and leverage the
# lines that, in the `wp-config.php` file, will make it so that WordPress will use as its home
# URL whatever URL we reach it with.
# See the `dev/docker/wp-config.php` template for more information.
WP_CHROMEDRIVER_URL="wp.test"

# To run the tests let's force the background-processing lib to run in synchronous (single PHP thread) mode.
TRIBE_NO_ASYNC=1

# We're using Docker to run the tests.
USING_CONTAINERS=1
57 changes: 57 additions & 0 deletions .env.testing.slic
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This file will be consumed by both the CI and the tests.
# Some environment variables might not apply to one but might apply to the other: modify with care.

# What version of WordPress we want to install and test against.
# This has to be compatible with the `wp core download` command, see https://developer.wordpress.org/cli/commands/core/download/.
WP_VERSION=latest

# This is where, in the context of the CI, we'll install and configure WordPress.
# See `.travis.yml` for more information.
WP_ROOT_FOLDER=/var/www/html

# The WordPress installation will be served from the Docker container.
# See `dev/docker/ci-compose.yml` for more information.
WP_URL=http://wordpress.test
WP_DOMAIN=wordpress.test

# The credentials that will be used to access the site in acceptance tests
# in methods like `$I->loginAsAdmin();`.
WP_ADMIN_USERNAME=admin
WP_ADMIN_PASSWORD=password

WP_DB_PORT=3306

# The databse is served from the Docker `db` container.
# See `dev/docker/ci-compose.yml` for more information.
WP_TABLE_PREFIX=wp_
WP_DB_HOST=db
WP_DB_NAME=test
WP_DB_USER=root
WP_DB_PASSWORD=password

# The test databse is served from the Docker `db` container.
# See `dev/docker/ci-compose.yml` for more information.
WP_TEST_DB_HOST=db
WP_TEST_DB_NAME=test
WP_TEST_DB_USER=root
WP_TEST_DB_PASSWORD=password

# We're using Selenium and Chrome for acceptance testing.
# In CI context we're starting a Docker container to handle that.
# See the `dev/docker/ci-compose.yml` file.
CHROMEDRIVER_HOST=chrome
CHROMEDRIVER_PORT=4444

# The URL of the WordPress installation from the point of view of the Chromedriver container.
# Why not just use `wordpress`? While Chrome will accept an `http://wordpress` address WordPress
# will not, we call the WordPress container with a seemingly looking legit URL and leverage the
# lines that, in the `wp-config.php` file, will make it so that WordPress will use as its home
# URL whatever URL we reach it with.
# See the `dev/docker/wp-config.php` template for more information.
WP_CHROMEDRIVER_URL=http://wordpress.test

# To run the tests let's force the background-processing lib to run in synchronous (single PHP thread) mode.
TRIBE_NO_ASYNC=1

# We're using Docker to run the tests.
USING_CONTAINERS=1
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* text
.* export-ignore
composer.lock text -diff
phpstan.* export-ignore
phpunit.* export-ignore
tests export-ignore
codeception.* export-ignore
phpcs.xml export-ignore
phpstan.neon.dist export-ignore
docs export-ignore
schema-models.php export-ignore
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @dpanta94
40 changes: 40 additions & 0 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: PHP Compatibility
on:
pull_request:
jobs:
php-compatibility:
name: PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]

steps:
- uses: actions/checkout@v4

- name: Configure PHP environment
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mbstring, intl
coverage: none

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-

- uses: ramsey/composer-install@v3
with:
composer-options: "--ignore-platform-reqs"
dependency-versions: highest

- name: Run PHP Compatibility
run: composer compatibility:php-${{ matrix.php-version }}
34 changes: 34 additions & 0 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'PHPCS'
on:
pull_request:
jobs:
phpcs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Composer install
uses: php-actions/composer@v6
with:
php_version: 7.4
php_extensions: zip mysqli
args: --ignore-platform-reqs

- name: Fix and Push phpcbf issues
continue-on-error: true
run: |
vendor/bin/phpcbf ./

- name: Commit & Push changes
uses: actions-js/push@master
continue-on-error: true
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}

- name: PHP Code Sniffer
run: |
vendor/bin/phpcs ./ -s
21 changes: 21 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Static Analysis
on:
pull_request:
jobs:
phpstsan:
name: phpstan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure PHP environment
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: mbstring, intl
coverage: none
- uses: ramsey/composer-install@v2
with:
composer-options: "--ignore-platform-reqs --optimize-autoloader"
- name: Run PHPStan static analysis
run: composer test:analysis
88 changes: 88 additions & 0 deletions .github/workflows/tests-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: 'Tests'
on:
pull_request:
jobs:
test:
strategy:
matrix:
suite:
- wpunit
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
# ------------------------------------------------------------------------------
# Set up PHP to run slic
# ------------------------------------------------------------------------------
- name: Configure PHP environment
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
# ------------------------------------------------------------------------------
# Checkout slic
# ------------------------------------------------------------------------------
- name: Checkout slic
uses: actions/checkout@v4
with:
repository: stellarwp/slic
ref: main
path: slic
fetch-depth: 1
# ------------------------------------------------------------------------------
# Prepare our composer cache directory
# ------------------------------------------------------------------------------
- name: Get Composer Cache Directory
id: get-composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v4
id: composer-cache
with:
path: ${{ steps.get-composer-cache-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
# ------------------------------------------------------------------------------
# Initialize slic
# ------------------------------------------------------------------------------
- name: Set up slic env vars
run: |
echo "SLIC_BIN=${GITHUB_WORKSPACE}/slic/slic" >> $GITHUB_ENV
echo "SLIC_WP_DIR=${GITHUB_WORKSPACE}/slic/_wordpress" >> $GITHUB_ENV
echo "SLIC_WORDPRESS_DOCKERFILE=Dockerfile.base" >> $GITHUB_ENV
- name: Set run context for slic
run: echo "SLIC=1" >> $GITHUB_ENV && echo "CI=1" >> $GITHUB_ENV
- name: Start ssh-agent
run: |
mkdir -p "${HOME}/.ssh";
ssh-agent -a /tmp/ssh_agent.sock;
- name: Export SSH_AUTH_SOCK env var
run: echo "SSH_AUTH_SOCK=/tmp/ssh_agent.sock" >> $GITHUB_ENV
- name: Set up slic for CI
run: |
cd ${GITHUB_WORKSPACE}/..
${SLIC_BIN} here
${SLIC_BIN} interactive off
${SLIC_BIN} build-prompt off
${SLIC_BIN} build-subdir off
${SLIC_BIN} xdebug off
${SLIC_BIN} debug on
${SLIC_BIN} info
${SLIC_BIN} config
- name: Start the Chrome container
run: ${SLIC_BIN} up chrome
- name: Set up StellarWP Schema Models
run: |
${SLIC_BIN} use schema-models
${SLIC_BIN} composer install
- name: Init the WordPress container
run: |
${SLIC_BIN} up wordpress
${SLIC_BIN} wp core version
${SLIC_BIN} wp core update --force --version=6.7
${SLIC_BIN} wp core version
- name: Ensure Kadence is installed
run: |
${SLIC_BIN} wp theme install kadence --activate
- name: Run suites
run: ${SLIC_BIN} run ${{ matrix.suite }} --ext DotReporter
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
composer.lock
vendor/
tests/_support/_generated

# Dev tools
.buildpath
*.iml
.project
.idea/
.vscode/

# Third party dependencies
vendor/

# Tests
codeception.yml
tests/_output/*
tests/*.suite.yml
!tests/_data/*.sql
tests/*.pem
tests/*.cert
tests/*.key

.DS_Store
DOCKER_ENV
Dockerfile-*
output.log
docker_tag
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Change Log

All notable changes to this project will be documented in this file. This project adhere to the [Semantic Versioning](http://semver.org/) standard.

## [0.1.0] 2025-10-02

* Feature - Initial release of Schema Models.

[0.1.0]: https://github.com/stellarwp/schema-models/releases/tag/0.1.0
Loading
Loading