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
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/DSL/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ function filesystem_cache(
#[DocumentationDSL(module: Module::CORE, type: DSLType::EXTRACTOR)]
function batched_by(Extractor $extractor, string|Reference $column, ?int $min_size = null): BatchByExtractor
{
// @mago-ignore analysis:invalid-operand
// @mago-ignore analysis:invalid-operand,impossible-condition,redundant-comparison,redundant-logical-operation
if ($min_size !== null && $min_size <= 0) {
throw new InvalidArgumentException('Minimum batch size must be greater than 0, given: ' . $min_size);
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Extractor/BatchByExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(
private Reference $column,
private ?int $minSize = null,
) {
// @mago-ignore analysis:invalid-operand
// @mago-ignore analysis:invalid-operand,impossible-condition,redundant-comparison,redundant-logical-operation
if ($this->minSize !== null && $this->minSize <= 0) {
throw new InvalidArgumentException('Minimum batch size must be greater than 0, given: ' . $this->minSize);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(
private Reference $column,
private ?int $minSize = null,
) {
// @mago-ignore analysis:invalid-operand
// @mago-ignore analysis:invalid-operand,impossible-condition,redundant-comparison,redundant-logical-operation
if ($this->minSize !== null && $this->minSize <= 0) {
throw new InvalidArgumentException('Minimum batch size must be greater than 0, given: ' . $this->minSize);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public function __construct(
private int $size,
) {
// @mago-ignore analysis:invalid-operand
// @mago-ignore analysis:invalid-operand,impossible-condition,redundant-comparison
if ($this->size <= 0) {
throw new InvalidArgumentException('Batch size must be greater than 0, given: ' . $this->size);
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Transformation/BatchBy.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(
private string|Reference $column,
private ?int $minSize = null,
) {
// @mago-ignore analysis:invalid-operand
// @mago-ignore analysis:invalid-operand,impossible-condition,redundant-comparison,redundant-logical-operation
if ($this->minSize !== null && $this->minSize <= 0) {
throw new InvalidArgumentException('Minimum batch size must be greater than 0, given: ' . $this->minSize);
}
Expand Down
2 changes: 0 additions & 2 deletions src/core/etl/src/Flow/Floe/Decoding/JsonDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public function __construct()
$create = Closure::bind(
static function (string $value, bool $isObject) use ($reflection): Json {
$json = $reflection->newInstanceWithoutConstructor();
// @mago-ignore analysis:invalid-property-write
$json->value = $value;
// @mago-ignore analysis:invalid-property-write
$json->isObject = $isObject;

return $json;
Expand Down
1 change: 0 additions & 1 deletion src/core/etl/src/Flow/Floe/Decoding/UuidDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public function __construct()
$create = Closure::bind(
static function (string $value) use ($reflection): Uuid {
$uuid = $reflection->newInstanceWithoutConstructor();
// @mago-ignore analysis:invalid-property-write
$uuid->value = $value;

return $uuid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function supportsJsonb(): bool

public function supportsJsonPath(): bool
{
// @mago-ignore analysis:redundant-comparison
return $this->value >= self::V12->value; // Added in PostgreSQL 12
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions web/landing/assets/styles/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ code {
@apply font-semibold text-xl text-slate-900 mt-7 mb-2 dark:text-white;
}

#blog-post h4 {
@apply font-semibold text-lg text-slate-900 mt-6 mb-2 dark:text-white;
}

#blog-post p,
#blog-post ul,
#blog-post ol {
Expand Down Expand Up @@ -176,6 +180,21 @@ code {
dark:border-blue-100 dark:text-white/75;
}

#blog-post .callout-info {
@apply border-l-2 border-blue-300 bg-blue-300/[0.04] rounded-r-lg px-4 py-3 my-5 text-slate-700
dark:border-blue-100 dark:bg-blue-100/[0.08] dark:text-white/85;
}

#blog-post .callout-warning {
@apply border-l-2 border-brown-200 bg-brown-100/[0.06] rounded-r-lg px-4 py-3 my-5 text-slate-700
dark:border-brown-100 dark:bg-brown-100/[0.08] dark:text-white/85;
}

#blog-post .callout-danger {
@apply border-l-2 border-orange-200 bg-orange-100/[0.05] rounded-r-lg px-4 py-3 my-5 text-slate-700
dark:border-orange-100 dark:bg-orange-100/[0.08] dark:text-white/85;
}

#blog-post table {
@apply w-full table-auto my-5 border-collapse rounded-lg overflow-hidden border border-slate-200
dark:border-white/10;
Expand All @@ -190,6 +209,14 @@ code {
@apply border-b border-slate-200 px-3 py-2 dark:border-white/10;
}

#blog-post .highlight.green {
@apply bg-green-500/[0.08] dark:bg-green-400/[0.1];
}

#blog-post .highlight.red {
@apply bg-red-500/[0.08] dark:bg-red-400/[0.1];
}

#blog-post img {
@apply max-w-full h-auto rounded-lg my-6 mx-auto;
}
Expand Down
6 changes: 6 additions & 0 deletions web/landing/src/Flow/Website/Blog/Posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ final class Posts
'date' => '2026-06-29',
'slug' => 'flow-php-release-0410',
],
[
'title' => 'Performance Optimizations',
'description' => 'Floe is a dedicated binary format, created to speedup serialization and reduce serialized content size of Rows.',
'date' => '2026-07-23',
'slug' => 'performance-optimizations',
],
];

/**
Expand Down
11 changes: 11 additions & 0 deletions web/landing/src/Flow/Website/Controller/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,15 @@ public function posts(): Response
'posts' => (new Posts())->all(),
]);
}

#[Route('/rss.xml', name: 'blog_rss')]
public function rss(): Response
{
$response = $this->render('blog/rss.xml.twig', [
'posts' => (new Posts())->all(),
]);
$response->headers->set('Content-Type', 'application/rss+xml; charset=UTF-8');

return $response;
}
}
2 changes: 2 additions & 0 deletions web/landing/templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('images/favicons/favicon-16x16.png') }}">
<link rel="shortcut icon" href="{{ asset('images/favicons/favicon.ico') }}">

<link rel="alternate" type="application/rss+xml" title="Flow PHP Blog" href="{{ url('blog_rss') }}">

<link rel="preload" fetchpriority="high" href="{{ asset('vendor/@fontsource-variable/cabin/files/cabin-latin-wght-normal.woff2') }}" as="font" crossorigin>

{% block stylesheets %}
Expand Down
22 changes: 15 additions & 7 deletions web/landing/templates/blog/post.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@

{% block main %}
<section class="mx-auto max-w-screen-2xl px-4 sm:px-6 lg:px-8 mt-8">
<nav aria-label="Breadcrumb" class="text-sm text-slate-500 mb-4 dark:text-white/55">
<ol class="inline-flex items-center gap-2">
<li><a class="text-slate-700 hover:text-slate-900 no-underline dark:text-white/75 dark:hover:text-white" href="{{ path('blog') }}">Blog</a></li>
<li aria-hidden="true">/</li>
<li class="text-slate-800 dark:text-white/85">{{ post.title }}</li>
</ol>
</nav>
<div class="flex items-center justify-between gap-4 mb-4">
<nav aria-label="Breadcrumb" class="text-sm text-slate-500 dark:text-white/55">
<ol class="inline-flex items-center gap-2">
<li><a class="text-slate-700 hover:text-slate-900 no-underline dark:text-white/75 dark:hover:text-white" href="{{ path('blog') }}">Blog</a></li>
<li aria-hidden="true">/</li>
<li class="text-slate-800 dark:text-white/85">{{ post.title }}</li>
</ol>
</nav>
<a class="shrink-0 inline-flex items-center gap-1.5 text-sm text-blue-300 hover:text-orange-300 !no-underline dark:text-blue-100 dark:hover:text-orange-100"
href="{{ path('blog_rss') }}">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="h-4 w-4" aria-hidden="true"><path d="M6.18 15.64a2.18 2.18 0 1 1 0 4.36 2.18 2.18 0 0 1 0-4.36zM4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44zm0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/></svg>
<span class="hidden sm:inline">Subscribe via RSS</span>
<span class="sm:hidden">RSS</span>
</a>
</div>
</section>

{{ block('article') }}
Expand Down
5 changes: 5 additions & 0 deletions web/landing/templates/blog/posts.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
<p class="mt-3 muted">
Release notes, design decisions, and stories from building Flow.
</p>
<a class="mt-4 inline-flex items-center gap-1.5 text-sm text-blue-300 hover:text-orange-300 no-underline dark:text-blue-100 dark:hover:text-orange-100"
href="{{ path('blog_rss') }}">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="h-4 w-4" aria-hidden="true"><path d="M6.18 15.64a2.18 2.18 0 1 1 0 4.36 2.18 2.18 0 0 1 0-4.36zM4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44zm0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/></svg>
Subscribe via RSS
</a>
</div>

<div class="mt-10 grid gap-5 md:grid-cols-2 xl:grid-cols-3">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use function Flow\ETL\DSL\df;

df()
->read(from_xxx())
->batchSize(1000)
->run();
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

namespace Flow\ETL\Row;

/**
* @template TPhysical
*/
interface Encoder
{
/**
* @param list<TypedRowValues> $batch
*
* @return list<TPhysical>
*/
public function encode(array $batch): array;

/**
* @param list<TPhysical> $batch
*
* @return list<RawRowValues>
*/
public function decode(array $batch): array;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Flow\ETL\Row;

use Flow\ETL\Rows;
use Flow\ETL\Schema;

interface Hydrator
{
/**
* @param list<RawRowValues> $batch
*/
public function cast(array $batch, ?Schema $schema = null): Rows;

/**
* @return list<TypedRowValues>
*/
public function dehydrate(Rows $rows): array;

/**
* @param list<RawRowValues> $batch
*/
public function hydrate(array $batch, ?Schema $schema = null): Rows;
}
Loading
Loading