Download the PHP package marcinwolnyeu/slopshape-php without Composer

On this page you can find all versions of the php package marcinwolnyeu/slopshape-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package slopshape-php

SlopShape-PHP

CI Packagist

Structural AI-text detection for PHP. Give it a text, plus a model callback if you want extra accuracy, and get back a probability of AI authorship, a confidence, and the evidence behind both.

Use it to add an AI-slop check to your CI pipeline, or to any system that needs a plain signal for whether a text smells like slop. The detection method comes from @jochenmadler's September 2026 paper, arXiv:2609.15369 SlopShape: Identifying AI-Generated Commercial Web Content.

Install

You cannot use this package on a commercial project. The code is PolyForm Noncommercial 1.0.0 license.

Usage

Package requires PHP 8.3+ with ext-mbstring

Plain

Without callback, it runs fully offline and scores only what it can count itself. It's much faster and free, but suffers from reduced accuracy.

Minimalistic solution

When you only need the number, to sort, filter or threshold, the probabilityAi() function skips the Score object:

2. OpenAI, in a closure

Uses openai-php/client (PHP 8.2+; it also needs a PSR-18 HTTP client such as Guzzle). It is not a dependency of this package.

The closure returns the raw answer text. Let API errors propagate; the detector wraps them in BridgeFailure. The output above is illustrative; it depends on the model and the text.

3. OpenRouter, as an LlmBridge

A named bridge class for OpenRouter, which serves many providers' models behind one OpenAI-compatible endpoint. It needs only ext-curl and ext-json:

Score a text and print the probability with the evidence on each side:

Any HTTP error, or a reply with no answer in it, throws, so the detector reports a BridgeFailure instead of scoring an empty string. The output above is illustrative; it depends on the model and the text.

What it does

SlopShape (Madler 2026, arXiv:2609.15369) found that discourse-level structural choices separate AI-generated from human-written commercial web content at 0.9695 macro-F1, that ten values carry much of that signal, and that the signal survives rewording. None of it is a word list: the features describe how a post is built, not which words it uses.

SlopShape-PHP applies those ten values to one document:

  1. Measure what can be measured. Word count is countable, so it is counted and never asked about. (On a 674-word article, one model studied by the paper answered "800-1499 words".)
  2. Ask your model about the rest, using the study's own stage-5 annotation prompt, the study's own frozen answer menus, and its "never invent values, never omit a feature" discipline. The rules and menus are transcribed, not paraphrased. Three things differ from the study's main run:

    • A defence against prompt injection: the post goes inside <pasted_content id="..."> tags with a random id that is new for every prompt, and the model is told to treat it as data.
    • One call, not eleven: the study scored one dimension per call (11 calls per post, with gemini-3.6-flash on a minimal thinking budget). This package asks for all eight answers in one call, which is the prompt template's single-call mode. The study checked that mode on a small sample and did not use it for the main run, where it answered 99.75% of items against 99.97%.
    • A different cut-off for long posts: the study sent the first 2,600 words; this package sends the first maxInputChars characters (24,000 by default). The word count always uses the whole text.

    The title is left out: SlopShape v3 found that a title line moves some answers on its own.

  3. Force every answer onto its menu. Exact matches pass through; near matches are repaired and the repair is recorded; an answer that matches nothing on the menu becomes a missing reading, not a guess, and that is recorded too.
  4. Weight the readings by released calibration and sum them as log-odds:

There is no learned model in here and no hidden state. Given a Score and the calibration constant, you can recompute the number by hand.

Development

Command What it does
composer test Pest
composer test:ci Pest in parallel, with coverage
composer cs / cs:fix PHP-CS-Fixer
composer stan PHPStan level max + strict rules
composer rector / rector:fix Rector
composer deps every used symbol is provided by a declared dependency
composer test:infection mutation testing

The suite pins the arithmetic to hand-derived golden numbers, so a change in the formula fails a test rather than quietly changing someone's report.

Bug reports and questions go in issues; pull requests are not accepted. See CONTRIBUTING.md.

Licence

PolyForm Noncommercial 1.0.0, inherited from upstream rather than chosen. See LICENSE.md.

Citation

See CITATION.cff. If you use this, cite SlopShape, not this package.


All versions of slopshape-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package marcinwolnyeu/slopshape-php contains the following files

Loading the files please wait ...