Skip to content

Commit

Permalink
feat!: require php ^8.0 (#881)
Browse files Browse the repository at this point in the history
  • Loading branch information
thorbrink authored Feb 20, 2024
1 parent c420ce9 commit d64a332
Show file tree
Hide file tree
Showing 14 changed files with 277 additions and 451 deletions.
15 changes: 13 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "PHP",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/php:0-7.4-bullseye",
"image": "mcr.microsoft.com/devcontainers/php:1-8.3-bullseye",

// Configure tool-specific properties.
// "customizations": {},
Expand All @@ -17,10 +17,20 @@
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "16.19.0"
},
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
"packages": "nano,bash-completion"
}
},

"customizations": {
"vscode": {
"extensions": [
"github.vscode-pull-request-github",
"GitHub.copilot",
"ritwickdey.LiveServer"
]
},
"codespaces": {
"repositories": {
"helsingborg-stad/component-library": {
Expand All @@ -32,7 +42,8 @@

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": {
"install-apt-packages": "export YARNKEY=yarn-keyring.gpg && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo gpg --dearmour -o /usr/share/keyrings/$YARNKEY && echo \"deb [signed-by=/usr/share/keyrings/$YARNKEY] https://dl.yarnpkg.com/debian stable main\" | sudo tee /etc/apt/sources.list.d/yarn.list && sudo apt-get update && sudo apt-get install -y subversion nano bash-completion",
"symlink-to-www": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html",
"apache": "sudo a2enmod rewrite headers && service apache2 start"
},

"waitFor": "postCreateCommand"
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/styleguide.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"folders": [
{
"path": "..",
"name": "styleguide",
"name": "styleguide"
},
{
"path": "../source/library",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup PHP with composer v2
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.2'
tools: composer:v2


Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-modul-test-municipio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup PHP with composer v2
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.2'
tools: composer:v2

- name: Validate composer.json and composer.lock
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup PHP with composer v2
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.2'
tools: composer:v2

- name: NPM Install.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.2'
tools: composer:v2

- name: Install composer packages
Expand Down
11 changes: 9 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@
"problemMatcher": []
},
{
"label": "Serve",
"label": "Watch",
"type": "shell",
"command": "php -S 0.0.0.0:8080",
"command": "npm run watch",
"problemMatcher": []
},
{
"label": "Test:Watch",
"type": "shell",
"group": "test",
"command": "npm run test:watch",
"problemMatcher": []
},
]
Expand Down
7 changes: 4 additions & 3 deletions cli.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use HelsingborgStad\GlobalBladeService\GlobalBladeService;

class CLI
{

Expand Down Expand Up @@ -28,10 +30,9 @@ private function renderComponent(string $componentClass, string $view, string $c
$component = new $componentClass($data);

$data = $component->getData();
$bladeEngine = $init->getEngine();
$bladeViewRenderer = \HelsingborgStad\RenderBladeView\BladeViewRenderer::create($bladeEngine);
$blade = GlobalBladeService::getInstance();

return $bladeViewRenderer->render($view, $data);
return $blade->makeView($view, $data)->render();
}
}

Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"email": "[email protected]"
}
],
"minimum-stability" : "dev",
"minimum-stability" : "stable",
"repositories": [
{
"type":"composer",
Expand All @@ -33,7 +33,8 @@
],
"require": {
"erusev/parsedown": "^1.7",
"helsingborg-stad/blade-engine-wrapper": "1.0.0"
"php": "^8.0",
"helsingborg-stad/blade": "^3.0"
},
"scripts": {
"post-install-cmd": [
Expand Down
Loading

0 comments on commit d64a332

Please sign in to comment.