From f44e12fa3b1393b3020e494e2a1e6ef5d8096726 Mon Sep 17 00:00:00 2001 From: Jesus Ortiz Date: Tue, 31 Aug 2021 16:59:28 +0200 Subject: [PATCH 1/5] Add yoast_head_json and acf to Page.php --- src/Model/Page.php | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/Model/Page.php b/src/Model/Page.php index c71f511..f0f8667 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 = []) { @@ -89,6 +93,8 @@ public function __construct(array $data = []) $this->meta = $data['meta']; $this->categories = $data['categories']; $this->tags = $data['tags']; + $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; + } + } From 19d9aa9d33d02130482e2d61ea59f5dc028fabbd Mon Sep 17 00:00:00 2001 From: Jesus Ortiz Date: Tue, 28 Sep 2021 14:17:53 +0200 Subject: [PATCH 2/5] Add null for missing fields --- src/Model/Page.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Model/Page.php b/src/Model/Page.php index f0f8667..cc4b3a3 100644 --- a/src/Model/Page.php +++ b/src/Model/Page.php @@ -87,12 +87,12 @@ 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'] ?? []; } From 47b43a28d93baf21321c0250f15a3becbba996d4 Mon Sep 17 00:00:00 2001 From: Jesus Ortiz Date: Mon, 26 Dec 2022 10:03:37 +0100 Subject: [PATCH 3/5] Add native return type to getConfigTreeBuilder --- src/DependencyInjection/Configuration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); From 5f1513d6a7d9360d7c11e1bf7c90b8b81314a293 Mon Sep 17 00:00:00 2001 From: Jesus Ortiz Date: Fri, 26 Jan 2024 19:05:31 +0100 Subject: [PATCH 4/5] Fix might add :void deprecations --- src/DependencyInjection/WordpressExtension.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { From 4f82402e641f58322fd5a3a89be73633b2330db1 Mon Sep 17 00:00:00 2001 From: Jesus Ortiz Date: Mon, 10 Mar 2025 16:18:18 +0100 Subject: [PATCH 5/5] Add symfony 7 to requirements --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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": {