This commit is contained in:
2026-09-15 10:26:34 +08:00
commit ecf36afa56
10493 changed files with 1404888 additions and 0 deletions
@@ -0,0 +1,36 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magento\TestModuleSimpleTemplateDirective\Model;
use Magento\Framework\Filter\SimpleDirective\ProcessorInterface;
use Magento\Framework\Filter\Template;
/**
* Filters a value for testing purposes
*/
class FooFilter implements \Magento\Framework\Filter\DirectiveProcessor\FilterInterface
{
/**
* @inheritDoc
*/
public function filterValue(string $value, array $params): string
{
$arg1 = $params[0] ?? null;
return strtoupper(strrev($value . $arg1 ?? ''));
}
/**
* @inheritDoc
*/
public function getName(): string
{
return 'foofilter';
}
}
@@ -0,0 +1,39 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magento\TestModuleSimpleTemplateDirective\Model;
use Magento\Framework\Filter\Template;
/**
* A legacy directive test entity
*/
class LegacyFilter extends Template
{
/**
* Filter a directive
*
* @param $construction
* @return string
*/
protected function coolDirective($construction)
{
return 'value1: ' . $construction[1] . ':' . $construction[2];
}
/**
* Filter a directive
*
* @param $construction
* @return string
*/
public function coolerDirective($construction)
{
return 'value2: ' . $construction[1] . ':' . $construction[2];
}
}
@@ -0,0 +1,45 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magento\TestModuleSimpleTemplateDirective\Model;
use Magento\Framework\Filter\SimpleDirective\ProcessorInterface;
use Magento\Framework\Filter\Template;
/**
* Handles the {{mydir}} directive
*/
class MyDirProcessor implements ProcessorInterface
{
/**
* @inheritDoc
*/
public function getName(): string
{
return 'mydir';
}
/**
* @inheritDoc
*/
public function process(
$value,
array $parameters,
?string $html
): string {
return $value . $parameters['param1'] . $html;
}
/**
* @inheritDoc
*/
public function getDefaultFilters(): ?array
{
return ['foofilter'];
}
}