Skip to content

Conversation

@dragonmantank
Copy link
Contributor

Description

Push minimum PHP version to 8.1 and updates code to 8.1 minimum using Rector

Motivation and Context

PHP regularly drops support for older PHP versions and our standard is to stick with only supported PHP versions.

How Has This Been Tested?

Unit tests

Example Output or Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@dragonmantank dragonmantank requested a review from Copilot October 10, 2025 19:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the OpenTok PHP SDK codebase by dropping support for unsupported PHP versions and upgrading to PHP 8.1 as the minimum requirement. The changes leverage modern PHP features to improve code quality and maintainability.

  • Updated minimum PHP version requirement from 7.2 to 8.1
  • Refactored code to use PHP 8.1+ features like constructor property promotion, union types, and match expressions
  • Enhanced type declarations throughout the codebase

Reviewed Changes

Copilot reviewed 33 out of 34 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
composer.json Updated PHP version constraint to require 8.1+ and modernized dev dependencies
rector.php Added new Rector configuration file to enforce PHP 8.1 standards
src/OpenTok/*.php Modernized core classes with constructor property promotion, match expressions, and improved type safety
src/OpenTok/Util/*.php Updated utility classes with modern PHP features and stricter type checking
tests/OpenTokTest/*.php Enhanced test files with return type declarations and modern syntax
sample/*.php Updated sample applications to use modern array syntax and arrow functions
Comments suppressed due to low confidence (2)

tests/OpenTokTest/OpenTokTest.php:1

  • Inconsistent comment placement and missing elseif structure. The TODO comment should be moved outside the control flow and the conditional should use 'elseif' for better readability.
<?php

tests/OpenTokTest/OpenTokTest.php:1

  • [nitpick] Complex nested array operations with arrow functions make this line difficult to read. Consider breaking this into multiple lines for better maintainability.
<?php

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@dragonmantank dragonmantank merged commit 387ee26 into main Oct 10, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants