[PR #1291] Conversion to PHP 5.4's short array syntax #9348

Open
opened 2026-01-22 16:04:03 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/1291

State: closed
Merged: No


Now that the minimum PHP version is 5.4, it would be good to encourage the use of the short array syntax [].
Converting the existing codebase to this syntax will promote this good practice and encourage everyone to follow it.

I have converted the codebase with a tool I wrote for personal projects:

find doctrine2 -type f -name '*.php' -exec php short-array-syntax-converter.php {} \;

The number of changes is quite large, but I'm confident that nothing is broken, and the passing tests confirm this.

**Original Pull Request:** https://github.com/doctrine/orm/pull/1291 **State:** closed **Merged:** No --- Now that the minimum PHP version is 5.4, it would be good to encourage the use of the short array syntax `[]`. Converting the existing codebase to this syntax will promote this good practice and encourage everyone to follow it. I have converted the codebase with [a tool](https://gist.github.com/BenMorel/6994483) I wrote for personal projects: ``` find doctrine2 -type f -name '*.php' -exec php short-array-syntax-converter.php {} \; ``` The number of changes is quite large, but I'm confident that nothing is broken, and the passing tests confirm this.
admin added the pull-request label 2026-01-22 16:04:03 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9348