View Issue Details

IDProjectCategoryView StatusLast Update
0002747Composrcorepublic2019-12-06 13:54
ReporterChris GrahamAssigned To 
Severityfeature 
Status non-assignedResolutionopen 
Product Version 
Fixed in Version 
Summary0002747: PHP refresh (ongoing)
DescriptionWhen base line compat is for PHP 7.0...

Implement static typing
 Make full use of static typed parameters - turn all our phpdoc headers into proper function signatures via an automated process
 Make the PHPdoc compiler complain if there is a mismatch between PHPdoc and argument/return typing
 Adjust ocProducts PHP to enable PHP 7's function-based static typing when ocproducts.type_strictness is enabled (so we don't need to do it in production with a declare command in each file)

Use new Unicode codepoint escape syntax instead of hex2bin

Update CQC to be able to parse new syntax we don't necessarily intend to use right away:
 Null coalescing operator
 Spaceship operator
 Constant arrays using define()
 Anonymous classes
 Group use declarations
 Generator delegation

Update phpstub.php
 new functions are currently there as comments, ones we want to use will need structuring out
 define new params on these functions
  unserialize
  assert
  session_start
  dirname

Make use of new dirname parameter instead of doing nested calls

Uncomment new PHP7 classes in code_quality.php

We can also re-evaluate Composr's error handling. Is PHP now at the point where realistically everything can be caught and handled as an exception without hacky code that may behave differently on different PHP versions? If so, we may move all Composr's error handling to exceptions also.

When base line compat is for PHP 7.1...

Enhance static typing
 Nullable types
 Void returns

Update CQC to be able to parse new syntax we don't necessarily intend to use right away:
 [] instead of list()
 Support for keys in list()
 Class constant visibility

Enforce Class constant visibility to be set (for PSR-12)

Update phpstub.php
 new functions are currently there as comments, ones we want to use will need structuring out
 define new params on these functions
  get_headers
  unpack

When base line compat is for PHP 7.2...

Update CQC to be able to parse new syntax we don't necessarily intend to use right away:
 Allow a trailing comma for grouped namespaces

Update phpstub.php
 param changes
  The $additional_headers parameter of mail() and mb_sendmail() now also accepts an array instead of a string.

When base line compat is for PHP 7.3...

Update CQC to be able to parse new syntax we don't necessarily intend to use right away:
 Trailing commas in parameters of function calls
 More Flexible Heredoc and Nowdoc Syntax

Update phpstub.php
 new functions
  array_key_first()
  array_key_last()
  hrtime()
  is_countable()
 param changes
  setcookie() and setrawcookie() new signature

When base line compat is for PHP 7.4...

Update CQC to be able to parse new syntax we don't necessarily intend to use right away:
 Spread Operator in Array Expression
 Arrow Functions 2.0
 Null Coalescing Assignment Operator
 Numeric Literal Separator
 New __serialize and __unserialize magic methods
 'real' cast removed, and also is_real function

Update phpstub.php
 param changes
  The preg_replace_callback() and preg_replace_callback_array() functions now accept an additional $flags argument
  strip_tags() now also accepts an array of allowed tags
  proc_open() now accepts an array instead of a string for the command; PHP will take care of any necessary argument escaping

The allow_url_include ini directive is deprecated. Enabling it will generate a deprecation notice at startup

When base line compat is for PHP 8.0...

Enhance static typing
 Union types

For each update...

Update minimum version
 PHP version health check
 install.php
 tut_web_hosting.txt

Search the code for 'LEGACY' comments to resolve
Additional InformationWhen raising our minimum version, we may consider what is the minimum version of PHP still supported. However realistically we also need to consider that webhosts often fail to upgrade to newer versions, and people may be on different versions supplied by popular Red Hat distributions - which back port security fixes. So, proceed with some detailed consideration.
TagsRoadmap: ongoing, Roadmap: v12
Attach Tags
Time estimation (hours)
Sponsorship open

Relationships

related to 0002005 assignedSalman Composr Web standards refresh 
related to 0003681 resolvedChris Graham Composr Run the PHP codebase through PHP_CodeSniffer beautifier 
related to 0003860 resolvedChris Graham Composr Use PSR-12 standard 
related to 0003205 non-assigned Composr testing platform Re-work type system to not use 'mixed' types (on hold) 
related to 0003798 resolvedChris Graham Composr Simplify multiple isset checks 
related to 0003978 non-assigned Composr testing platform Further PHP validation - to generalise the CQC and make it a standalone project 

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2016-07-29 22:18 Chris Graham New Issue
2016-12-07 23:53 Chris Graham Summary Switch to PHP7 => Switch to PHP7 (on hold)
2017-05-04 02:22 Chris Graham Relationship added related to 0002005
2018-02-14 01:56 Chris Graham Description Updated View Revisions
2018-03-17 03:22 Chris Graham Description Updated View Revisions
2018-03-17 03:23 Chris Graham Summary Switch to PHP7 (on hold) => PHP refresh
2018-03-17 21:52 Chris Graham Description Updated View Revisions
2018-03-17 23:33 Chris Graham Description Updated View Revisions
2018-03-17 23:44 Chris Graham Description Updated View Revisions
2018-03-18 00:28 Chris Graham Description Updated View Revisions
2019-06-27 19:06 Chris Graham Summary PHP refresh => PHP refresh (ongoing)
2019-06-27 19:06 Chris Graham Tag Attached: Roadmap: v11 partial implementation
2019-06-27 19:06 Chris Graham Tag Attached: Roadmap: ongoing
2019-06-27 19:07 Chris Graham Tag Attached: Roadmap: v12
2019-08-12 17:23 Chris Graham Relationship added related to 0003681
2019-08-12 17:23 Chris Graham Relationship added related to 0003860
2019-11-14 22:33 Chris Graham Relationship added related to 0003205
2019-11-16 03:41 Chris Graham Description Updated View Revisions
2019-11-16 03:41 Chris Graham Time estimation (hours) 20 =>
2019-11-16 11:27 Chris Graham Additional Information Updated View Revisions
2019-11-30 03:18 Chris Graham Description Updated View Revisions
2019-12-01 21:56 Chris Graham Description Updated View Revisions
2019-12-01 21:56 Chris Graham Tag Detached: Roadmap: v11 partial implementation
2019-12-01 22:53 Chris Graham Relationship added related to 0003798
2019-12-03 20:34 Chris Graham Description Updated View Revisions
2019-12-06 13:54 Chris Graham Relationship added related to 0003978