From ed72c54f2412e776d130afbd73b0d02f7fcd38c6 Mon Sep 17 00:00:00 2001 From: RJ Garcia Date: Sat, 2 Nov 2024 10:45:30 -0400 Subject: [PATCH] Fix dynamic property deprecations / Upgrade php min versions --- .github/workflows/php.yml | 42 +++++++------- composer.json | 96 ++++++++++++++++---------------- doc/.gitignore | 1 + doc/layouts/_default/baseof.html | 14 +---- src/Template/Func.php | 8 ++- 5 files changed, 76 insertions(+), 85 deletions(-) create mode 100644 doc/.gitignore diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index d5e9a167..649a1ab6 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -4,29 +4,29 @@ on: [push] jobs: run: - runs-on: 'ubuntu-latest' + runs-on: "ubuntu-latest" strategy: matrix: - php-versions: ['7.4', '8.0', '8.1', '8.2'] - phpunit-versions: ['9.5'] + php-versions: ["8.2", "8.3", "8.4"] + phpunit-versions: ["11.4"] steps: - - name: Checkout - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: mbstring, intl - ini-values: post_max_size=256M, max_execution_time=180 - coverage: xdebug - tools: php-cs-fixer, phpunit:${{ matrix.phpunit-versions }} - env: - GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: mbstring, intl + ini-values: post_max_size=256M, max_execution_time=180 + coverage: xdebug + tools: php-cs-fixer, phpunit:${{ matrix.phpunit-versions }} + env: + GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} - - name: Validate Composer - run: composer validate - - name: Install Composer Deps - run: composer install - - name: Run Tests - run: phpunit --testdox --coverage-text --coverage-clover=coverage.clover \ No newline at end of file + - name: Validate Composer + run: composer validate + - name: Install Composer Deps + run: composer install + - name: Run Tests + run: phpunit --testdox --coverage-text --coverage-clover=coverage.clover diff --git a/composer.json b/composer.json index 307d4f03..e39044a6 100644 --- a/composer.json +++ b/composer.json @@ -1,52 +1,52 @@ { - "name": "league/plates", - "description": "Plates, the native PHP template system that's fast, easy to use and easy to extend.", - "keywords": [ - "league", - "package", - "templating", - "templates", - "views" - ], - "homepage": "https://platesphp.com", - "license": "MIT", - "authors" : [ - { - "name": "Jonathan Reinink", - "email": "jonathan@reinink.ca", - "role": "Developer" - }, - { - "name": "RJ Garcia", - "email": "ragboyjr@icloud.com", - "role": "Developer" - } - ], - "require" : { - "php": "^7.1|^8.0" + "name": "league/plates", + "description": "Plates, the native PHP template system that's fast, easy to use and easy to extend.", + "keywords": [ + "league", + "package", + "templating", + "templates", + "views" + ], + "homepage": "https://platesphp.com", + "license": "MIT", + "authors": [ + { + "name": "Jonathan Reinink", + "email": "jonathan@reinink.ca", + "role": "Developer" }, - "require-dev": { - "mikey179/vfsstream": "^1.6", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^3.5" - }, - "autoload": { - "psr-4": { - "League\\Plates\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "League\\Plates\\Tests\\": "tests" - } - }, - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "scripts": { - "test": "phpunit --testdox --colors=always", - "docs": "hugo -s doc server" + { + "name": "RJ Garcia", + "email": "ragboyjr@icloud.com", + "role": "Developer" + } + ], + "require": { + "php": "^8.0" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^11.4", + "squizlabs/php_codesniffer": "^3.5" + }, + "autoload": { + "psr-4": { + "League\\Plates\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "League\\Plates\\Tests\\": "tests" + } + }, + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" } + }, + "scripts": { + "test": "phpunit --testdox --colors=always", + "docs": "hugo -s doc server" + } } diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 00000000..2a8645fe --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1 @@ +.hugo_build.lock diff --git a/doc/layouts/_default/baseof.html b/doc/layouts/_default/baseof.html index c0cb81fe..7f530c52 100644 --- a/doc/layouts/_default/baseof.html +++ b/doc/layouts/_default/baseof.html @@ -103,17 +103,5 @@

{{ .Name }}

window.location.href = pathParts.join("/"); }); - -{{ if .Site.GoogleAnalytics }} - -{{ end }} - - \ No newline at end of file + diff --git a/src/Template/Func.php b/src/Template/Func.php index 5ff50936..96f05d87 100644 --- a/src/Template/Func.php +++ b/src/Template/Func.php @@ -95,9 +95,11 @@ public function getCallback() */ public function call(?Template $template = null, $arguments = array()) { - if (is_array($this->callback) and - isset($this->callback[0]) and - $this->callback[0] instanceof ExtensionInterface + if ( + is_array($this->callback) && + isset($this->callback[0]) && + $this->callback[0] instanceof ExtensionInterface && + property_exists($this->callback[0], 'template') ) { $this->callback[0]->template = $template; }