Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
./build/flow.phar --version

- name: "Upload Flow PHAR for Docker build"
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: "docker-phar"
path: "build/flow.phar"
Expand All @@ -72,7 +72,7 @@ jobs:
BUILD_TAG=${GITHUB_SHA:0:7}
echo "BUILD_TAG=$BUILD_TAG" >> "$GITHUB_ENV"

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: flow-${{ env.BUILD_TAG }}.phar
path: build/flow.phar
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
run: "just docs-api"

- name: "Setup Node.js"
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '20'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/job-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
persist-credentials: false

- name: "Download Flow PHAR"
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: "${{ inputs.phar-artifact }}"
path: "build"
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
touch "${DIGESTS_DIR}/${DIGEST#sha256:}"

- name: "Upload digest"
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: "digests-${{ env.PLATFORM_PAIR }}"
path: "${{ runner.temp }}/digests/*"
Expand All @@ -121,7 +121,7 @@ jobs:

steps:
- name: "Download digests"
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
path: "${{ runner.temp }}/digests"
pattern: "digests-*"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/job-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
uses: "./.github/actions/pg-query-ext"

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '22'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: codelytv/pr-size-labeler@095a41fca88b8764fd9e008ad269bcdb82bb38b9 # v1.10.4
- uses: codelytv/pr-size-labeler@19c335e7695ba922de938806dd129f0a9b992644 # v1.12.0
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
xs_label: 'size: XS'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
./build/flow.phar

- name: "Upload Flow PHAR for Docker build"
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: "docker-phar"
path: "build/flow.phar"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
run: "just phar"

- name: "Upload Flow PHAR"
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: "website-flow-phar"
path: "web/landing/assets/wasm/tools/flow.phar"
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
composer-file: "web/landing/composer.lock"

- name: "Setup Node.js"
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "22"

Expand All @@ -112,7 +112,7 @@ jobs:
# replaces the committed phar so the playground runs this commit's Flow, not whatever was
# last checked in
- name: "Download Flow PHAR"
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: "website-flow-phar"
path: "web/landing/assets/wasm/tools"
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"ext-zlib": "*",
"composer-runtime-api": "^2.2",
"async-aws/s3": "^2.6 || ^3.0",
"brick/math": "^0.12 || ^0.13 || ^0.14 || ^0.15 || ^0.16 || ^0.17 || ^0.18",
"brick/math": "^0.12 || ^0.13 || ^0.14 || ^0.15 || ^0.16 || ^0.17 || ^0.18 || ^1.0",
"cmsig/seal": "^0.12",
"coduo/php-humanizer": "^5.0",
"cuyz/valinor": "^2.4",
Expand Down
61 changes: 31 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions documentation/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ Upgrading from older versions: [0.35.x to 0.40.x](/documentation/upgrading-0.35-

---

## Upgrading from 0.46.x to 0.47.x

### 1) `flow-php/types` - leaf types are no longer generic

| Before | After |
|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| `StringType<string>`, `DateTimeType<\DateTimeInterface>`, `UuidType<Uuid>`, ... | `StringType`, `DateTimeType`, `UuidType` - leaf types implement `Type<string>`, ... directly |
| `ListType<list<T>>`, `MapType<array<TKey, TValue>>` | `ListType<T>`, `MapType<TKey, TValue>` |
| Mago `plugins = ["flow-php"]` infers `type_structure()` shapes | Built-in plugin no longer infers them - use `flow-php/mago-types-bridge` (`plugins = ["flow/types"]`) |

---

## Upgrading from 0.45.x to 0.46.x

### 1) `flow-php/etl-adapter-postgresql`, `flow-php/etl-adapter-doctrine` - keyset reads reject NULL keys up front
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ public function __construct(
&& (
$flags
& ~(JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION)
)
=== 0
) === 0
? new RustJsonEncoder($flags, $dateTimeFormat, $dateFormat, $php)
: $php;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ private function typeToJsonSchema(Type $type): array
}

/**
* @param MapType<array<array-key, mixed>> $type
* @param MapType<array-key, mixed> $type
*
* @return array<string, mixed>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public function test_yields_or_refuses_exactly_what_json_machine_does(string $do
$stream = $filesystem->readFrom(path('memory://document.json'));

$fallback = static function (int $skip) use ($document, $options): Generator {
// @mago-ignore analysis:mixed-assignment
// @mago-ignore analysis:mixed-assignment
foreach (Items::fromString($document, $options) as $key => $item) {
if ($skip > 0) {
$skip--;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@

use Mago\Sdk\Analyzer\Type;
use Mago\Sdk\Analyzer\Type\ArrayItem;
use Mago\Sdk\Analyzer\Type\DerivedType;
use Mago\Sdk\Analyzer\Type\DerivedTypeKind;
use Mago\Sdk\Analyzer\Type\NamedObjectType;

/**
* Derives a single shape entry from a `type_structure()` elements-array item. The member type is
* the value's first type parameter; a `structure_element()` marker whose second parameter
* (TOptional) is a literal `true` makes the key possibly undefined.
*/
final readonly class ElementShape
{
private const string STRUCTURE_ELEMENT = 'Flow\Types\Type\Logical\StructureElement';

private const string TYPE = 'Flow\Types\Type';

public function derive(ArrayItem $item): ?ArrayItem
{
$namedObject = $this->singleNamedObject($item->type);
Expand All @@ -25,7 +24,14 @@ public function derive(ArrayItem $item): ?ArrayItem
return null;
}

$member = $namedObject->parameters[0] ?? null;
// Leaf types like StringType have no type parameters; Mago resolves T via @implements Type<X>.
$member = strcasecmp($namedObject->name, self::STRUCTURE_ELEMENT) === 0
? $namedObject->parameters[0] ?? null
: Type::fromAtomic(new DerivedType(DerivedTypeKind::TemplateType, [
$item->type,
Type::namedObject(self::TYPE),
Type::literalString('T'),
]));

if ($member === null) {
return null;
Expand Down
Loading
Loading