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

Release v4.x #83

Draft
wants to merge 113 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
34c664d
Merge pull request #82 from dimitriBouteille/v4/update-eloquent-to-v11
dimitriBouteille Sep 23, 2024
60a9ec7
Remove all deprecated models functions
dimitriBouteille Sep 23, 2024
28d3173
https://github.com/dimitriBouteille/wp-orm/issues/27 Remove Phinx
dimitriBouteille Sep 23, 2024
300d19d
Merge pull request #84 from dimitriBouteille/v2/remove-phinx
dimitriBouteille Sep 23, 2024
7eb2692
https://github.com/dimitriBouteille/wp-orm/issues/72 Start meta casting
dimitriBouteille Sep 28, 2024
a04fc13
https://github.com/dimitriBouteille/wp-orm/issues/72 Start HasMetasTest
dimitriBouteille Sep 28, 2024
6100160
https://github.com/dimitriBouteille/wp-orm/issues/72 WIP HasMetas
dimitriBouteille Sep 28, 2024
945d104
https://github.com/dimitriBouteille/wp-orm/issues/72 Rollback expectE…
dimitriBouteille Sep 28, 2024
2aa43d1
https://github.com/dimitriBouteille/wp-orm/issues/72 Fix HasMetasTest…
dimitriBouteille Sep 28, 2024
05de571
https://github.com/dimitriBouteille/wp-orm/issues/72 WIP HasMetasTest
dimitriBouteille Sep 28, 2024
aae16e3
https://github.com/dimitriBouteille/wp-orm/issues/72 WIP HasMetasTest
dimitriBouteille Sep 28, 2024
6fa7000
https://github.com/dimitriBouteille/wp-orm/issues/72 WIP HasMetasTest
dimitriBouteille Sep 28, 2024
b43edde
https://github.com/dimitriBouteille/wp-orm/issues/72 WIP HasMetasTest
dimitriBouteille Sep 28, 2024
8ede96b
https://github.com/dimitriBouteille/wp-orm/issues/72 CS
dimitriBouteille Sep 28, 2024
5a552fe
https://github.com/dimitriBouteille/wp-orm/issues/72 CS
dimitriBouteille Sep 28, 2024
3e30e58
Merge pull request #85 from dimitriBouteille/v4/72-meta-casting
dimitriBouteille Sep 28, 2024
0e4153c
https://github.com/dimitriBouteille/wp-orm/issues/51 Add CustomComment
dimitriBouteille Oct 4, 2024
0b0b14f
https://github.com/dimitriBouteille/wp-orm/issues/51 Update test doc
dimitriBouteille Oct 4, 2024
4d389b2
https://github.com/dimitriBouteille/wp-orm/issues/51 Update CustomCom…
dimitriBouteille Oct 4, 2024
dbf5322
https://github.com/dimitriBouteille/wp-orm/issues/51 Add CustomCommen…
dimitriBouteille Oct 4, 2024
ae59348
https://github.com/dimitriBouteille/wp-orm/issues/51 Update CustomCom…
dimitriBouteille Oct 4, 2024
19d1f80
https://github.com/dimitriBouteille/wp-orm/issues/51 Add Unit\CustomC…
dimitriBouteille Oct 4, 2024
9c029b1
https://github.com/dimitriBouteille/wp-orm/issues/51 Update Unit\Cust…
dimitriBouteille Oct 4, 2024
0a9b542
https://github.com/dimitriBouteille/wp-orm/issues/51 Add Unit\CustomP…
dimitriBouteille Oct 4, 2024
b3da8fb
https://github.com/dimitriBouteille/wp-orm/issues/51 Update CustomPos…
dimitriBouteille Oct 4, 2024
30f595a
https://github.com/dimitriBouteille/wp-orm/issues/51 Fix CustomPostTe…
dimitriBouteille Oct 4, 2024
3ab85bc
https://github.com/dimitriBouteille/wp-orm/issues/51 Update CustomCom…
dimitriBouteille Oct 4, 2024
908e30f
Merge pull request #86 from dimitriBouteille/v4/51-custom-comment
dimitriBouteille Oct 4, 2024
7d9e4a4
Update dev dependencies
dimitriBouteille Oct 4, 2024
a47f2ee
Update phpunit to 11.x
dimitriBouteille Oct 5, 2024
bb4b866
Update WordPress tests with phpunit 11
dimitriBouteille Oct 5, 2024
5b9a4dd
Update install-wp-tests.sh
dimitriBouteille Oct 5, 2024
78eb574
Test phpunit 10
dimitriBouteille Oct 5, 2024
f559430
Test use phpunit 9 for WordPress tests
dimitriBouteille Oct 5, 2024
96aafcd
Update tests.yml
dimitriBouteille Oct 5, 2024
cc36ca2
Update tests.yml
dimitriBouteille Oct 5, 2024
4b07793
Update tests.yml
dimitriBouteille Oct 5, 2024
eed3f57
Update tests.yml
dimitriBouteille Oct 5, 2024
ccc7414
Rollback phpunit-wp.xml
dimitriBouteille Oct 5, 2024
80b00d9
Rollback tests\WordPress migration to phpunit 11
dimitriBouteille Oct 5, 2024
16c84e8
Remove composer remove in tests.yml
dimitriBouteille Oct 5, 2024
ef4dc1a
Test WordPress throw error
dimitriBouteille Oct 5, 2024
696a9a8
Rollback HasMetasTest.php
dimitriBouteille Oct 5, 2024
2ebe221
Merge pull request #87 from dimitriBouteille/v4/update-dev-dependencies
dimitriBouteille Oct 5, 2024
84f17ff
Update CustomCommentTest
dimitriBouteille Oct 6, 2024
d271fb9
Update CustomCommentTest
dimitriBouteille Oct 6, 2024
b607261
Update CustomCommentTest
dimitriBouteille Oct 6, 2024
3c6bcc4
Update CustomCommentTest::testDelete
dimitriBouteille Oct 6, 2024
432979a
Update HasMetasTest::testDeleteUndefinedMeta
dimitriBouteille Oct 6, 2024
ceff62d
Update HasMetasTest
dimitriBouteille Oct 6, 2024
0969828
Update HasMetasTest::getQueryGetMeta
dimitriBouteille Oct 6, 2024
dc18347
Update tests
dimitriBouteille Oct 6, 2024
b5d21af
Fix TestCase::assertFindLastQuery
dimitriBouteille Oct 6, 2024
4faebce
Fix OptionTest::testFindOneByName
dimitriBouteille Oct 6, 2024
90cd2ba
Fix OptionTest::testFindOneByName
dimitriBouteille Oct 6, 2024
edb7393
Fix CustomPostTest::testAll
dimitriBouteille Oct 6, 2024
ad59dca
Update HasMetasTest::testGetMetaValueWithGenericCasts
dimitriBouteille Oct 7, 2024
329db0d
Update HasMetasTest::testGetMetaValueWithGenericCasts
dimitriBouteille Oct 7, 2024
b684d67
Update HasMetasTest::testGetMetaValueWithGenericCasts
dimitriBouteille Oct 7, 2024
e5a1d0d
Update HasMetasTest::testGetMetaValueWithGenericCasts
dimitriBouteille Oct 7, 2024
1d3beca
Update HasMetasTest::testGetMetaValueWithGenericCasts
dimitriBouteille Oct 7, 2024
8d3bc6c
Update HasMetasTest::testGetMetaValueWithGenericCasts
dimitriBouteille Oct 7, 2024
2615ae8
Rollback HasMetasTest::testGetMetaValueWithGenericCasts
dimitriBouteille Oct 7, 2024
b74d650
HasMetasTest::testGetMetaValueWithGenericCasts remove providerTestGet…
dimitriBouteille Oct 7, 2024
78fbeba
Rollback HasMetasTest::testGetMetaValueWithGenericCasts
dimitriBouteille Oct 7, 2024
254b726
Update HasMetasTest::testGetMetaValueWithGenericCasts
dimitriBouteille Oct 7, 2024
82fc936
Update database tests
dimitriBouteille Oct 7, 2024
ace4ec0
Update database tests
dimitriBouteille Oct 7, 2024
bc3f6f2
Update database tests
dimitriBouteille Oct 7, 2024
5bd5e92
Update database tests
dimitriBouteille Oct 7, 2024
4070248
Update database tests
dimitriBouteille Oct 7, 2024
d2f4fbe
Update database tests
dimitriBouteille Oct 7, 2024
9bf02a0
Update database tests
dimitriBouteille Oct 7, 2024
511e424
Update database tests
dimitriBouteille Oct 7, 2024
821949a
Update database tests
dimitriBouteille Oct 7, 2024
210dbde
Update database tests
dimitriBouteille Oct 7, 2024
d116cda
Update database tests
dimitriBouteille Oct 7, 2024
1133623
Update database tests
dimitriBouteille Oct 7, 2024
8a7552b
Update database tests
dimitriBouteille Oct 7, 2024
f6ed1d0
Update database tests
dimitriBouteille Oct 7, 2024
881d712
Update database tests
dimitriBouteille Oct 7, 2024
e42a0b6
Update database tests
dimitriBouteille Oct 7, 2024
37ca99a
Update database tests
dimitriBouteille Oct 7, 2024
0da5b9c
Update database tests
dimitriBouteille Oct 7, 2024
81791e5
Update database tests
dimitriBouteille Oct 7, 2024
0a42762
Update database tests
dimitriBouteille Oct 7, 2024
38d5573
Update database tests
dimitriBouteille Oct 8, 2024
dc127f5
Update database tests
dimitriBouteille Oct 8, 2024
877886a
Update database tests
dimitriBouteille Oct 8, 2024
dfcfa90
Update database tests
dimitriBouteille Oct 8, 2024
4c27bf2
Update database tests
dimitriBouteille Oct 8, 2024
917aaf4
Update database tests
dimitriBouteille Oct 8, 2024
2a5f9cd
Update database tests
dimitriBouteille Oct 8, 2024
29381c7
Update database tests
dimitriBouteille Oct 8, 2024
65c243d
Merge pull request #89 from dimitriBouteille/V4/add-tests
dimitriBouteille Oct 8, 2024
a2448c4
Update LICENSE and file header
dimitriBouteille Oct 9, 2024
7beb917
Merge pull request #91 from dimitriBouteille/v4/update-licence
dimitriBouteille Oct 9, 2024
b976273
Extends WordPressGrammar from MySqlGrammar
dimitriBouteille Oct 9, 2024
1a2eb34
Update WordPress\Orm\DatabaseTest
dimitriBouteille Oct 9, 2024
91c289e
Merge pull request #92 from dimitriBouteille/v4/update-query-grammars
dimitriBouteille Oct 12, 2024
adcc77a
Start AbstractModelWithCustomTableTest and remove replace quote in Da…
dimitriBouteille Oct 12, 2024
9f596f4
Fix AbstractModelWithCustomTableTest model table
dimitriBouteille Oct 12, 2024
e81955f
WIP AbstractModelWithCustomTableTest
dimitriBouteille Oct 12, 2024
e6b704b
Remove json_extract double quote
dimitriBouteille Oct 12, 2024
d7cce21
Test fix AbstractModelWithCustomTableTest
dimitriBouteille Oct 12, 2024
66ea6bf
Fix AbstractModelWithCustomTableTest table prefix
dimitriBouteille Oct 12, 2024
716ceab
Rollback Database::bindParams escape
dimitriBouteille Oct 12, 2024
7ce6181
Add AbstractModel::truncate()
dimitriBouteille Oct 12, 2024
7b1ff93
Add AbstractModelWithCustomTableTest::testTruncate
dimitriBouteille Oct 12, 2024
23bc38b
Add AbstractModel::insert() and fix tests
dimitriBouteille Oct 12, 2024
0e5fb31
Fix test
dimitriBouteille Oct 12, 2024
b69a5d6
Fix test
dimitriBouteille Oct 12, 2024
50b0478
Merge pull request #93 from dimitriBouteille/v4/88-json-support
dimitriBouteille Oct 12, 2024
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
7 changes: 7 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ jobs:
- name: "Install composer dependencies"
run: composer install --prefer-dist --no-progress

# WordPress tests works only with PHPUnit 9.x :(
# https://github.com/dimitriBouteille/wp-orm/actions/runs/11192354429/job/31116408495
- name: "Install PHPUnit v9"
run: |
composer require --dev phpunit/phpunit ^9.0 -W
composer require --dev yoast/phpunit-polyfills ^3.0 -W
- name: "Install WP"
shell: bash
run: ./config/scripts/install-wp-tests.sh wordpress_test root '' 127.0.0.1:3306 ${{ matrix.wp_version }}
Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
;

$header = <<<EOF
Copyright (c) 2024 Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
Copyright © Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
See LICENSE.txt for license details.

Author: Dimitri BOUTEILLE <bonjour@dimitri-bouteille.fr>
Expand Down
File renamed without changes.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

![GitHub Release](https://img.shields.io/github/v/release/dimitriBouteille/wp-orm) [![tests](https://img.shields.io/github/actions/workflow/status/dimitriBouteille/wp-orm/tests.yml?label=tests)](https://github.com/dimitriBouteille/wp-orm/actions/workflows/tests.yml) [![Packagist Downloads](https://img.shields.io/packagist/dt/dbout/wp-orm?color=yellow)](https://packagist.org/packages/dbout/wp-orm) ![Eloquent version](https://img.shields.io/packagist/dependency-v/dbout/wp-orm/illuminate%2Fdatabase?color=orange)

> [!IMPORTANT]
> The phinx package will be removed in a future release in order to use the Laravel migration system. It is therefore advisable to stop using the tool. [More info](https://github.com/dimitriBouteille/wp-orm/issues/27).

WordPress ORM with Eloquent is a small library that adds a basic ORM into WordPress, which is easily extendable and includes models for core WordPress models such as posts, post metas, users, comments and more.
The ORM is based on [Eloquent ORM](https://laravel.com/docs/eloquent) and uses the WordPress connection (`wpdb` class).

Expand Down Expand Up @@ -39,7 +36,6 @@ This documentation only covers the specific points of this library, if you want
- [Create custom model](doc/create-model.md)
- [Generic Model](doc/create-model.md#generic-model)
- [Custom Post Type Model](doc/create-model.md#custom-post-type-model)
- [~~Migration with Phinx~~](doc/migration.md)

## Installation

Expand Down
31 changes: 13 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dbout/wp-orm",
"description": "WordPress ORM with Eloquent and Phinx.",
"description": "WordPress ORM with Eloquent.",
"type": "package",
"license": "MIT",
"authors": [
Expand All @@ -11,7 +11,7 @@
"role": "Developer"
}
],
"keywords": ["wordpress", "wp", "orm", "database", "eloquent", "db", "sql", "migration", "phinx"],
"keywords": ["wordpress", "wp", "orm", "database", "eloquent", "db", "sql", "migration"],
"homepage": "https://github.com/dimitriBouteille/wp-orm",
"support": {
"issues": "https://github.com/dimitriBouteille/wp-orm/issues",
Expand All @@ -21,17 +21,13 @@
"prefer-stable": true,
"require": {
"php": ">=8.2",
"robmorgan/phinx": "^0.12.5",
"illuminate/database": "^11.0",
"laravel/serializable-closure": "^1.3"
"laravel/serializable-closure": "^1.3",
"illuminate/database": "^11.0"
},
"suggest": {
"illuminate/events": "Add events to your models"
},
"autoload": {
"files": [
"src/includes/migrations.php"
],
"psr-4": {
"Dbout\\WpOrm\\": "src/"
}
Expand All @@ -42,20 +38,19 @@
}
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.28",
"phpstan/phpstan": ">=1.10.59",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/extension-installer": "^1.3",
"rector/rector": "^1.0",
"friendsofphp/php-cs-fixer": "^3.64",
"phpstan/phpstan": "^1.12",
"phpstan/extension-installer": "^1.4",
"szepeviktor/phpstan-wordpress": "^1.3",
"phpunit/phpunit": "^9.6",
"yoast/phpunit-polyfills": "^2.0",
"roots/wordpress": "^6.5"
"rector/rector": "^1.2",
"roots/wordpress": "^6.6",
"phpunit/phpunit": "^11.0",
"yoast/phpunit-polyfills": "^3.0"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true,
"roots/wordpress-core-installer": true
"roots/wordpress-core-installer": true,
"phpstan/extension-installer": true
}
},
"extra": {
Expand Down
23 changes: 18 additions & 5 deletions config/scripts/install-wp-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,22 @@ WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib}
WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress}

download() {
if [ `which curl` ]; then
curl -s "$1" > "$2";
elif [ `which wget` ]; then
wget -nv -O "$2" "$1"
fi
if [ `which curl` ]; then
curl -s "$1" > "$2";
elif [ `which wget` ]; then
wget -nv -O "$2" "$1"
else
echo "Error: Neither curl nor wget is installed."
exit 1
fi
}

# Check if svn is installed
check_svn_installed() {
if ! command -v svn > /dev/null; then
echo "Error: svn is not installed. Please install svn and try again."
exit 1
fi
}

if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+\-(beta|RC)[0-9]+$ ]]; then
Expand Down Expand Up @@ -72,6 +83,7 @@ install_wp() {
if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
mkdir -p $TMPDIR/wordpress-trunk
rm -rf $TMPDIR/wordpress-trunk/*
check_svn_installed
svn export --quiet https://core.svn.wordpress.org/trunk $TMPDIR/wordpress-trunk/wordpress
mv $TMPDIR/wordpress-trunk/wordpress/* $WP_CORE_DIR
else
Expand Down Expand Up @@ -116,6 +128,7 @@ install_test_suite() {
# set up testing suite
mkdir -p $WP_TESTS_DIR
rm -rf $WP_TESTS_DIR/{includes,data}
check_svn_installed
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data
fi
Expand Down
55 changes: 0 additions & 55 deletions doc/migration.md

This file was deleted.

2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ parameters:
- src
- tests
excludePaths:
- tests/WordPress
- tests/WordPress/TestCase
16 changes: 7 additions & 9 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="./tests/Unit/Bootstrap.php"
cacheResultFile="var/cache/phpunit/unit"
cacheDirectory="var/cache/phpunit/unit"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertDeprecationsToExceptions="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="true"
stopOnDeprecation="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="true">
stopOnSkipped="false">
<testsuites>
<testsuite name="Tests">
<directory>tests/Unit/</directory>
Expand Down
2 changes: 1 addition & 1 deletion src/Api/CustomModelTypeInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2024 Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* Copyright © Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* See LICENSE.txt for license details.
*
* Author: Dimitri BOUTEILLE <bonjour@dimitri-bouteille.fr>
Expand Down
2 changes: 1 addition & 1 deletion src/Api/WithMetaModelInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2024 Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* Copyright © Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* See LICENSE.txt for license details.
*
* Author: Dimitri BOUTEILLE <bonjour@dimitri-bouteille.fr>
Expand Down
2 changes: 1 addition & 1 deletion src/Builders/AbstractBuilder.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2024 Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* Copyright © Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* See LICENSE.txt for license details.
*
* Author: Dimitri BOUTEILLE <bonjour@dimitri-bouteille.fr>
Expand Down
2 changes: 1 addition & 1 deletion src/Builders/AbstractWithMetaBuilder.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2024 Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* Copyright © Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* See LICENSE.txt for license details.
*
* Author: Dimitri BOUTEILLE <bonjour@dimitri-bouteille.fr>
Expand Down
2 changes: 1 addition & 1 deletion src/Builders/CommentBuilder.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2024 Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* Copyright © Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* See LICENSE.txt for license details.
*
* Author: Dimitri BOUTEILLE <bonjour@dimitri-bouteille.fr>
Expand Down
15 changes: 1 addition & 14 deletions src/Builders/OptionBuilder.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2024 Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* Copyright © Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* See LICENSE.txt for license details.
*
* Author: Dimitri BOUTEILLE <bonjour@dimitri-bouteille.fr>
Expand All @@ -12,19 +12,6 @@

class OptionBuilder extends AbstractBuilder
{
/**
* @param string $optionName
* @return Option|null
* @deprecated Remove in next version
* @see Option::findOneByName()
*/
public function findOneByName(string $optionName): ?Option
{
/** @var Option|null $model */
$model = $this->firstWhere(Option::NAME, $optionName);
return $model;
}

/**
* @param string $optionName
* @return $this
Expand Down
19 changes: 1 addition & 18 deletions src/Builders/PostBuilder.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2024 Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* Copyright © Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* See LICENSE.txt for license details.
*
* Author: Dimitri BOUTEILLE <bonjour@dimitri-bouteille.fr>
Expand All @@ -13,23 +13,6 @@

class PostBuilder extends AbstractWithMetaBuilder
{
/**
* @param string|null $name
* @return Post|null
* @deprecated Remove in next version
* @see Post::findOneByName()
*/
public function findOneByName(?string $name): ?Post
{
if (!$name) {
return null;
}

/** @var Post|null $model */
$model = $this->firstWhere(Post::POST_NAME, $name);
return $model;
}

/**
* @param string $type
* @return Collection
Expand Down
2 changes: 1 addition & 1 deletion src/Builders/TermBuilder.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2024 Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* Copyright © Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* See LICENSE.txt for license details.
*
* Author: Dimitri BOUTEILLE <bonjour@dimitri-bouteille.fr>
Expand Down
28 changes: 1 addition & 27 deletions src/Builders/UserBuilder.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2024 Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* Copyright © Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* See LICENSE.txt for license details.
*
* Author: Dimitri BOUTEILLE <bonjour@dimitri-bouteille.fr>
Expand All @@ -12,32 +12,6 @@

class UserBuilder extends AbstractWithMetaBuilder
{
/**
* @param string $email
* @return User|null
* @deprecated Remove in next version
* @see User::findOneByEmail()
*/
public function findOneByEmail(string $email): ?User
{
/** @var User|null $model */
$model = $this->firstWhere(User::EMAIL, $email);
return $model;
}

/**
* @param string $login
* @return User|null
* @deprecated Remove in next version
* @see User::findOneByLogin()
*/
public function findOneByLogin(string $login): ?User
{
/** @var User|null $model */
$model = $this->firstWhere(User::LOGIN, $login);
return $model;
}

/**
* @param string $email
* @return $this
Expand Down
Loading