Skip to content

Commit

Permalink
Merge pull request #179 from xp-framework/refactor/rfc-343-step-1
Browse files Browse the repository at this point in the history
XP 12 compatibility
  • Loading branch information
thekid committed Mar 23, 2024
2 parents 944d078 + f0968b3 commit 844f928
Show file tree
Hide file tree
Showing 27 changed files with 55 additions and 1,088 deletions.
6 changes: 3 additions & 3 deletions .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.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
os: [ubuntu-latest, windows-latest]

steps:
Expand All @@ -24,7 +24,7 @@ jobs:
run: git config --system core.autocrlf false; git config --system core.eol lf

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
Expand All @@ -40,7 +40,7 @@ jobs:
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ XP Compiler
[![Build status on GitHub](https://github.com/xp-framework/compiler/workflows/Tests/badge.svg)](https://github.com/xp-framework/compiler/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.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)
[![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/)
[![Latest Stable Version](https://poser.pugx.org/xp-framework/compiler/version.png)](https://packagist.org/packages/xp-framework/compiler)

Expand All @@ -16,7 +16,7 @@ After adding the compiler to your project via `composer require xp-framework/com

Example
-------
The following code uses Hack language, PHP 8.3, PHP 8.2, 8.1, 8.0, PHP 7.4, PHP 7.3, PHP 7.2, PHP 7.1 and PHP 7.0 features but runs on anything >= PHP 7.0. Builtin features from newer PHP versions are translated to work with the currently executing runtime if necessary.
The following code uses Hack language, PHP 8.3, PHP 8.2, 8.1 and 8.0 features but runs on anything >= PHP 7.4. Builtin features from newer PHP versions are translated to work with the currently executing runtime if necessary.

```php
<?php // In a file "HelloWorld.php"
Expand Down Expand Up @@ -87,9 +87,6 @@ $ xp compile
Usage: xp compile <in> [<out>]

@FileSystemCL<./vendor/xp-framework/compiler/src/main/php>
lang.ast.emit.PHP70
lang.ast.emit.PHP71
lang.ast.emit.PHP72
lang.ast.emit.PHP74
lang.ast.emit.PHP80
lang.ast.emit.PHP81
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"description" : "XP Compiler",
"keywords": ["module", "xp"],
"require" : {
"xp-framework/core": "^11.6 | ^10.16",
"xp-framework/reflection": "^2.13",
"xp-framework/ast": "^10.1",
"php" : ">=7.0.0"
"xp-framework/core": "^12.0 | ^11.6 | ^10.16",
"xp-framework/reflection": "^3.0 | ^2.13",
"xp-framework/ast": "^11.0 | ^10.1",
"php" : ">=7.4.0"
},
"require-dev" : {
"xp-framework/test": "^1.5"
"xp-framework/test": "^2.0 | ^1.5"
},
"bin": ["bin/xp.xp-framework.compiler.compile", "bin/xp.xp-framework.compiler.ast"],
"autoload" : {
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/lang/ast/Compiled.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private static function parse($lang, $in, $version, $out, $file) {
* @param string $opened
*/
public function stream_open($path, $mode, $options, &$opened) {
list($version, $file)= explode('://', $path);
[$version, $file]= explode('://', $path);
$stream= self::$source[$file][1]->getResourceAsStream($file);
self::parse(self::$source[$file][0], $stream->in(), $version, $this, $file);
$opened= $stream->getURI();
Expand Down

This file was deleted.

24 changes: 0 additions & 24 deletions src/main/php/lang/ast/emit/OmitConstModifiers.class.php

This file was deleted.

18 changes: 0 additions & 18 deletions src/main/php/lang/ast/emit/OmitPropertyTypes.class.php

This file was deleted.

18 changes: 0 additions & 18 deletions src/main/php/lang/ast/emit/OmitReturnTypes.class.php

This file was deleted.

139 changes: 0 additions & 139 deletions src/main/php/lang/ast/emit/PHP70.class.php

This file was deleted.

60 changes: 0 additions & 60 deletions src/main/php/lang/ast/emit/PHP71.class.php

This file was deleted.

Loading

0 comments on commit 844f928

Please sign in to comment.