1. YoureCom
    1. Über mich
  2. Lösungen
    1. Tipprunde
    2. Aufgaben & Support
    3. Mitglieder-Netzwerk
    4. Online-Shop
    5. Alle Lösungen & Preise
  3. Für Admins
    1. Plugins
    2. ByteMon
    3. ByteMon: Community verwalten
    4. ByteMon: Portalidentität
    5. Individuelle Entwicklung
    6. WSC 6.3 Alpha
    7. GitHub
  4. Neuigkeiten
    1. Kurzmeldungen
  5. Support
  6. Mein Konto
  7. Lösungen testen
  • Anmelden
  • Registrieren
  • Warenkorb 0
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Aufgaben
  • Produkte
  • Pulse-Beiträge
  • Erweiterte Suche
  1. YoureCom – Software für Vereine, Teams & Communities
  2. Repository-Liste
  3. de.yourecom.wcf.api.mpdf

YoureCom Standard automatisch aktualisiert (verwaltete Dateien aus _dev/standard)

  • Marcel Beckers
  • +104 Hinzufügungen
  • 104 Gesamt
  • 3 Dateien
  • 22. Oktober 2026 um 07:37
  • phpstan.standard.neon
    <pre>@@ -2,6 +2,7 @@
    # Rules of the standard on top of level 9 and the strict rules, included by phpstan.common.neon.
    # - strict comparisons: no empty() (compare with === [], === '', === 0 or === null), no == or != (strict rules)
    # - every method has #[\Override] or a docblock that explains it (tests/phpstan/OverrideOrDocblockRule.php)
    +# - a property that redeclares one of a parent class only has @inheritDoc (tests/phpstan/InheritedPropertyDocblockRule.php)
    includes:
    - tests/phpstan/rules.php
  • tests/phpstan/InheritedPropertyDocblockRule.php
    <pre>@@ -0,0 +1,102 @@
    +<?php
    +
    +namespace yourecom\standard\phpstan;
    +
    +use PhpParser\Node;
    +use PHPStan\Analyser\Scope;
    +use PHPStan\Node\ClassPropertyNode;
    +use PHPStan\Reflection\ClassReflection;
    +use PHPStan\Rules\IdentifierRuleError;
    +use PHPStan\Rules\Rule;
    +use PHPStan\Rules\RuleErrorBuilder;
    +
    +/**
    + * YoureCom Standard: a property that redeclares a property of a parent class (`$className`, `$requireACP`, …) only gets
    + * `/** @inheritDoc *\/`, the parent explains it; tags that PHPStan needs (e.g. `@var` with a narrower type) may follow
    + * after an empty line (Marcel 22.10.2026).
    + * Managed by _dev/standard (apply.php), do not edit here.
    + *
    + * @author Marcel Beckers
    + * @license YoureCom License - Commercial (YCLC) <https://www.yourecom.de/shop/licence-commercial/>
    + * @implements Rule<ClassPropertyNode>
    + */
    +final class InheritedPropertyDocblockRule implements Rule
    +{
    + #[\Override]
    + public function getNodeType(): string
    + {
    + return ClassPropertyNode::class;
    + }
    +
    + #[\Override]
    + public function processNode(Node $node, Scope $scope): array
    + {
    + if ($node->isPromoted() || $node->isDeclaredInTrait()) {
    + return [];
    + }
    +
    + $name = $node->getName();
    + $class = $node->getClassReflection();
    + $parent = $this->declaringParent($class, $name);
    + if ($parent === null) {
    + return [];
    + }
    +
    + $docComment = $node->getPhpDoc();
    + if ($docComment !== null && $this->hasDescription($docComment)) {
    + return [$this->error("Property {$class->getName()}::\${$name} redeclares {$parent}::\${$name}, replace the explanation with @inheritDoc (keep only tags PHPStan needs).", 'description')];
    + }
    + if ($docComment === null || \preg_match('~@inheritDoc\b~i', $docComment) !== 1) {
    + return [$this->error("Property {$class->getName()}::\${$name} redeclares {$parent}::\${$name}, give it the docblock /** @inheritDoc */.", 'inheritDoc')];
    + }
    +
    + return [];
    + }
    +
    + /**
    + * Returns the name of the parent class that declares the property (not private), null if none.
    + */
    + private function declaringParent(ClassReflection $class, string $name): ?string
    + {
    + foreach ($class->getParents() as $parent) {
    + if ($parent->hasNativeProperty($name) && !$parent->getNativeProperty($name)->isPrivate()) {
    + return $parent->getName();
    + }
    + }
    +
    + return null;
    + }
    +
    + /**
    + * Tells whether a docblock has a line of text besides the tags (lines that continue a tag belong to the tag).
    + */
    + private function hasDescription(string $docComment): bool
    + {
    + $inTag = false;
    + foreach (\explode("\n", $docComment) as $line) {
    + $text = \trim(\preg_replace('~^\s*(?:/\*\*|\*/|\*)~', '', $line) ?? '');
    + $text = \trim(\preg_replace('~\*/$~', '', $text) ?? '');
    + if ($text === '') {
    + $inTag = false;
    + continue;
    + }
    + if (\str_starts_with($text, '@') || \str_starts_with($text, '{@')) {
    + $inTag = true;
    + continue;
    + }
    + if (!$inTag) {
    + return true;
    + }
    + }
    +
    + return false;
    + }
    +
    + /**
    + * Builds an error of this rule.
    + */
    + private function error(string $message, string $identifier): IdentifierRuleError
    + {
    + return RuleErrorBuilder::message($message)->identifier("yourecom.property.{$identifier}")->build();
    + }
    +}
  • tests/phpstan/rules.php
    <pre>@@ -8,6 +8,7 @@
    $rules = [
    'OverrideOrDocblockRule',
    + 'InheritedPropertyDocblockRule',
    'PermissionStrictRule',
    'SecureActionRule',
    'EndpointRequireAcpRule',

Bereit, deine Community smarter zu machen?

Ob fertiges Produkt oder individuelle Softwarelösung – überzeuge dich selbst.

Jetzt kaufen Demo testen

Direkter Support vom Entwickler

Zuletzt erledigte Aufgaben

  1. Overlay beim Verschieben eines Themas Clan Verwaltung Clan Verwaltung: Foren

    Marcel Beckers Erledigt am 23. Oktober 2026 um 22:10
  2. Feature-Wunsch: Einführung von Tippgemeinschaften / Team-Wertung (Team-Tippen) Wettbewerbe Basissystem Wettbewerbe: Tippspiel

    villain Erledigt am 22. Oktober 2026 um 08:15
  3. Verschiebung zwischen Clanforen/WSB Clan Verwaltung Clan Verwaltung: Foren

    Marcel Beckers Erledigt am 22. Oktober 2026 um 00:12
  4. Massenbearbeitung von Clans Clan Verwaltung

    Marcel Beckers Erledigt am 22. Oktober 2026 um 00:10
  5. Synchronisation zwischen Clan und Benutzergruppe erweitern Clan Verwaltung

    Marcel Beckers Erledigt am 21. Oktober 2026 um 23:59
  6. Überarbeitung der eigenen Events Clan Verwaltung

    Marcel Beckers Erledigt am 21. Oktober 2026 um 23:40
Arbeitsplatz
YoureCom – Software für Vereine, Teams & Communities

YoureCom – Software für Vereine, Teams & Communities. Seit 2004.

Fertig eingerichtete Lösungen für Verein, Team und Community, dazu Erweiterungen für die WoltLab Suite. Aus Wuppertal, für Kunden weltweit.

Lösungen

  • Tipprunde
  • Aufgaben & Support
  • Mitglieder-Netzwerk
  • Online-Shop
  • Alle Lösungen & Preise

Für Administratoren

  • Plugins
  • Clan Verwaltung
  • Wettbewerbe
  • MultiHunter
  • ByteMon
  • Individuelle Entwicklung

YoureCom

  • Über mich
  • Shop
  • Kontakt
  • Neuigkeiten
  • GitHub

Cloud-Verträge

  • AGB Cloud
  • AVV Cloud
  • Rechtswidrige Inhalte melden
  • Datenwechsel

Rechtliches

  • Datenschutzerklärung
  • Impressum
  • AGB
  • Vertrag widerrufen
  • Abonnements kündigen
  • Widerrufsbelehrung
© 2026 YoureCom · Marcel Beckers