Skip to content

Commit

Permalink
Merge branch 'release/3.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jazz-Man committed Jul 13, 2023
2 parents 5745fc8 + 381e03c commit cbbf0d2
Show file tree
Hide file tree
Showing 15 changed files with 865 additions and 570 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ composer.phar
/.php[_|-]cs*.cache
/cache/
!.github/
phpstan.neon
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "^7.4|^8",
"php": "^8.1",
"jazzman/autoload-interface": "^0.3.1",
"jazzman/pluralizer": "^1.0"
},
Expand All @@ -23,12 +23,13 @@
]
},
"require-dev": {
"jazzman/php-cs-fixer-rules": "^0.1.4",
"phpstan/extension-installer": "^1.2",
"rector/rector": "^0.15.10",
"jazzman/php-cs-fixer-rules": "^0.2.0",
"jetbrains/phpstorm-attributes": "^1.0",
"phpstan/extension-installer": "^1.3",
"rector/rector": "^0.16.0",
"roave/security-advisories": "@dev",
"roots/wordpress": "^6.1",
"szepeviktor/phpstan-wordpress": "^1.1"
"roots/wordpress": "^6.2",
"szepeviktor/phpstan-wordpress": "^1.3"
},
"extra": {
"installer-paths": {
Expand Down
6 changes: 3 additions & 3 deletions custom-post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
use JazzMan\Post\PostTypeMessages;
use JazzMan\Post\ReusableBlocks;

if (function_exists('app_autoload_classes')) {
app_autoload_classes([
if ( function_exists( 'app_autoload_classes' ) ) {
app_autoload_classes( [
ArchivePostType::class,
ReusableBlocks::class,
PostTypeMessages::class,
]);
] );
}
4 changes: 2 additions & 2 deletions phpstan.neon.dist → phpstan-dist.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
includes:
- phar://phpstan.phar/conf/bleedingEdge.neon
- %currentWorkingDirectory%/phpstan-baseline.neon

parameters:
Expand All @@ -13,4 +12,5 @@ parameters:
- cache
- .php-cs-fixer.php
paths:
- src
- src
- custom-post-type.php
3 changes: 3 additions & 0 deletions phpstan-rector.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
includes:
- phar://vendor/rector/vendor/phpstan/phpstan.phar/conf/bleedingEdge.neon
- phpstan-dist.neon
3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
includes:
- phar://phpstan.phar/conf/bleedingEdge.neon
- phpstan-dist.neon
37 changes: 5 additions & 32 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,43 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.5.0@b63061a27f2683ec0f3509012bb22daab3b65b61">
<files psalm-version="5.12.0@f90118cdeacd0088e7215e64c0c99ceca819e176">
<file src="src/ArchivePostType.php">
<ArgumentTypeCoercion>
<code>$postarr</code>
</ArgumentTypeCoercion>
<InvalidArgument>
<code>[
'description' =&gt; 'Archive posts associated with each post type.',
'public' =&gt; false,
'show_in_nav_menus' =&gt; false,
'show_in_admin_bar' =&gt; false,
'exclude_from_search' =&gt; true,
'show_ui' =&gt; true,
'show_in_menu' =&gt; true,
'can_export' =&gt; true,
'delete_with_user' =&gt; false,
'hierarchical' =&gt; false,
'has_archive' =&gt; false,
'menu_icon' =&gt; 'dashicons-media-text',
'query_var' =&gt; 'hdptap_cpt_archive',
'menu_position' =&gt; 26,
'show_in_rest' =&gt; true,
'labels' =&gt; $labels,
'supports' =&gt; $supports,
]</code>
<code>false</code>
</InvalidArgument>
<UndefinedPropertyFetch>
<code>$object-&gt;add_archive_page</code>
<code>$wpPostType-&gt;add_archive_page</code>
<code>$wpPostType-&gt;add_archive_page</code>
<code><![CDATA[$object->add_archive_page]]></code>
<code><![CDATA[$wpPostType->add_archive_page]]></code>
<code><![CDATA[$wpPostType->add_archive_page]]></code>
</UndefinedPropertyFetch>
</file>
<file src="src/CustomPostType.php">
<ArgumentTypeCoercion>
<code>$options</code>
</ArgumentTypeCoercion>
<NoValue>
<code>$col</code>
</NoValue>
<NoValue/>
</file>
</files>
5 changes: 3 additions & 2 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
cacheDirectory="cache/psalm"
serializer="igbinary"
errorBaseline="psalm-baseline.xml"
errorLevel="2"
phpVersion="7.4"
errorLevel="1"
phpVersion="8.2"
addParamDefaultToDocblockType="true"
autoloader="vendor/szepeviktor/phpstan-wordpress/bootstrap.php"
>
<projectFiles>
Expand Down
43 changes: 21 additions & 22 deletions rector.php
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
<?php

declare(strict_types=1);
declare( strict_types=1 );

use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;

return static function (RectorConfig $config): void {
// here we can define, what sets of rules will be applied
// tip: use "SetList" class to autocomplete sets
return static function ( RectorConfig $config ): void {

$config->sets([
$config->sets( [
SetList::CODE_QUALITY,
SetList::PHP_74,
SetList::CODING_STYLE,
SetList::TYPE_DECLARATION,
SetList::EARLY_RETURN,
SetList::NAMING,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
LevelSetList::UP_TO_PHP_74,
]);
$config->fileExtensions(['php']);
$config->phpVersion(PhpVersion::PHP_74);
SetList::INSTANCEOF,
SetList::PRIVATIZATION,
LevelSetList::UP_TO_PHP_82,
] );
$config->fileExtensions( ['php'] );

$config->importNames();
$config->importShortClasses(false);
$config->parallel();
$config->cacheDirectory(__DIR__.'/cache/rector');
$config->paths([
__DIR__,
]);
$config->removeUnusedImports();
$config->importShortClasses( false );

$config->cacheDirectory( __DIR__.'/cache/rector' );
$config->phpstanConfig( __DIR__.'/phpstan-rector.neon' );

$config->paths( [
__DIR__.'/custom-post-type.php',
__DIR__.'/src',
] );

$config->skip(
[
Expand All @@ -40,7 +39,7 @@
__DIR__.'/cache',
__DIR__.'/rector.php',
__DIR__.'/.php-cs-fixer.php',
ClosureToArrowFunctionRector::class
__DIR__.'/sample.php',
]
);
};
Loading

0 comments on commit cbbf0d2

Please sign in to comment.