Skip to content

Commit cd52a21

Browse files
committed
update blog banner
1 parent 60da168 commit cd52a21

5 files changed

Lines changed: 17 additions & 7 deletions

File tree

‎docs/.vitepress/config.mts‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,29 @@ export default withMermaid(
7777
const pageTitle = rawTitle.includes('TypePHP') ? rawTitle : `${rawTitle} | TypePHP`;
7878
const pageDescription = pageData.description || 'Transparent Runtime Type Enforcement for PHP. Bringing reified generics, typed arrays, and 1-pass audit reporting to life with zero C-extensions.';
7979

80+
const frontmatterImage = pageData.frontmatter.image;
81+
const imageUrl = frontmatterImage
82+
? (frontmatterImage.startsWith('http') ? frontmatterImage : `${siteUrl}${frontmatterImage.replace(/^\//, '')}`)
83+
: `${siteUrl}og-default.png`;
84+
8085
return [
8186
['link', { rel: 'canonical', href: canonicalUrl }],
8287
['meta', { property: 'og:site_name', content: 'TypePHP' }],
8388
['meta', { property: 'og:type', content: pageData.relativePath.startsWith('blog/') ? 'article' : 'website' }],
8489
['meta', { property: 'og:title', content: pageTitle }],
8590
['meta', { property: 'og:description', content: pageDescription }],
8691
['meta', { property: 'og:url', content: canonicalUrl }],
87-
['meta', { property: 'og:image', content: `${siteUrl}favicon.svg` }],
88-
['meta', { name: 'twitter:card', content: 'summary' }],
92+
93+
['meta', { property: 'og:image', content: imageUrl }],
94+
['meta', { property: 'og:image:width', content: '1200' }],
95+
['meta', { property: 'og:image:height', content: '630' }],
96+
['meta', { property: 'og:image:type', content: 'image/png' }],
97+
98+
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
8999
['meta', { name: 'twitter:site', content: '@typephp' }],
90100
['meta', { name: 'twitter:title', content: pageTitle }],
91101
['meta', { name: 'twitter:description', content: pageDescription }],
92-
['meta', { name: 'twitter:image', content: `${siteUrl}favicon.svg` }],
102+
['meta', { name: 'twitter:image', content: imageUrl }],
93103
];
94104
},
95105

‎docs/blog/making-legal-states-impossible-in-place-typestates-in-pure-php.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Making Illegal States Impossible: In-Place Typestates in Pure PHP"
33
description: "Why C#, Java, and Rust cannot mutate generic types in-place, the deep computer science behind Typestate-Oriented Programming, and how TypePHP reifies mutable generics at runtime in pure PHP."
4-
date: 2026-11-04
4+
date: 2026-11-03
55
author: Reymart Calicdan
66
layout: doc
77
sidebar: false
@@ -122,7 +122,7 @@ If PHP adopted Rust's model, every state transition would force an awkward reass
122122

123123
### C. The Limits of Static Analysis (Psalm & PHPStan)
124124

125-
Psalm originally pioneered this space with `@psalm-this-out`, which was later introduced to PHPStan 1.9 by Richard van Velzen under the `@phpstan-self-out` banner. Both let a method declare that it changes `$this`’s generic type:
125+
Psalm originally pioneered this space with `@psalm-this-out`, which was later introduced to PHPStan 1.9 by [Richard van Velzen](https://github.com/rvanvelzen) under the `@phpstan-self-out` banner. Both let a method declare that it changes `$this`’s generic type:
126126

127127
```php
128128
/** @self-out self<Authenticated> */
@@ -161,7 +161,7 @@ The same code was analyzed by **PHPStan at Level MAX** and then executed under *
161161

162162
### What PHPStan Reports: 5 False Positives
163163

164-
![PHPStan reporting errors on the typestate example](/blog/the-curious-case-of-mutable-generics/phpstan-typestate-errors.png)
164+
![PHPStan reporting errors on the typestate example](/blog/making-legal-states-impossible-in-place-typestates-in-pure-php/phpstan-typestate-errors.png)
165165

166166
PHPStan surfaces a sea of red:
167167

@@ -175,7 +175,7 @@ None of these are bugs in PHPStan. They are the natural consequence of a tool th
175175

176176
### What Happens When the Code Actually Runs
177177

178-
![TypePHP executing the same code cleanly](/blog/the-curious-case-of-mutable-generics/typephp-typestate-success.png)
178+
![TypePHP executing the same code cleanly](/blog/making-legal-states-impossible-in-place-typestates-in-pure-php/typephp-typestate-success.png)
179179

180180
Now run the exact same code below inside TypePHP's live WebAssembly engine:
181181

docs/public/blog/the-curious-case-of-mutable-generics/phpstan-typestate-errors.png renamed to docs/public/blog/making-legal-states-impossible-in-place-typestates-in-pure-php/phpstan-typestate-errors.png

File renamed without changes.

docs/public/blog/the-curious-case-of-mutable-generics/typephp-typestate-success.png renamed to docs/public/blog/making-legal-states-impossible-in-place-typestates-in-pure-php/typephp-typestate-success.png

File renamed without changes.

‎docs/public/og-default.png‎

262 KB
Loading

0 commit comments

Comments
 (0)