diff --git a/composer.json b/composer.json index fbf5d06..606fdbc 100644 --- a/composer.json +++ b/composer.json @@ -6,10 +6,10 @@ "php": ">=7.2", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", - "symfony/config": "^4.4 || ^5.3 || ^6.0", - "symfony/dependency-injection": "^4.4 || ^5.3 || ^6.0", - "symfony/framework-bundle": "^4.4 || ^5.3 || ^6.0", - "symfony/http-kernel": "^4.4 || ^5.3 || ^6.0", + "symfony/config": "^4.4 || ^5.3 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^4.4 || ^5.3 || ^6.0 || ^7.0", + "symfony/framework-bundle": "^4.4 || ^5.3 || ^6.0 || ^7.0", + "symfony/http-kernel": "^4.4 || ^5.3 || ^6.0 || ^7.0", "twig/twig": "^2.14 || ^3.3" }, "require-dev": { diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index d33c840..4ffdf8b 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -16,7 +16,7 @@ */ class Configuration implements ConfigurationInterface { - public function getConfigTreeBuilder() + public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('wordpress'); $root = $treeBuilder->getRootNode(); diff --git a/src/DependencyInjection/WordpressExtension.php b/src/DependencyInjection/WordpressExtension.php index 32d74d9..e9be818 100644 --- a/src/DependencyInjection/WordpressExtension.php +++ b/src/DependencyInjection/WordpressExtension.php @@ -23,7 +23,7 @@ class WordpressExtension extends Extension /** * {@inheritdoc} */ - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { $configuration = $this->getConfiguration($configs, $container); $config = $this->processConfiguration($configuration, $configs); @@ -53,7 +53,7 @@ public function load(array $configs, ContainerBuilder $container) $this->configureParsers($container, $config['parser']); } - private function configureParsers(ContainerBuilder $container, array $config) + private function configureParsers(ContainerBuilder $container, array $config): void { $parsers = ['image' => RewriteImageReferences::class, 'link' => RewriteLinks::class, 'url' => RewriteUrls::class]; foreach ($parsers as $key => $serviceId) { diff --git a/src/Model/Page.php b/src/Model/Page.php index c71f511..cc4b3a3 100644 --- a/src/Model/Page.php +++ b/src/Model/Page.php @@ -48,6 +48,10 @@ class Page private $categories; /** @var array */ private $tags; + /** @var array */ + private $acf; + /** @var array */ + private $yoastHeadJson; public function __construct(array $data = []) { @@ -83,12 +87,14 @@ public function __construct(array $data = []) $this->featuredMedia = $data['featured_media']; $this->commentStatus = $data['comment_status']; $this->pingStatus = $data['ping_status']; - $this->sticky = $data['sticky']; + $this->sticky = $data['sticky'] ?? false; $this->template = $data['template']; - $this->format = $data['format']; - $this->meta = $data['meta']; - $this->categories = $data['categories']; - $this->tags = $data['tags']; + $this->format = $data['format'] ?? null; + $this->meta = $data['meta'] ?? null; + $this->categories = $data['categories'] ?? null; + $this->tags = $data['tags'] ?? null; + $this->acf = $data['acf'] ?? []; + $this->yoastHeadJson = $data['yoast_head_json'] ?? []; } public function getId(): int @@ -300,4 +306,45 @@ public function setTags(array $tags): void { $this->tags = $tags; } + + /** + * Get the value of acf + */ + public function getAcf(): ?array + { + return $this->acf; + } + + /** + * Set the value of acf + * + * @return self + */ + public function setAcf(?array $acf) + { + $this->acf = $acf; + + return $this; + } + + /** + * Get the value of yoastHeadJson + */ + public function getYoastHeadJson(): ?array + { + return $this->yoastHeadJson; + } + + /** + * Set the value of yoastHeadJson + * + * @return self + */ + public function setYoastHeadJson(?array $yoastHeadJson) + { + $this->yoastHeadJson = $yoastHeadJson; + + return $this; + } + }