Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6496fc6
introduce comments template and patterns
overclokk Dec 10, 2023
7abb7aa
Refactor event dispatcher interface usage and improve code readability
overclokk Mar 10, 2026
f6df464
Refactor namespace imports in ThemeJson.php
overclokk Mar 10, 2026
6304ad1
Add return type declaration to __invoke method in Footer.php
overclokk Mar 11, 2026
3cf5084
Refactor condition to check for empty colophon content
overclokk Mar 11, 2026
4a9dda5
Update composer.json for stability and dependency adjustments
overclokk Mar 11, 2026
121fb8e
Add 'None' option to ExperimentalCustomizerOptionWithAndPositionSubsc…
overclokk Mar 11, 2026
835a6fb
Refactor appendContent method to improve variable naming and comment …
overclokk Mar 11, 2026
e61f78d
Remove version specification from docker-compose.yml
overclokk Mar 11, 2026
f18ed18
Add restart and ssh targets to Makefile for container management
overclokk Mar 12, 2026
54d81a7
Enable cache path in FunctionMocker initialization and restore WP_Cus…
overclokk Mar 12, 2026
6c8ebe4
Refactor BaseUnitTrait: update method signatures and format namespace…
overclokk Mar 12, 2026
b997b68
Refactor injector classes to remove EmpressInjector dependency
overclokk Mar 12, 2026
31be50a
Implement listener register mock in ComponentSubscriberExtensionTest
overclokk Mar 12, 2026
6392058
Exclude test output directory from PHPCS checks
overclokk Mar 12, 2026
6c3df35
Refactor Search class to use ViewBlockInterface and update related tests
overclokk Mar 12, 2026
d37d512
Refactor Comments component to use ViewBlockInterface and add unit tests
overclokk Mar 12, 2026
ccfc19d
PHPCS
overclokk Mar 12, 2026
234ae12
Add tests for FooterWidgetArea and NavMenuHeader components
overclokk Mar 12, 2026
ca69ba2
Fix view instantiation in ContentTest and add navbar element checks i…
overclokk Mar 12, 2026
f80a681
PHPCS
overclokk Mar 12, 2026
6f7201e
Update event name in Pagination class to use PostsContentAfter
overclokk Mar 12, 2026
e8223d2
chore: update .gitignore
overclokk Mar 12, 2026
61afc17
Merge pull request #38 from ItalyStrap/italystrap-patterns
overclokk Mar 12, 2026
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
1 change: 0 additions & 1 deletion .docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
services:

wordpress:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ package-lock.json
c3.php
**/*.local.php
/.idea/
*.bak
*.bak
/.sisyphus/*
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ down: ### Stop the containers inside the ./docker folder
@$(DOCKER_DIR) docker-compose down --remove-orphans --volumes
@echo "Containers stopped"

.PHONY: restart
restart: down up ### Restart the containers inside the ./docker folder
@echo "Containers restarted"

# Composer commands

.PHONY: composer/install
Expand Down Expand Up @@ -164,6 +168,11 @@ metrics: up ### Run the composer/metrics
@echo "Running the psalm"
@$(DOCKER_DIR) ./composer metrics

.PHPHONY: ssh
ssh: ### Run bash in the php74 container
@echo "Running bash in the php74 container"
@$(DOCKER_DIR) ./ssh

# Generate commands

.PHONY: generate
Expand Down
2 changes: 0 additions & 2 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

use Auryn\Injector;
use ItalyStrap\Config\ConfigInterface;
use ItalyStrap\Event\EventDispatcher;
use ItalyStrap\Event\EventDispatcherInterface;
use ItalyStrap\Event\ListenerRegisterInterface;
use function _n;
use function do_blocks;
Expand Down
32 changes: 18 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"homepage": "https://github.com/ItalyStrap/italystrap/graphs/contributors"
}
],
"minimum-stability": "stable",
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": [
{
"type": "package",
Expand All @@ -28,26 +29,29 @@
"url": "https://github.com/WordPress/WordPress/archive/master.zip"
}
}
},
{
"type": "vcs",
"url": "https://github.com/ItalyStrap/empress"
}
],
"require": {
"php" : ">=7.4",
"italystrap/empress": "dev-modularized",
"italystrap/empress": "dev-modularized as 2.0.x-dev",
"italystrap/event": "dev-master",
"italystrap/config": "^2.0",
"italystrap/helpers": "^1.0",
"italystrap/html": "^1.0",
"italystrap/view": "^1.0",
"italystrap/finder": "dev-master",
"italystrap/asset": "dev-master",
"rdlowrey/auryn": "^1.4",
"overclokk/minimum-requirements": "dev-master",
"cmb2/cmb2": "2.6.0",
"yiisoft/json": "^1.0",
"symfony/polyfill-php80": "^1.0"
},
"require-dev": {
"lucatume/wp-browser": "^3.0.0",
"lucatume/wp-browser": "<3.5",
"lucatume/function-mocker-le": "^1.0.0",
"lucatume/function-mocker": "^1.3",
"codeception/c3": "2.*",
Expand Down Expand Up @@ -146,39 +150,39 @@
"@php vendor/bin/phpcbf -p"
],
"psalm": [
"@php vendor//bin//psalm --no-cache"
"@php vendor/bin/psalm --no-cache"
],
"analyze": [
"@php vendor//bin//phpstan analyze --level=max && vendor//bin//psalm"
"@php vendor/bin/phpstan analyze --level=max && vendor//bin//psalm"
],
"infection": [
"@php vendor//bin//infection --threads=8"
"@php vendor/bin/infection --threads=8"
],
"unit": [
"@php vendor//bin//codecept run unit",
"@php vendor/bin/codecept run unit",
"@clean"
],
"unit:cov": [
"@php vendor//bin//codecept run unit --coverage",
"@php vendor/bin/codecept run unit --coverage",
"@clean"
],
"unit:debug": [
"@php vendor//bin//codecept run unit --debug",
"@php vendor/bin/codecept run unit --debug",
"@clean"
],
"integration": [
"@php vendor//bin//codecept run integration",
"@php vendor/bin/codecept run integration",
"@clean"
],
"integration:debug": [
"@php vendor//bin//codecept run integration --debug",
"@php vendor/bin/codecept run integration --debug",
"@clean"
],
"functional": [
"@php vendor//bin//codecept run functional"
"@php vendor/bin/codecept run functional"
],
"bench": [
"@php vendor//bin//phpbench run --report=performance"
"@php vendor/bin/phpbench run --report=performance"
],
"metrics": [
"@php vendor//bin//phpmetrics --report-html='./tests/_output/report' ./src",
Expand Down
1 change: 0 additions & 1 deletion config/autoload/dependencies.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace ItalyStrap;

use Auryn\Injector;
use ItalyStrap\Config\Config;
use ItalyStrap\Config\ConfigInterface;
use ItalyStrap\Customizer\CustomizerAssetsSubscriber;
Expand Down
12 changes: 7 additions & 5 deletions config/dependencies.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

use Auryn\Injector;
use ItalyStrap\Asset\Module as AssetModule;
use ItalyStrap\Config\ConfigFactory;
use ItalyStrap\Config\ConfigInterface;
use ItalyStrap\Config\ConfigProviderExtension;
use ItalyStrap\Config\ConfigThemeModsProvider;
use ItalyStrap\Empress\Injector;
use ItalyStrap\Empress\PhpFileProvider;
use ItalyStrap\Empress\ProvidersCacheInterface;
use ItalyStrap\Empress\ProvidersCollection;
Expand All @@ -18,9 +18,11 @@
use ItalyStrap\UI\Module as UIModule;

return static function (Injector $injector): ConfigInterface {
$config = (new ConfigFactory())->make();
$collection = new ProvidersCollection(
$injector,
ConfigFactory::make(),
$config,
null,
[
// First we load Modules from packages
EventModule::class,
Expand All @@ -34,9 +36,9 @@
'/config/autoload/{{,*.}global,{,*.}local}.php',
$injector->execute(ExperimentalThemeFileFinderFactory::class)
),
// ProvidersCacheInterface::CACHE_PATH => get_template_directory() . '/config/cache/config-cache.php',
// ProvidersCacheInterface::CACHE_PATH => get_template_directory() . '/config/cache/config-cache.php',
fn(): array => [
// ProvidersCacheInterface::CACHE_PATH => get_template_directory() . '/config/cache/config-cache.php',
// ProvidersCacheInterface::CACHE_PATH => get_template_directory() . '/config/cache/config-cache.php',
ProvidersCacheInterface::ENABLE_CACHE => true,
],
/** This must run after all */
Expand All @@ -51,5 +53,5 @@

$collection->build();

return $collection->collection();
return $config;
};
9 changes: 1 addition & 8 deletions functions/factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@
namespace ItalyStrap\Factory;

use Auryn\ConfigException;
use Auryn\InjectionException;
use Auryn\Injector as AurynInjector;
use Exception;
use ItalyStrap\Config\ConfigInterface;
use ItalyStrap\Debug\Injector as DebugInjector;
use ItalyStrap\Empress\Injector as EmpressInjector;
use ItalyStrap\Config\Config;
use ItalyStrap\View\View;

use function ItalyStrap\Core\is_debug;

Expand All @@ -35,8 +29,7 @@ function injector(): AurynInjector
$injector = apply_filters('italystrap_injector', false);

if (!$injector) {
$injector = new EmpressInjector();
$injector->alias(AurynInjector::class, EmpressInjector::class);
$injector = new AurynInjector();
$injector->share($injector);
add_filter('italystrap_injector', function () use ($injector) {
return $injector;
Expand Down
50 changes: 1 addition & 49 deletions parts/comments.html
Original file line number Diff line number Diff line change
@@ -1,49 +1 @@
<!-- wp:comments-query-loop -->
<div class="wp-block-comments-query-loop">

<!-- wp:comments-title /-->

<!-- wp:comment-template -->
<!-- wp:columns -->
<div class="wp-block-columns">
<!-- wp:column {"width":"40px"} -->
<div class="wp-block-column" style="flex-basis:40px">
<!-- wp:avatar {"size":40,"style":{"border":{"radius":"20px"}}} /-->
</div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column">
<!-- wp:comment-author-name /-->

<!-- wp:group {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}}},"layout":{"type":"flex"}} -->
<div class="wp-block-group" style="margin-top:0px;margin-bottom:0px">
<!-- wp:comment-date /-->

<!-- wp:comment-edit-link /-->
</div>
<!-- /wp:group -->

<!-- wp:comment-content /-->

<!-- wp:comment-reply-link /-->
</div>
<!-- /wp:column -->

</div>
<!-- /wp:columns -->

<!-- /wp:comment-template -->

<!-- wp:comments-pagination -->
<!-- wp:comments-pagination-previous /-->

<!-- wp:comments-pagination-numbers /-->

<!-- wp:comments-pagination-next /-->
<!-- /wp:comments-pagination -->

<!-- wp:post-comments-form /-->

</div>
<!-- /wp:comments-query-loop -->
<!-- wp:pattern {"slug":"italystrap/hidden-comments"} /-->
64 changes: 64 additions & 0 deletions patterns/hidden-comments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

/**
* Title: Hidden Comments
* Slug: italystrap/hidden-comments
* Inserter: no
*/

?>
<!-- wp:comments -->
<div class="wp-block-comments">

<!-- wp:comments-title {"level":3} /-->

<!-- wp:comment-template -->

<!-- wp:columns {"isStackedOnMobile":false} -->
<div class="wp-block-columns is-not-stacked-on-mobile">

<!-- wp:column {"width":"clamp(48px, 17.917vw - 3.125rem, 96px)"} -->
<div class="wp-block-column" style="flex-basis:clamp(48px, 17.917vw - 3.125rem, 96px)">
<!-- wp:avatar {"className":"img-fluid"} /-->
</div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column">

<!-- wp:group {"layout":{"type":"flex"}} -->
<div class="wp-block-group">

<!-- wp:comment-author-name /-->

<!-- wp:comment-date {"format":"j M Y"} /-->

<!-- wp:comment-edit-link /-->

<!-- wp:comment-reply-link /-->

</div>
<!-- /wp:group -->

<!-- wp:comment-content /-->

</div>
<!-- /wp:column -->

</div>
<!-- /wp:columns -->

<!-- /wp:comment-template -->

<!-- wp:comments-pagination -->
<!-- wp:comments-pagination-previous /-->

<!-- wp:comments-pagination-numbers /-->

<!-- wp:comments-pagination-next /-->
<!-- /wp:comments-pagination -->

<!-- wp:pattern {"slug":"italystrap/hidden-post-comments-form"} /-->

</div>
<!-- /wp:comments -->
25 changes: 25 additions & 0 deletions patterns/hidden-post-comments-form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/**
* Title: Post Comments Form
* Slug: italystrap/hidden-post-comments-form
* Inserter: no
*
* This pattern is used to customize the post comments form.
* In a PHP file the function to load the comments template (comments.php) is `comments_template();`
* the function to render only the form from the WP core is `comment_form();`
*/

declare(strict_types=1);

/**
* Exchange reposition of the 'comment' field
*/
\add_filter('comment_form_fields', static function (array $fields): array {
$comment_field = $fields['comment'] ?? '';
unset($fields['comment']);
$fields['comment'] = $comment_field;
return $fields;
}, PHP_INT_MAX, 1);
?>
<!-- wp:post-comments-form /-->
24 changes: 24 additions & 0 deletions patterns/hidden-search.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/**
* Title: Search
* Slug: italystrap/hidden-search
* Inserter: no
*
* @todo See the file templates/elements/search.php
* In the future try to use View to include the template file here.
*/

declare(strict_types=1);

$attributes = [
'label' => \esc_attr_x('Search again with the form below.', 'search form label', 'italystrap'),
'placeholder' => \esc_attr_x('Search &hellip;', 'placeholder for search form', 'italystrap'),
'buttonText' => \esc_attr_x('Search', 'search button text', 'italystrap'),
'buttonPosition' => 'button-inside',
'buttonUseIcon' => true,
'fontSize' => 'small'
];

?>
<!-- wp:search <?= (string)\json_encode($attributes) ?> /-->
Loading
Loading