Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class SomeEventListener



## Legacy integration
## Template output

Be sure, `huh_head.use_contao_head` and/or `huh_head.use_contao_variables` are not set to true.

Expand All @@ -157,7 +157,7 @@ Make sure, that you remove (are outputted by $this->meta() if `huh_head.use_cont
<meta name="description" content="<?= $this->description ?>">
```

The `meta` function accepts currently one parameter that can contain service names (array) that should be skipped.
The `meta` function accepts currently one parameter that can contain tag names (array) that should be skipped.

## Developers

Expand Down
9 changes: 0 additions & 9 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ services:
_defaults:
autowire: true
autoconfigure: true
bind:
Psr\Container\ContainerInterface: '@service_container'

HeimrichHannot\HeadBundle\:
resource: '../src/{EventListener,Helper}/*'
exclude: '../src/Helper/LegacyHelper.php'
bind:
$bundleConfig: '%huh_head%'

Expand All @@ -18,9 +15,3 @@ services:

HeimrichHannot\HeadBundle\HeadTag\HeadTagFactory:
autoconfigure: true

huh.head.tag_manager:
class: HeimrichHannot\HeadBundle\Manager\TagManager
public: true
deprecated: ~
HeimrichHannot\HeadBundle\Manager\TagManager: '@huh.head.tag_manager'
129 changes: 0 additions & 129 deletions config/tags.yaml

This file was deleted.

45 changes: 0 additions & 45 deletions src/DependencyInjection/Compiler/AdjustContainerPass.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public function load(array $configs, ContainerBuilder $container): void

$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../../config'));
$loader->load('services.yaml');
$loader->load('tags.yaml');

if (class_exists(DisableCanonicalFieldsListener::class)) {
$container->removeDefinition(CanonicalListener::class);
Expand Down
5 changes: 0 additions & 5 deletions src/EventListener/Contao/ParseTemplateListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

use Contao\CoreBundle\ServiceAnnotation\Hook;
use Contao\Template;
use HeimrichHannot\HeadBundle\Helper\LegacyHelper;
use HeimrichHannot\HeadBundle\Manager\HtmlHeadTagManager;

/**
Expand Down Expand Up @@ -40,10 +39,6 @@ protected function addLegacyMetaMethod(Template $template): void

if (!($this->bundleConfig['use_contao_variables'] ?? false)) {
$template->meta = function (array $skip = []) {
foreach ($skip as &$tag) {
$tag = LegacyHelper::mapServiceToTag($tag, $tag);
}

return $this->headTagManager->renderTags([
'skip_tags' => $skip,
]);
Expand Down
1 change: 0 additions & 1 deletion src/HeadTag/BaseTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
class BaseTag extends AbstractHeadTag
{
public const NAME = 'base';
public const LEGACY_NAME = 'huh.head.tag.base';

public function __construct(string $href)
{
Expand Down
13 changes: 1 addition & 12 deletions src/HeadTag/HeadTagFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use HeimrichHannot\HeadBundle\HeadTag\Meta\CharsetMetaTag;
use HeimrichHannot\HeadBundle\HeadTag\Meta\HttpEquivMetaTag;
use HeimrichHannot\HeadBundle\HeadTag\Meta\PropertyMetaTag;
use HeimrichHannot\HeadBundle\Helper\LegacyHelper;
use HeimrichHannot\HeadBundle\Helper\TagHelper;

class HeadTagFactory
Expand All @@ -28,19 +27,9 @@ public function __construct(TagHelper $tagHelper)
* For tags with multiple occurrences like meta, prefix name with tag name,
* for example meta_ (meta_description, meta_og:title, ...) for meta tags.
*
* Options:
* - skip_legacy_mapping: (bool) do not check for legacy tag service names
*/
public function createTagByName(string $name, ?string $value = null, array $options = []): ?AbstractHeadTag
public function createTagByName(string $name, ?string $value = null): ?AbstractHeadTag
{
$options = array_merge([
'skip_legacy_mapping' => false,
], $options);

if (!$options['skip_legacy_mapping']) {
$name = LegacyHelper::mapServiceToTag($name, $name);
}

if ('base' === $name) {
return new BaseTag($value);
}
Expand Down
1 change: 0 additions & 1 deletion src/HeadTag/Link/CanonicalLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
class CanonicalLink extends LinkTag
{
public const TYPE = 'canonical';
public const LEGACY_NAME = 'huh.head.tag.link.canonical';

public function __construct(string $href)
{
Expand Down
17 changes: 0 additions & 17 deletions src/HeimrichHannotContaoHeadBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,12 @@

namespace HeimrichHannot\HeadBundle;

use HeimrichHannot\HeadBundle\DependencyInjection\Compiler\AdjustContainerPass;
use HeimrichHannot\HeadBundle\DependencyInjection\HeimrichHannotHeadBundleExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class HeimrichHannotContaoHeadBundle extends Bundle
{
/**
* Builds the bundle.
*
* It is only ever called once when the cache is empty.
*
* This method can be overridden to register compilation passes,
* other extensions, ...
*
* @param ContainerBuilder $container A ContainerBuilder instance
*/
public function build(ContainerBuilder $container): void
{
$container->addCompilerPass(new AdjustContainerPass());
}

public function getContainerExtension(): ?ExtensionInterface
{
return new HeimrichHannotHeadBundleExtension();
Expand Down
68 changes: 0 additions & 68 deletions src/Helper/LegacyHelper.php

This file was deleted.

Loading
Loading