Skip to content

Commit

Permalink
Merge branch 'next' into develop
Browse files Browse the repository at this point in the history
* next:
  test against lowest dependencies
  use ramsey/composer-install
  fix php version
  fix psalm errors
  update dependencies
  CS
  use CS 2
  change email
  CS
  declare all structures as immutable
  prepare for next release
  drop php 7 support
  • Loading branch information
Baptouuuu committed Mar 27, 2022
2 parents afec649 + 076fe2e commit dcce687
Show file tree
Hide file tree
Showing 35 changed files with 682 additions and 518 deletions.
49 changes: 14 additions & 35 deletions .github/workflows/ci.yml
Expand Up @@ -8,7 +8,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
php-version: ['7.4', '8.0']
php-version: ['8.1']
dependencies: ['lowest', 'highest']
name: 'PHPUnit'
steps:
- name: Checkout
Expand All @@ -19,17 +20,10 @@ jobs:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
coverage: xdebug
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
- name: Composer
uses: "ramsey/composer-install@v2"
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Dependencies
run: composer install
dependency-versions: ${{ matrix.dependencies }}
- name: PHPUnit
run: vendor/bin/phpunit --coverage-clover=coverage.clover
- uses: codecov/codecov-action@v1
Expand All @@ -39,7 +33,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.4', '8.0']
php-version: ['8.1']
dependencies: ['lowest', 'highest']
name: 'Psalm'
steps:
- name: Checkout
Expand All @@ -49,24 +44,17 @@ jobs:
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
- name: Composer
uses: "ramsey/composer-install@v2"
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Dependencies
run: composer install
dependency-versions: ${{ matrix.dependencies }}
- name: Psalm
run: vendor/bin/psalm --shepherd
cs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.4']
php-version: ['8.1']
name: 'CS'
steps:
- name: Checkout
Expand All @@ -76,16 +64,7 @@ jobs:
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-${{ matrix.php-version }}-composer-
- name: Install Dependencies
run: composer install --no-progress
- name: Composer
uses: "ramsey/composer-install@v2"
- name: CS
run: vendor/bin/php-cs-fixer fix --diff --dry-run --diff-format udiff
run: vendor/bin/php-cs-fixer fix --diff --dry-run
File renamed without changes.
17 changes: 8 additions & 9 deletions composer.json
Expand Up @@ -8,17 +8,17 @@
"authors": [
{
"name": "Baptiste Langlade",
"email": "langlade.baptiste@gmail.com"
"email": "baptiste.langlade@hey.com"
}
],
"support": {
"issues": "http://github.com/Innmind/StackTrace/issues"
},
"require": {
"php": "~7.4|~8.0",
"innmind/immutable": "~3.0",
"innmind/url": "~3.0",
"innmind/graphviz": "~2.0"
"php": "~8.1",
"innmind/immutable": "~4.1",
"innmind/url": "~4.0",
"innmind/graphviz": "~3.1"
},
"autoload": {
"psr-4": {
Expand All @@ -32,10 +32,9 @@
},
"require-dev": {
"phpunit/phpunit": "~9.0",
"innmind/file-watch": "~2.0",
"innmind/operating-system": "^2.0",
"vimeo/psalm": "~4.4",
"innmind/operating-system": "~3.0",
"vimeo/psalm": "~4.21",
"innmind/black-box": "^4.16",
"innmind/coding-standard": "^1.1"
"innmind/coding-standard": "~2.0"
}
}
92 changes: 38 additions & 54 deletions graph.dot

Large diffs are not rendered by default.

473 changes: 254 additions & 219 deletions graph.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions render.php
Expand Up @@ -2,16 +2,15 @@

require __DIR__.'/vendor/autoload.php';

use function Innmind\FileWatch\bootstrap;
use Innmind\OperatingSystem\Factory;
use Innmind\TimeWarp\Halt\Usleep;
use Innmind\Url\Path;
use Innmind\Server\Control\Server\Command;
use Innmind\Immutable\Either;

$os = Factory::build();
$watch = bootstrap($os->control()->processes(), new Usleep, $os->clock());
$watch = $os->filesystem()->watch(Path::of(__DIR__.'/graph.dot'));

$watch(Path::of(__DIR__.'/graph.dot'))(function() use ($os): void {
$watch($os, function($os): Either {
$process = $os
->control()
->processes()
Expand All @@ -21,8 +20,9 @@
->withShortOption('o', 'graph.svg')
->withArgument('graph.dot')
);
$process->wait();

echo $process->output()->toString();
echo 'rendered'."\n";

return Either::right($os);
});
3 changes: 3 additions & 0 deletions src/CallFrame.php
Expand Up @@ -5,6 +5,9 @@

use Innmind\Immutable\Sequence;

/**
* @psalm-immutable
*/
interface CallFrame
{
public function arguments(): Sequence;
Expand Down
7 changes: 6 additions & 1 deletion src/CallFrame/FunctionCall.php
Expand Up @@ -10,6 +10,9 @@
use Innmind\Url\Url;
use Innmind\Immutable\Sequence;

/**
* @psalm-immutable
*/
final class FunctionCall implements UserLand
{
private FunctionName $functionName;
Expand All @@ -18,13 +21,15 @@ final class FunctionCall implements UserLand
private Sequence $arguments;

/**
* @no-named-arguments
*
* @param mixed $arguments
*/
public function __construct(
FunctionName $functionName,
Url $file,
Line $line,
...$arguments
...$arguments,
) {
$this->functionName = $functionName;
$this->file = $file;
Expand Down
3 changes: 3 additions & 0 deletions src/CallFrame/InternalFunctionCall.php
Expand Up @@ -11,13 +11,16 @@

/**
* Function called within language function (ie: array_map) or by reflection
* @psalm-immutable
*/
final class InternalFunctionCall implements CallFrame
{
private FunctionName $functionName;
private Sequence $arguments;

/**
* @no-named-arguments
*
* @param mixed $arguments
*/
public function __construct(FunctionName $functionName, ...$arguments)
Expand Down
5 changes: 4 additions & 1 deletion src/CallFrame/InternalMethodCall.php
Expand Up @@ -12,6 +12,7 @@

/**
* Function called within language function (ie: array_map) or by reflection
* @psalm-immutable
*/
final class InternalMethodCall implements CallFrame
{
Expand All @@ -20,12 +21,14 @@ final class InternalMethodCall implements CallFrame
private Sequence $arguments;

/**
* @no-named-arguments
*
* @param mixed $arguments
*/
public function __construct(
ClassName $class,
Method $method,
...$arguments
...$arguments,
) {
$this->class = $class;
$this->method = $method;
Expand Down
5 changes: 4 additions & 1 deletion src/CallFrame/InternalStaticMethodCall.php
Expand Up @@ -12,6 +12,7 @@

/**
* Function called within language function (ie: array_map) or by reflection
* @psalm-immutable
*/
final class InternalStaticMethodCall implements CallFrame
{
Expand All @@ -20,12 +21,14 @@ final class InternalStaticMethodCall implements CallFrame
private Sequence $arguments;

/**
* @no-named-arguments
*
* @param mixed $arguments
*/
public function __construct(
ClassName $class,
Method $method,
...$arguments
...$arguments,
) {
$this->class = $class;
$this->method = $method;
Expand Down
7 changes: 6 additions & 1 deletion src/CallFrame/MethodCall.php
Expand Up @@ -11,6 +11,9 @@
use Innmind\Url\Url;
use Innmind\Immutable\Sequence;

/**
* @psalm-immutable
*/
final class MethodCall implements UserLand
{
private ClassName $class;
Expand All @@ -20,14 +23,16 @@ final class MethodCall implements UserLand
private Sequence $arguments;

/**
* @no-named-arguments
*
* @param mixed $arguments
*/
public function __construct(
ClassName $class,
Method $method,
Url $file,
Line $line,
...$arguments
...$arguments,
) {
$this->class = $class;
$this->method = $method;
Expand Down
7 changes: 6 additions & 1 deletion src/CallFrame/StaticMethodCall.php
Expand Up @@ -11,6 +11,9 @@
use Innmind\Url\Url;
use Innmind\Immutable\Sequence;

/**
* @psalm-immutable
*/
final class StaticMethodCall implements UserLand
{
private ClassName $class;
Expand All @@ -20,14 +23,16 @@ final class StaticMethodCall implements UserLand
private Sequence $arguments;

/**
* @no-named-arguments
*
* @param mixed $arguments
*/
public function __construct(
ClassName $class,
Method $method,
Url $file,
Line $line,
...$arguments
...$arguments,
) {
$this->class = $class;
$this->method = $method;
Expand Down
3 changes: 3 additions & 0 deletions src/CallFrame/UserLand.php
Expand Up @@ -9,6 +9,9 @@
};
use Innmind\Url\Url;

/**
* @psalm-immutable
*/
interface UserLand extends CallFrame
{
public function file(): Url;
Expand Down

0 comments on commit dcce687

Please sign in to comment.