Download the PHP package php-spellcheck/spellcheck-core without Composer

On this page you can find all versions of the php package php-spellcheck/spellcheck-core. 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 spellcheck-core

PHP Spellcheck Core — spell checker for PHP code and translation files

PHP Spellcheck Core — spell check PHP code and translation catalogues

CI Latest version Downloads PHP version

Framework-agnostic PHP spell checking engine for source code and translation catalogues. It finds typos in PHP identifiers, docblocks, comments and in Symfony translation catalogues, with Hunspell, Aspell, pspell or a pure PHP backend, character-accurate line and column positions, ICU MessageFormat support, a baseline for legacy projects and PSR-6 caching.

Use it to fail CI on typos, to lint a translation catalogue in the language it is actually written in, or to build your own spell checking tool on top of the pipeline.

For the Symfony integration (console commands, bundle configuration, Translator support) use php-spellcheck/spellcheck-symfony-bundle.

Features

Requirements

Table of contents

Why

cspell does not know that messages.it.yaml must be checked in Italian, that %count% is a placeholder or that {n, plural, one {...}} has textual branches. tigitz/php-spellchecker is an excellent backend abstraction but knows nothing about the domain. This library is the missing middle layer: it turns catalogues and PHP identifiers into checkable text, accurately, and hands the words to whichever backend you have.

php-spellcheck/spellcheck-core cspell tigitz/php-spellchecker
Per-locale translation catalogues yes no no
ICU MessageFormat branches yes no no
Symfony/Twig/sprintf placeholder awareness yes partial no
PHP identifier splitting from the AST yes no no
Positions mapped back to the original text yes n/a no
Baseline for legacy projects yes no no
Runs without Node.js yes no yes

Related packages

Package Purpose
php-spellcheck/spellcheck-core This package: the framework-agnostic engine.
php-spellcheck/spellcheck-symfony-bundle Symfony bundle: console commands, configuration, Translator integration.

Install

Quick start

Architecture

Layer Contract Built-in implementations
Source SourceInterface PhpFileSource, ArrayFragmentSource, ChainSource
Processor TextProcessorInterface placeholders, sprintf, HTML, markdown, URLs, ICU, legacy plurals, docblocks, apostrophes
Tokenizer TokenizerInterface IdentifierSplitter, ProseTokenizer
Speller SpellerInterface HunspellSpeller, AspellSpeller, PspellSpeller, WordListSpeller, ChainSpeller, CachingSpeller, NullSpeller
Filter MisspellingFilterInterface dictionary, pattern, deduplication, baseline
Reporter ReporterInterface table, json, github, checkstyle, junit, gitlab, csv

Everything is a generator: memory stays flat regardless of how many files or messages are processed.

Accurate positions

Every processor that removes text records the correspondence in an OffsetMap, and maps compose associatively. That is what makes the reported column point at the position in the original message:

Ispell pipe protocol

PipeSpeller keeps one process alive per language for the whole run. Words are sent one per line prefixed with ^, and the terminating blank line is the synchronisation point. Terse mode (!) suppresses the * lines and cuts the I/O by roughly 90%; if your binary does not emit the blank line in terse mode, construct the backend with terseMode: false.

Baseline

The fingerprint is sha256(schema | contextSeed | lowercase word | type) truncated to 16 hex characters. It deliberately excludes line and column, so moving code around does not invalidate the baseline. Renaming a file does, and that is documented behaviour.

Extending

Implement the relevant interface and pass it to the chain. In a Symfony application the bundle autoconfigures the six extension points; outside of it, compose the objects yourself as in the quick start above.

Tests

tests/smoke.php runs a subset of the suite with a hand written autoloader and no composer at all: useful to verify a checkout in a bare container.

Contributing

Bug reports, feature requests and pull requests are welcome. Read CONTRIBUTING.md first: the offset and determinism rules are not negotiable.

Security

Report vulnerabilities as described in SECURITY.md. Do not open a public issue for them.

License

Released under the MIT License.


All versions of spellcheck-core with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-mbstring Version *
nikic/php-parser Version ^4.18 || ^5.0
psr/cache Version ^1.0 || ^2.0 || ^3.0
psr/log Version ^1.1 || ^2.0 || ^3.0
symfony/finder Version ^5.4 || ^6.4 || ^7.0 || ^8.0
symfony/process Version ^5.4 || ^6.4 || ^7.0 || ^8.0
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 php-spellcheck/spellcheck-core contains the following files

Loading the files please wait ...