PluginProbe
Product Specifications for Woocommerce / 0.8.3
Product Specifications for Woocommerce v0.8.3
0.8.10 trunk 0.4.0 0.4.1 0.4.2 0.4.3 0.5.0 0.5.1 0.5.2 0.5.3 0.6.0 0.7.0 0.7.1 0.7.2 0.7.3 0.7.4 0.8.0 0.8.1 0.8.2 0.8.3 0.8.4 0.8.5 0.8.6 0.8.7 0.8.9
product-specifications / src / Shortcode / Module.php

Module.php in Product Specifications for Woocommerce 0.8.3, at src/Shortcode/Module.php

28 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare (strict_types=1);
4 namespace Amiut\ProductSpecs\Shortcode;
5
6 use Amiut\ProductSpecs\Repository\SpecificationsTableRepository;
7 use Amiut\ProductSpecs\Template\TemplateRenderer;
8 use ProductSpecifications\Vendor\Inpsyde\Modularity\Module\ExecutableModule;
9 use ProductSpecifications\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait;
10 use ProductSpecifications\Vendor\Inpsyde\Modularity\Module\ServiceModule;
11 use Psr\Container\ContainerInterface;
12 final class Module implements ServiceModule, ExecutableModule
13 {
14 use ModuleClassNameIdTrait;
15 public function services(): array
16 {
17 return [\Amiut\ProductSpecs\Shortcode\SpecificationsTable::class => static fn(ContainerInterface $container) => new \Amiut\ProductSpecs\Shortcode\SpecificationsTable($container->get(TemplateRenderer::class), $container->get(SpecificationsTableRepository::class))];
18 }
19 public function run(ContainerInterface $container): bool
20 {
21 $tableShortcode = $container->get(\Amiut\ProductSpecs\Shortcode\SpecificationsTable::class);
22 add_action('init', static function () use ($tableShortcode) {
23 add_shortcode(\Amiut\ProductSpecs\Shortcode\SpecificationsTable::KEY, [$tableShortcode, 'render']);
24 });
25 return \true;
26 }
27 }
28