PHP.GT

Latest releases

Daemon: CI and type safety improvements

Published on by Greg Bowler

We’re one step closer to a CI environment fully hosted within Github Actions now, with PHPUnit and PHPStan tests being run within Actions. Codesniffer is planned soon too.

PHP 8 compatibility is made possible thanks to an updated dependency tree.

Config: Better type safety & CI

Published on by Greg Bowler

This patch release includes two improvements: 1) CI is handled by Github Actions now - you can check out the build history at https://github.com/PhpGt/Csrc/actions 2) PHPStan level 6 has been applied to the code, meaning certain type hints have been improved for greater readability and future maintainability.

Amongst these improvements is the introduction of the TypeSafeGetter interface which makes nullable type safe getters more consistent across PHP.Gt repositories.

TypeSafeGetter: NullableTypeSafeGetter trait

Published on by Greg Bowler

This minor release introduces the NullableTypeSafeGetter trait, which removes boilerplate code found throughout PHP.Gt repositories.

NullableTypeSafeGetter implements all functions of the TypeSafeGetter trait, apart from get, which needs to be defined by the implementing class.

DomValidation: Better type safety & CI

Published on by Greg Bowler

This patch pre-release increases the code quality by inserting much better type hinting throughout.

Github Actions has been implemented, replacing CircleCI, so all tests are in one single place.

SqlBuilder: Compatibility improvements

Published on by Greg Bowler

In this patch pre-release, we are gaining the following improvements:

  • All functions have better type safety
  • Move to Github Actions CI for greatly improved tests and quality assurance
  • Documentation fixes

Sync: Github actions

Published on by Greg Bowler

No new functionality in this patch release, just an improved CI runner now hosted on Github Actions.

Have fun!

Promise: Chained Promises will always resolve

Published on by Greg Bowler

Along with PHP 7.4 - 8.0 interoperability, this update brings bugfix #12.

If any Chainable returns an instance of PromiseInterface, the next Chainable will not be called until the PromiseInterface resolves, at which point the next Chainable will be resolved with the resolved value of the promise, instead of the Promise itself.

This is more consistent with how the Web APIs work. Specifically, using the Fetch API - a Promise is returned for the actual fetch, but also for retrieving the response body. The final callback in the chain doesn’t want to be provided with an unresolved promise, instead it only cares about the final resolved value of the promise.

Async: Full Loop and Timer functionality

Published on by Greg Bowler

With a working Loop and Timer, this library can be used to produce Promise-based async operations. The v1 release will be made when the Event functionality is implemented and tested.

Promise: Refactored Promise for simplicity

Published on by Greg Bowler

The original v1 release of this library was feature complete, but it was based on the complex design of CommonJS Promises. There were a number of issues that arose from the design limitations imposed by this decision, but the unit tests were already in place, so it was worth it to refactor the Promise class completely.

The new implementation has the same external functionality, but with two main improvements: 1) much better compatibility with Web API Promises; 2) much, much simpler.

The main point of this refactor is to move to a simpler queue-based system, rather than a recursive one. You can see the queue in action as the Promise’s chain property, which will contain a reference to each of the new Chainable objects: ThenChain, CatchChain and FinallyChain.

Have fun!

DataObject: JsonData objects

Published on by Greg Bowler

An extension to the DataObject, the JsonData object can represent the datatypes of a standard Json response, which includes arrays and primitives.

DataObject: All simple DTO features

Published on by Greg Bowler

This pre-release completes the features of a simple DTO class to the original specification. v1 is being held back while a JSON-compatible design is completed.

DataObject: DataObject getters

Published on by Greg Bowler

The following getters have been tested and implemented:

  • getInt
  • getString
  • getBool
  • getFloat
  • getDateTime

A DataObject can also be converted to a nested array or object using the asArray and asObject methods.

Promise: Public release

Published on by Greg Bowler

Promise is now v1 and will start making its way into the asynchronous functionality throughout PHP.Gt! Full test coverage has been shipped with this release.

Please leave any questions or comments in the issues list.

Have fun, and stay productive!

Promise: HTTPlug compatibility

Published on by Greg Bowler

This is the final pre-release before v1, and with it comes full compatibility with HTTPlug. Although relatively simple, this is a major piece of functionality that will make PHP.Gt repositories much more compatible with other standards.

Promise: Initial pre-release

Published on by Greg Bowler

The Promise library is being extracted from the PHP.Gt/Fetch repository, and in the process being simplified and code quality is being improved thanks to PHPStan.

Session: Silently recover from destroyed session

Published on by Greg Bowler

In this patch release, you’ll see a newly improved CI pipeline, now fully utilising Github Actions.

The only changed functionality seen in this release is to silently fail on a session_destroy call, which occurs if the tmp file is removed/damaged at session start. The failure is now silent, which means that there will be no risk in accidentally sending the headers early if the error reporting is set to all.