Skip to content

Commit

Permalink
Enable CI for PHP 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
nibra committed Aug 15, 2022
1 parent cb87f58 commit a3932a4
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 25 deletions.
6 changes: 4 additions & 2 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ local composer(phpversion, params) = {
local phpunit(phpversion) = {
name: "PHPUnit",
image: "joomlaprojects/docker-images:php" + phpversion,
[if phpversion == "8.2" then "failure"]: "ignore",
commands: ["vendor/bin/phpunit"]
};

Expand Down Expand Up @@ -59,7 +60,7 @@ local pipeline(name, phpversion, params) = {
image: "joomlaprojects/docker-images:php7.4",
depends: [ "composer" ],
commands: [
"vendor/bin/phpcs -p --report=full --extensions=php --standard=PSR12 src/"
"vendor/bin/phpcs --standard=ruleset.xml"
]
},
{
Expand Down Expand Up @@ -109,5 +110,6 @@ local pipeline(name, phpversion, params) = {
pipeline("7.3", "7.3", "--prefer-stable"),
pipeline("7.4", "7.4", "--prefer-stable"),
pipeline("8.0", "8.0", "--prefer-stable"),
pipeline("8.1", "8.1", "--prefer-stable")
pipeline("8.1", "8.1", "--prefer-stable"),
pipeline("8.2", "8.2", "--prefer-stable --ignore-platform-reqs"),
]
41 changes: 39 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
{
"commands": [
"vendor/bin/phpcs -p --report=full --extensions=php --standard=PSR12 src/"
"vendor/bin/phpcs --standard=ruleset.xml"
],
"depends": [
"composer"
Expand Down Expand Up @@ -303,7 +303,44 @@
]
}
---
{
"kind": "pipeline",
"name": "PHP 8.2",
"steps": [
{
"commands": [
"php -v",
"composer update --prefer-stable --ignore-platform-reqs"
],
"image": "joomlaprojects/docker-images:php8.2",
"name": "composer",
"volumes": [
{
"name": "composer-cache",
"path": "/tmp/composer-cache"
}
]
},
{
"commands": [
"vendor/bin/phpunit"
],
"failure": "ignore",
"image": "joomlaprojects/docker-images:php8.2",
"name": "PHPUnit"
}
],
"volumes": [
{
"host": {
"path": "/tmp/composer-cache"
},
"name": "composer-cache"
}
]
}
---
kind: signature
hmac: 8ce225386480f94a8ed0cfbb8261489d0bb53a674f4264f92eadfcea27b40ccc
hmac: adf77e27d980fe75d12a8a5c07da2e0db889d914d4bbf7444b03f4efdd4c0c5e

...
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"homepage": "https://github.com/joomla-framework/registry",
"license": "GPL-2.0-or-later",
"require": {
"php": "^7.2.5|^8.0",
"joomla/utilities": "^1.4.1|^2.0"
"php": "^7.2.5|~8.0.0|~8.1.0",
"joomla/utilities": "^2.0"
},
"require-dev": {
"joomla/coding-standards": "^3.0@dev",
Expand Down
28 changes: 12 additions & 16 deletions ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
<?xml version="1.0"?>
<ruleset name="Joomla">
<ruleset name="PSR12 with Joomla specific additions">
<description>
This is a PSR-12 compliant ruleset for Joomla.
</description>

<file>src</file>
<file>tests</file>

<arg name="extensions" value="php"/>
<arg name="report" value="full"/>
<arg name="tab-width" value="4"/>
<arg name="encoding" value="utf-8"/>
<arg value="sp"/>
<arg name="colors" />
<arg value="sp"/>

<!-- Exclude folders not containing production code -->
<exclude-pattern>*/.github/*</exclude-pattern>

<!-- Exclude 3rd party libraries. -->
<exclude-pattern>*/vendor/*</exclude-pattern>

<rule ref="Joomla">
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
</rule>

<rule ref="Joomla.Classes.InstantiateNewClasses">
<properties>
<property name="shortArraySyntax" value="true"/>
</properties>
<rule ref="PSR12">
<exclude name="Generic.Files.LineLength.MaxExceeded"/>
<exclude name="Generic.Files.LineLength.TooLong"/>
</rule>
</ruleset>
1 change: 1 addition & 0 deletions tests/FactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @copyright Copyright (C) 2015 Open Source Matters, Inc.
* @license GNU General Public License version 2 or later; see LICENSE
Expand Down
1 change: 1 addition & 0 deletions tests/Format/IniTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @copyright Copyright (C) 2013 Open Source Matters, Inc.
* @license GNU General Public License version 2 or later; see LICENSE
Expand Down
1 change: 1 addition & 0 deletions tests/Format/JsonTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @copyright Copyright (C) 2013 Open Source Matters, Inc.
* @license GNU General Public License version 2 or later; see LICENSE
Expand Down
1 change: 1 addition & 0 deletions tests/Format/PhpTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @copyright Copyright (C) 2013 Open Source Matters, Inc.
* @license GNU General Public License version 2 or later; see LICENSE
Expand Down
1 change: 1 addition & 0 deletions tests/Format/XmlTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @copyright Copyright (C) 2013 Open Source Matters, Inc.
* @license GNU General Public License version 2 or later; see LICENSE
Expand Down
1 change: 1 addition & 0 deletions tests/Format/YamlTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @copyright Copyright (C) 2013 Open Source Matters,
* @license GNU General Public License version 2 or later; see LICENSE
Expand Down
4 changes: 2 additions & 2 deletions tests/RegistryTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @copyright Copyright (C) 2013 Open Source Matters, Inc.
* @license GNU General Public License version 2 or later; see LICENSE
Expand Down Expand Up @@ -706,8 +707,7 @@ public function testTheRegistryCanBeConvertedToAnArray()
'foo2' => 'testtoarray2',
'config' => ['foo3' => 'testtoarray3'],
],
(new Registry(['foo1' => 'testtoarray1', 'foo2' => 'testtoarray2', 'config' => ['foo3' => 'testtoarray3']]
))->toArray(),
(new Registry(['foo1' => 'testtoarray1', 'foo2' => 'testtoarray2', 'config' => ['foo3' => 'testtoarray3']]))->toArray(),
'The Registry should be converted to an array.'
);
}
Expand Down
1 change: 1 addition & 0 deletions tests/Stubs/Ini.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @copyright Copyright (C) 2015 Open Source Matters, Inc.
* @license GNU General Public License version 2 or later; see LICENSE
Expand Down
4 changes: 3 additions & 1 deletion tests/Stubs/jregistry.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php /** @noinspection PhpIllegalPsrClassPathInspection */
<?php

// phpcs:ignoreFile

class JRegistry
{
Expand Down

0 comments on commit a3932a4

Please sign in to comment.