simplesamlphp / simplesamlphp/xml-cas-module-slate

PHP 8.5: replace all instances of array_pop() in ::fromXML() with array_last()

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

As soon as PHP 8.5 becomes the minimum required version for this library:
https://www.php.net/releases/8.5/en.php#array-first-and-last-functions

Using array_pop() is changing the original array by removing the last item from it, which may cause unexpected behaviour. array_last() doesn't do this, so it should in theory also be faster

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the library's ::fromXML() entry point and locate every array_pop() use there. Confirm the PHP 8.5 minimum-version condition and run the existing test suite; done means all applicable calls use array_last() without changing the original array.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.