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 3.0.1 #23

Merged
merged 7 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ vendor/
var/
.idea/
composer.lock
.php-cs-fixer.cache
.php-cs-fixer.cache
web
5 changes: 3 additions & 2 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2023 Dimitri BOUTEILLE
* Copyright (c) 2024 Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* See LICENSE.txt for license details.
*
* Author: Dimitri BOUTEILLE <[email protected]>
Expand All @@ -9,7 +9,8 @@
$finder = \PhpCsFixer\Finder::create()
->name('*.php')
->in([
'src',
__DIR__ . '/src',
__DIR__ . '/tests',
])
;

Expand Down
18 changes: 13 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,33 @@
"Dbout\\WpOrm\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Dbout\\WpOrm\\Tests\\": "tests/"
}
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.28",
"phpstan/phpstan": "^1.10",
"rector/rector": "^0.18.4",
"phpstan/phpstan": ">=1.10.59",
"phpunit/phpunit": "^10.5",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/extension-installer": "^1.3"
"phpstan/extension-installer": "^1.3",
"roots/wordpress": "6.4",
"rector/rector": "1.0.2"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
"phpstan/extension-installer": true,
"roots/wordpress-core-installer": true
}
},
"extra": {
"phpstan": {
"includes": [
"extension.neon"
]
}
},
"wordpress-install-dir": "web/wordpress"
},
"scripts": {
"rector": "vendor/bin/rector process src --dry-run",
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ parameters:
level: 5
paths:
- src
- tests
excludePaths:
- src/Orm/Database.php
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<phpunit cacheResult="false" stopOnError="true">
<testsuites>
<testsuite name="Tests">
<directory>src/</directory>
<directory>tests/</directory>
</testsuite>
</testsuites>
</phpunit>
23 changes: 13 additions & 10 deletions rector.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2023 Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* Copyright (c) 2024 Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* See LICENSE.txt for license details.
*
* Author: Dimitri BOUTEILLE <[email protected]>
Expand All @@ -10,14 +10,17 @@
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;

return static function (RectorConfig $rectorConfig): void {
// register single rule
$rectorConfig->rule(TypedPropertyFromStrictConstructorRector::class);

// here we can define, what sets of rules will be applied
// tip: use "SetList" class to autocomplete sets with your IDE
$rectorConfig->sets([
SetList::CODE_QUALITY,
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withRules([
TypedPropertyFromStrictConstructorRector::class,
])
->withPreparedSets(
codeQuality: true,
)
->withSets([
SetList::PHP_81,
]);
};
12 changes: 12 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
":disableDependencyDashboard"
],
"minimumReleaseAge": "30 days",
"labels": ["dependencies"],
"prConcurrentLimit": 5,
"baseBranches": ["develop"],
"assignees": ["dimitriBouteille"]
}
2 changes: 1 addition & 1 deletion src/Models/TermTaxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class TermTaxonomy extends AbstractModel
];

/**
* @var string[]
* @inheritDoc
*/
protected $fillable = [
self::TERM_TAXONOMY_ID,
Expand Down
2 changes: 1 addition & 1 deletion src/Orm/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function __call($method, $parameters)

$type = $matchGetter[1];
$attribute = $matchGetter[2];
$attribute = strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $attribute));
$attribute = strtolower((string)preg_replace('/(?<!^)[A-Z]/', '_$0', $attribute));

if ($type === 'get') {
return $this->getAttribute($attribute);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Author: Dimitri BOUTEILLE <[email protected]>
*/

namespace Dbout\WpOrm\Tests\Unit\Builders;
namespace Dbout\WpOrm\Tests\Builders;

use Dbout\WpOrm\Builders\PostBuilder;
use Dbout\WpOrm\Exceptions\WpOrmException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Author: Dimitri BOUTEILLE <[email protected]>
*/

namespace Dbout\WpOrm\Tests\Unit\Models;
namespace Dbout\WpOrm\Tests\Models;

use Dbout\WpOrm\Exceptions\CannotOverrideCustomTypeException;
use Dbout\WpOrm\Models\Attachment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Author: Dimitri BOUTEILLE <[email protected]>
*/

namespace Dbout\WpOrm\Tests\Unit\Scopes;
namespace Dbout\WpOrm\Tests\Scopes;

use Dbout\WpOrm\Builders\OptionBuilder;
use Dbout\WpOrm\Builders\PostBuilder;
Expand Down
Loading