-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #328 from FriendsOfCake/cake5
Cake5
- Loading branch information
Showing
25 changed files
with
338 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,20 +8,23 @@ on: | |
branches: | ||
- '*' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
testsuite: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: ['7.4', '8.0', '8.1'] | ||
php-version: ['8.1', '8.2'] | ||
prefer-lowest: [''] | ||
include: | ||
- php-version: '7.2' | ||
- php-version: '8.1' | ||
prefer-lowest: 'prefer-lowest' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
|
@@ -51,41 +54,16 @@ jobs: | |
|
||
- name: Run PHPUnit | ||
run: | | ||
if [[ ${{ matrix.php-version }} == '7.4' ]]; then | ||
vendor/bin/phpunit --verbose --coverage-clover=coverage.xml | ||
if [[ ${{ matrix.php-version }} == '8.1' ]]; then | ||
vendor/bin/phpunit --coverage-clover=coverage.xml | ||
else | ||
vendor/bin/phpunit | ||
fi | ||
- name: Code Coverage Report | ||
if: matrix.php-version == '7.4' | ||
if: matrix.php-version == '8.1' | ||
uses: codecov/codecov-action@v3 | ||
|
||
cs-stan: | ||
name: Coding Standard & Static Analysis | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
extensions: mbstring, intl | ||
coverage: none | ||
tools: cs2pr, vimeo/psalm:4.26, phpstan:1.8 | ||
|
||
- name: Composer Install | ||
run: composer install | ||
|
||
- name: Run phpcs | ||
run: vendor/bin/phpcs -q --report=checkstyle --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/ | cs2pr | ||
|
||
- name: Run psalm | ||
if: success() || failure() | ||
run: psalm --output-format=github | ||
|
||
- name: Run phpstan | ||
if: success() || failure() | ||
run: phpstan analyse | ||
uses: cakephp/.github/.github/workflows/[email protected] | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
/phpunit.xml | ||
/tmp | ||
.phpunit.result.cache | ||
/.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phive xmlns="https://phar.io/phive"> | ||
<phar name="phpstan" version="1.10.37" installed="1.10.37" location="./tools/phpstan" copy="false"/> | ||
<phar name="psalm" version="5.15.0" installed="5.15.0" location="./tools/psalm" copy="false"/> | ||
</phive> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="CakePdf"> | ||
<config name="installed_paths" value="../../cakephp/cakephp-codesniffer" /> | ||
|
||
<rule ref="CakePHP" /> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,13 @@ | ||
<phpunit | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="./tests/bootstrap.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false" | ||
> | ||
|
||
<testsuites> | ||
<testsuite name="CakePdf Plugin Tests"> | ||
<directory>./tests/TestCase</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">./src/</directory> | ||
</whitelist> | ||
</filter> | ||
<?xml version="1.0"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="./tests/bootstrap.php" colors="true" processIsolation="false" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" backupStaticProperties="false"> | ||
<testsuites> | ||
<testsuite name="CakePdf Plugin Tests"> | ||
<directory>./tests/TestCase</directory> | ||
</testsuite> | ||
</testsuites> | ||
<source> | ||
<include> | ||
<directory suffix=".php">./src/</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace CakePdf; | ||
|
||
use Cake\Core\BasePlugin; | ||
|
||
class CakePdfPlugin extends BasePlugin | ||
{ | ||
/** | ||
* Do bootstrap or not | ||
* | ||
* @var bool | ||
*/ | ||
protected bool $bootstrapEnabled = false; | ||
|
||
/** | ||
* Load routes or not | ||
* | ||
* @var bool | ||
*/ | ||
protected bool $routesEnabled = false; | ||
|
||
/** | ||
* Enable middleware | ||
* | ||
* @var bool | ||
*/ | ||
protected bool $middlewareEnabled = false; | ||
|
||
/** | ||
* Console middleware | ||
* | ||
* @var bool | ||
*/ | ||
protected bool $consoleEnabled = false; | ||
} |
Oops, something went wrong.