Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6']
php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6']
os: [ubuntu-latest, windows-latest]

steps:
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ XP Reflection ChangeLog

## ?.?.? / ????-??-??

## 4.0.0 / ????-??-??

* Merged PR #70: Drop PHP 7 support. This implements the last phase of
xp-framework/rfc#343. The ninimum required PHP version goes from
7.4.0 to 8.0.0!
(@thekid)

## 3.7.0 / 2026-07-05

* Made compatible with `xp-framework/ast` version 13.0.0 - adding support
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ XP Reflection
[![Build status on GitHub](https://github.com/xp-framework/reflection/workflows/Tests/badge.svg)](https://github.com/xp-framework/reflection/actions)
[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)
[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)
[![Requires PHP 7.4+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_4plus.svg)](http://php.net/)
[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)
[![Requires PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)
[![Latest Stable Version](https://poser.pugx.org/xp-framework/reflection/version.svg)](https://packagist.org/packages/xp-framework/reflection)

This library provides a replacement for the XP Framework's reflection API.
Expand All @@ -14,8 +13,6 @@ Features
--------
**Concise**: This library aims at reducing code noise of the form `if (hasX(...)) { getX() }` by simply returning NULL from its accessor methods. Null handling has improved with the introduction of the null-coalesce operator `??` in PHP 7 and the null-safe invocation operator `?->` in PHP 8 (and in [XP Compiler](https://github.com/xp-framework/compiler)).

**PHP 7 & 8**: This library handles PHP 8 attributes in both PHP 7 (*using the compiler's AST library*) and PHP 8 (*using its native reflection API*).

**Subcommand**: This library provides an [RFC #0303 integration](https://github.com/xp-framework/rfc/issues/303) and offers a "reflect" subcommand for the new XP runners. See `xp help reflect` on how to use it.

API
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"keywords": ["module", "xp"],
"require" : {
"xp-framework/core": "^12.0 | ^11.0 | ^10.13",
"xp-framework/ast": "^13.0 | ^12.0 | ^11.0 | ^10.0 | ^9.0 | ^8.0 | ^7.6",
"php" : ">=7.4.0"
"php" : ">=8.0.0"
},
"require-dev" : {
"xp-framework/test": "^2.0 | ^1.0"
Expand Down
8 changes: 2 additions & 6 deletions src/main/php/lang/Reflection.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php namespace lang;

use lang\meta\{MetaInformation, FromSyntaxTree, FromAttributes};
use lang\meta\{MetaInformation, FromAttributes};
use lang\reflection\{Type, Package};
use lang\{ClassLoader, ClassNotFoundException, IllegalArgumentException};

Expand All @@ -22,13 +22,9 @@
abstract class Reflection {
private static $meta= null;

public static function annotations($version) {
return $version >= 80000 ? new FromAttributes() : new FromSyntaxTree();
}

/** Lazy-loads meta information extraction */
public static function meta(): MetaInformation {
return self::$meta ?? self::$meta= new MetaInformation(self::annotations(PHP_VERSION_ID));
return self::$meta ?? self::$meta= new MetaInformation(new FromAttributes());
}

/**
Expand Down
237 changes: 0 additions & 237 deletions src/main/php/lang/meta/FromSyntaxTree.class.php

This file was deleted.

Loading
Loading