Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changelogger: Adjust for PHP 8.1 compat #21209

Merged
merged 6 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/files/phpcompatibility-dev-phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<rule ref="PHPCompatibility">
<!-- Doesn't hurt anything, as long as we're also handling the non-Error case. -->
<exclude name="PHPCompatibility.Classes.NewClasses.errorFound" />
<!-- Doesn't hurt anything, earlier versions ignore attributes. -->
<exclude name="PHPCompatibility.Attributes.NewAttributes.Found" />
<!-- WordPress provides a polyfill. Feel free to add anything else normally excluded by PHPCompatibilityWP here if necessary. -->
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_box_sealFound" />
<exclude name="PHPCompatibility.Classes.NewClasses.sodiumexceptionFound" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Adjust for PHP 8.1 compatibility.
1 change: 1 addition & 0 deletions projects/packages/changelogger/lib/ChangeEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ public function setContent( $content ) {
*
* @return array
*/
#[\ReturnTypeWillChange]
public function jsonSerialize() {
return array(
'__class__' => static::class,
Expand Down
1 change: 1 addition & 0 deletions projects/packages/changelogger/lib/Changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public function getVersions() {
*
* @return array
*/
#[\ReturnTypeWillChange]
public function jsonSerialize() {
return array(
'__class__' => static::class,
Expand Down
1 change: 1 addition & 0 deletions projects/packages/changelogger/lib/ChangelogEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ public function getChangesBySubheading( $subheading = null ) {
*
* @return array
*/
#[\ReturnTypeWillChange]
public function jsonSerialize() {
return array(
'__class__' => static::class,
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/changelogger/src/AddCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ protected function execute( InputInterface $input, OutputInterface $output ) {
$question = new Question( "Changelog entry. May not be empty.\n > ", $entry );
$question->setValidator(
function ( $v ) {
if ( trim( $v ) === '' ) {
if ( trim( (string) $v ) === '' ) {
throw new \RuntimeException( 'An empty changelog entry is only allowed when the significance is "patch".' );
}
return $v;
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/changelogger/src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
class Application extends SymfonyApplication {

const VERSION = '3.0.1';
const VERSION = '3.0.2-alpha';

/**
* Constructor.
Expand Down