Skip to content

Commit

Permalink
Merge pull request #23 from dimitriBouteille/develop
Browse files Browse the repository at this point in the history
3.0.1
  • Loading branch information
dimitriBouteille authored Mar 4, 2024
2 parents dc099ff + 4711324 commit 0a5defc
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 24 deletions.
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

0 comments on commit 0a5defc

Please sign in to comment.