From 0ea3d58a275eadfd577471b2b40d5c331db43653 Mon Sep 17 00:00:00 2001 From: OStefan2001 Date: Tue, 7 Jul 2026 12:17:37 +0300 Subject: [PATCH 1/4] first --- composer.json | 2 +- src/App/src/RoutesDelegator.php | 2 - src/App/templates/app/index.html.twig | 2 +- src/App/templates/layout/default.html.twig | 34 ++-- src/App/templates/partial/meta.html.twig | 38 +++-- src/Blog/src/RoutesDelegator.php | 37 ++++- src/Blog/templates/page/blog.html.twig | 148 ++++++++---------- src/Page/templates/page/contact.html.twig | 49 ++++++ ...dotkernel-packages-oss-lifecycle.html.twig | 9 ++ 9 files changed, 195 insertions(+), 126 deletions(-) create mode 100644 src/Page/templates/page/contact.html.twig create mode 100644 src/Page/templates/page/dotkernel-packages-oss-lifecycle.html.twig diff --git a/composer.json b/composer.json index 9327930..e74e4e2 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ } }, "require": { - "php": "~8.3.0 || ~8.4.0 || ~8.5.0", + "php": "~8.5.0", "doctrine/data-fixtures": "^2.2", "doctrine/doctrine-fixtures-bundle": "^4.3", "dotkernel/dot-errorhandler": "^4.4.0", diff --git a/src/App/src/RoutesDelegator.php b/src/App/src/RoutesDelegator.php index 491ddae..2269f90 100644 --- a/src/App/src/RoutesDelegator.php +++ b/src/App/src/RoutesDelegator.php @@ -16,9 +16,7 @@ public function __invoke(ContainerInterface $container, string $serviceName, cal { $app = $callback(); assert($app instanceof Application); - $app->get('/', [GetIndexViewHandler::class], 'app::index'); - return $app; } } diff --git a/src/App/templates/app/index.html.twig b/src/App/templates/app/index.html.twig index a1373d9..2a8b06e 100644 --- a/src/App/templates/app/index.html.twig +++ b/src/App/templates/app/index.html.twig @@ -130,4 +130,4 @@ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/App/templates/layout/default.html.twig b/src/App/templates/layout/default.html.twig index ed0d11a..2b9131c 100644 --- a/src/App/templates/layout/default.html.twig +++ b/src/App/templates/layout/default.html.twig @@ -1,23 +1,21 @@ - + {{ include('@partial/meta.html.twig') }} - {% block canonical %}{% endblock %} - + {% block canonical %} + {% endblock %} - - - {% block stylesheets %}{% endblock %} + {% block stylesheets %} + {% endblock %} -
+

+ Page {{ data.currentPage }} of {{ data.lastPage }} +  ·  + {{ data.count }} articles total +

+ {% endif %} + + {% endblock %} diff --git a/src/Page/templates/page/contact.html.twig b/src/Page/templates/page/contact.html.twig new file mode 100644 index 0000000..bd6be2f --- /dev/null +++ b/src/Page/templates/page/contact.html.twig @@ -0,0 +1,49 @@ +{% extends '@layout/default.html.twig' %} + +{% block page_title %}

Contact Us

{% endblock %} + + +{% block content %} +
+
+
+
+ +
+

GitHub

+

+ Browse our repositories, open issues, or contribute to the DotKernel ecosystem. +

+ + Visit GitHub + +
+
+
+
+
+ +
+

Documentation

+

+ Read the guides, references, and best practices for building with DotKernel. +

+ + Read the Docs + +
+
+
+

Our Approach

+

+ Dotkernel is a Headless Platform for building modern web applications. + + The Dotkernel Headless Platform is made up of Open Source components aimed at businesses that need custom solutions.

+
+{% endblock %} diff --git a/src/Page/templates/page/dotkernel-packages-oss-lifecycle.html.twig b/src/Page/templates/page/dotkernel-packages-oss-lifecycle.html.twig new file mode 100644 index 0000000..4597ebc --- /dev/null +++ b/src/Page/templates/page/dotkernel-packages-oss-lifecycle.html.twig @@ -0,0 +1,9 @@ +{% extends '@layout/default.html.twig' %} + +{% block page_title %} +

Dotkernel packages OSS Lifecycle

+{% endblock %} + +{% block content %} + +{% endblock %} From 871601cd8376b307f160ea8eba41fceb5de87bb9 Mon Sep 17 00:00:00 2001 From: OStefan2001 Date: Tue, 7 Jul 2026 12:34:45 +0300 Subject: [PATCH 2/4] Keep only php 8.5 version in matrix and update --- .github/workflows/codecov.yml | 2 -- .github/workflows/qodana_code_quality.yml | 2 +- .github/workflows/static-analysis.yml | 2 -- src/Page/templates/page/contact.html.twig | 1 - 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index b738967..be1f11a 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -15,8 +15,6 @@ jobs: - ubuntu-latest php: - - "8.3" - - "8.4" - "8.5" steps: diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml index ed41b3c..0e6d2d3 100644 --- a/.github/workflows/qodana_code_quality.yml +++ b/.github/workflows/qodana_code_quality.yml @@ -16,7 +16,7 @@ jobs: checks: write strategy: matrix: - php-versions: [ '8.3', '8.4', '8.5' ] + php-versions: [ '8.5' ] steps: - uses: actions/checkout@v6 with: diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 94fbdf8..16bc8bd 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -15,8 +15,6 @@ jobs: - ubuntu-latest php: - - "8.3" - - "8.4" - "8.5" steps: diff --git a/src/Page/templates/page/contact.html.twig b/src/Page/templates/page/contact.html.twig index bd6be2f..5d8d8df 100644 --- a/src/Page/templates/page/contact.html.twig +++ b/src/Page/templates/page/contact.html.twig @@ -2,7 +2,6 @@ {% block page_title %}

Contact Us

{% endblock %} - {% block content %}
From e4cbe1e966a9535e14193fd6f4c9d3ca6c6a742b Mon Sep 17 00:00:00 2001 From: OStefan2001 Date: Tue, 7 Jul 2026 15:51:20 +0300 Subject: [PATCH 3/4] rm qodana --- .github/workflows/qodana_code_quality.yml | 49 ----------------------- 1 file changed, 49 deletions(-) delete mode 100644 .github/workflows/qodana_code_quality.yml diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml deleted file mode 100644 index 0e6d2d3..0000000 --- a/.github/workflows/qodana_code_quality.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Qodana -on: - workflow_dispatch: - pull_request: - push: - branches: - - '1.0' - - 'releases/*' - -jobs: - qodana: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - checks: write - strategy: - matrix: - php-versions: [ '8.5' ] - steps: - - uses: actions/checkout@v6 - with: - # to check out the actual pull request commit, not the merge commit - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 # a full history is required for pull request analysis - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - coverage: pcov - ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On - tools: composer:v2, cs2pr - - - name: Determine composer cache directory - run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV - - - name: Cache dependencies installed with composer - uses: actions/cache@v5 - with: - path: ${{ env.COMPOSER_CACHE_DIR }} - key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: | - php${{ matrix.php }}-composer- - - name: Install dependencies with composer - run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2026.1.0 - env: - QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} From 6e4f4ec6a0879e76fd1b4b79b12dc7a1f8a58ca2 Mon Sep 17 00:00:00 2001 From: OStefan2001 Date: Wed, 8 Jul 2026 01:03:18 +0300 Subject: [PATCH 4/4] Add static page for contact, update routes from /page/contact/ -> /contact/ --- src/App/src/RoutesDelegator.php | 11 ++++++ src/Blog/src/RoutesDelegator.php | 27 ------------- src/Blog/templates/page/contact.html.twig | 48 +++++++++++++++++++++++ src/Page/src/RoutesDelegator.php | 2 +- test/Unit/Page/RoutesDelegatorTest.php | 4 +- 5 files changed, 62 insertions(+), 30 deletions(-) create mode 100644 src/Blog/templates/page/contact.html.twig diff --git a/src/App/src/RoutesDelegator.php b/src/App/src/RoutesDelegator.php index 2269f90..f505d50 100644 --- a/src/App/src/RoutesDelegator.php +++ b/src/App/src/RoutesDelegator.php @@ -4,6 +4,7 @@ namespace Light\App; +use Laminas\Diactoros\Response\RedirectResponse; use Light\App\Handler\GetIndexViewHandler; use Mezzio\Application; use Psr\Container\ContainerInterface; @@ -17,6 +18,16 @@ public function __invoke(ContainerInterface $container, string $serviceName, cal $app = $callback(); assert($app instanceof Application); $app->get('/', [GetIndexViewHandler::class], 'app::index'); + + $app->get('/{first}', function ($request) { + $uri = $request->getUri(); + return new RedirectResponse((string) $uri . '/', 301); + }); + $app->get('/{first}/{second}', function ($request) { + $uri = $request->getUri(); + return new RedirectResponse((string) $uri . '/', 301); + }); + return $app; } } diff --git a/src/Blog/src/RoutesDelegator.php b/src/Blog/src/RoutesDelegator.php index ae9dcc1..542034a 100644 --- a/src/Blog/src/RoutesDelegator.php +++ b/src/Blog/src/RoutesDelegator.php @@ -4,7 +4,6 @@ namespace Light\Blog; -use Laminas\Diactoros\Response\RedirectResponse; use Light\Blog\Handler\GetAuthorResourceHandler; use Light\Blog\Handler\GetCategoryCollectionHandler; use Light\Blog\Handler\GetCategoryResourceHandler; @@ -21,37 +20,11 @@ public function __invoke(ContainerInterface $container, string $serviceName, cal { $app = $callback(); assert($app instanceof Application); - $app->get('/blog/', [GetPostCollectionHandler::class], 'page::blog'); - $app->get('/blog', function ($request) { - $uri = $request->getUri(); - return new RedirectResponse((string) $uri . '/', 301); - }); - $app->get('/category/{slug}/', [GetCategoryResourceHandler::class], 'page::category-resource'); - $app->get('/category/{slug}', function ($request) { - $uri = $request->getUri(); - return new RedirectResponse((string) $uri . '/', 301); - }); - $app->get('/categories/', [GetCategoryCollectionHandler::class], 'page::categories'); - $app->get('/categories', function ($request) { - $uri = $request->getUri(); - return new RedirectResponse((string) $uri . '/', 301); - }); - $app->get('/author/{slug}/', [GetAuthorResourceHandler::class], 'page::author-resource'); - $app->get('/author/{slug}', function ($request) { - $uri = $request->getUri(); - return new RedirectResponse((string) $uri . '/', 301); - }); - $app->get('/{categorySlug}/{slug}/', [GetPostResourceHandler::class], 'page::blog-resource'); - $app->get('/{categorySlug}/{slug}', function ($request) { - $uri = $request->getUri(); - return new RedirectResponse((string) $uri . '/', 301); - }); - return $app; } } diff --git a/src/Blog/templates/page/contact.html.twig b/src/Blog/templates/page/contact.html.twig new file mode 100644 index 0000000..5d8d8df --- /dev/null +++ b/src/Blog/templates/page/contact.html.twig @@ -0,0 +1,48 @@ +{% extends '@layout/default.html.twig' %} + +{% block page_title %}

Contact Us

{% endblock %} + +{% block content %} +
+
+
+
+ +
+

GitHub

+

+ Browse our repositories, open issues, or contribute to the DotKernel ecosystem. +

+ + Visit GitHub + +
+
+
+
+
+ +
+

Documentation

+

+ Read the guides, references, and best practices for building with DotKernel. +

+ + Read the Docs + +
+
+
+

Our Approach

+

+ Dotkernel is a Headless Platform for building modern web applications. + + The Dotkernel Headless Platform is made up of Open Source components aimed at businesses that need custom solutions.

+
+{% endblock %} diff --git a/src/Page/src/RoutesDelegator.php b/src/Page/src/RoutesDelegator.php index e5e2b86..e31b454 100644 --- a/src/Page/src/RoutesDelegator.php +++ b/src/Page/src/RoutesDelegator.php @@ -28,7 +28,7 @@ public function __invoke(ContainerInterface $container, string $serviceName, cal foreach ($routes as $prefix => $moduleRoutes) { foreach ($moduleRoutes as $routeUri => $templateName) { $app->get( - sprintf('/%s/%s', $prefix, $routeUri), + sprintf('/%s/', $routeUri), GetPageViewHandler::class, sprintf('%s::%s', $prefix, $templateName) ); diff --git a/test/Unit/Page/RoutesDelegatorTest.php b/test/Unit/Page/RoutesDelegatorTest.php index bd94d63..46aca7d 100644 --- a/test/Unit/Page/RoutesDelegatorTest.php +++ b/test/Unit/Page/RoutesDelegatorTest.php @@ -25,9 +25,9 @@ class RoutesDelegatorTest extends TestCase */ public function testWillInvoke(): void { - $moduleName = 'test'; + $moduleName = 'test_module_name'; $routeName = 'test_route_name'; - $routeUri = sprintf('/%s/%s', $moduleName, $routeName); + $routeUri = sprintf('/%s/', $routeName); $templateName = sprintf('%s::%s', $moduleName, $routeName); $container = $this->createStub(ContainerInterface::class);