Php Modern logo

Php Modern

Organization
OrcaQubits
php-modern

Write modern PHP 8.x code — typed properties, enums, readonly classes, match expressions, named arguments, union/intersection types, fibers, attributes, and constructor promotion. Use when writing PHP for Magento or any PHP 8.x project.

Overview

PublisherOrcaQubits
Repositoryagentic-commerce-skills-plugins
Skill namephp-modern
Stars
40
Forks
17
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by OrcaQubits on GitHub. Read the source before you install it.

Installation

Install the Php Modern AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/magento2-commerce/skills/php-modern
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OrcaQubits/agentic-commerce-skills-plugins.git /tmp/agentic-commerce-skills-plugins
mkdir -p .claude/skills
cp -r /tmp/agentic-commerce-skills-plugins/magento2-commerce/skills/php-modern .claude/skills/php-modern
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Php Modern in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Php Modern on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Php Modern is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Modern PHP 8.x Development

Before writing code

Fetch live docs: Web-search site:php.net manual migration for the latest PHP migration guide and new features. Check https://www.php.net/releases/ for current supported versions.

PHP 8.0 Features

Constructor Property Promotion

Declare and assign properties directly in the constructor signature — eliminates boilerplate. Heavily used in Magento service classes.

Named Arguments

Call functions with parameter names: array_slice(array: $arr, offset: 2). Improves readability for functions with many parameters.

Match Expressions

Type-safe switch replacement that returns a value. No fall-through, strict comparison. Better than switch for value mapping.

Union Types

int|string in parameter and return types. Allows multiple type declarations.

Nullsafe Operator

$obj?->method()?->property — short-circuits to null if any part is null. Replaces nested null checks.

Attributes

Native metadata annotations: #[Route('/path')], #[Override]. Replace docblock annotations with first-class language support.

PHP 8.1 Features

Enums

First-class enumerations — backed (string/int) and unit enums. Perfect for status codes, types, categories. Use backed enums for database/API values.

Readonly Properties

public readonly string $name — can only be set once (usually in constructor). Enforces immutability.

Fibers

Lightweight concurrency primitives — PHP-level coroutines. Foundation for async frameworks. Limited direct usage in Magento.

Intersection Types

TypeA&TypeB — value must satisfy ALL types. Useful for ensuring a parameter implements multiple interfaces.

First-class Callable Syntax

strlen(...) creates a Closure from a function. Cleaner than Closure::fromCallable('strlen').

PHP 8.2 Features

Readonly Classes

readonly class Dto { ... } — all properties are implicitly readonly. Perfect for Data Transfer Objects and value objects.

Deprecated: Dynamic Properties

Creating properties not declared in the class is deprecated. Magento core addressed this throughout — always declare properties.

Standalone Types

true, false, null as standalone types in declarations.

Constants in Traits

Traits can now define constants.

PHP 8.3 Features

Typed Class Constants

const string NAME = 'value'; — type-safe constants. Strengthens contract enforcement.

#[\Override] Attribute

Documents that a method intentionally overrides a parent method. Compiler error if the parent method doesn't exist.

json_validate() Function

Validate JSON without decoding — faster than json_decode + error check.

Dynamic Class Constant Fetch

$class::{$constant} — dynamic constant access.

PHP 8.4 Features

Property Hooks

Define get/set behavior directly on properties:

php
public string $name {
    set => strtolower($value);
    get => ucfirst($this->name);
}

Asymmetric Visibility

public private(set) string $name — readable publicly, writable only privately.

PHP for Magento Specifically

Type Safety

  • Use strict types: declare(strict_types=1); in all files
  • Type all parameters, return types, and properties
  • Use union types for nullable: ?string or string|null

Value Objects

Use readonly classes for DTOs and value objects — common in service layers.

Enums for Status Codes

Replace string/int constants with backed enums for order statuses, product types, etc.

Constructor Promotion in Magento

Magento uses constructor injection extensively — promotion reduces boilerplate significantly.

Best Practices

  • Always use declare(strict_types=1);
  • Type everything: parameters, returns, properties, constants
  • Use readonly for immutable data
  • Use enums instead of string/int constants
  • Use match instead of switch for value mapping
  • Use named arguments for clarity with many-parameter functions
  • Use #[\Override] when overriding parent methods
  • Follow PSR-12 coding style

Fetch php.net docs for exact syntax and behavior of new features before using them.

Frequently asked questions

What does the Php Modern AI skill do?

Write modern PHP 8.x code — typed properties, enums, readonly classes, match expressions, named arguments, union/intersection types, fibers, attributes, and constructor promotion. Use when writing PHP for Magento or any PHP 8.x project.

Why use Php Modern on TypingMind?

Because you install it once and use it with any model. Php Modern is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Php Modern in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/magento2-commerce/skills/php-modern. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Php Modern?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Php Modern?

As many as you like. As long as a model supports skills, you can use Php Modern with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Php Modern AI skill free?

Yes. It is published on GitHub by OrcaQubits under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇