PHPackages                             instaclick/gherkincs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. instaclick/gherkincs

ActiveLibrary

instaclick/gherkincs
====================

Code Sniffer and Semantic Analyzer for Gherkin

v1.2.0(12y ago)1011.8k6[3 issues](https://github.com/instaclick/gherkincs/issues)MITPHPPHP &gt;=5.3.6

Since May 8Pushed 6y ago6 watchersCompare

[ Source](https://github.com/instaclick/gherkincs)[ Packagist](https://packagist.org/packages/instaclick/gherkincs)[ RSS](/packages/instaclick-gherkincs/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (6)Versions (4)Used By (0)

Gherkin Code Sniffer
====================

[](#gherkin-code-sniffer)

By Juti Noppornpitak

Dependencies
------------

[](#dependencies)

- twig (dev-master, required for HTML report)

Installation
------------

[](#installation)

### Standalone

[](#standalone)

At the root directory where Gherkin CS's `composer.json` is,

**Installation (Normal):** run `composer.phar install`

**Installation (DEV):** run `composer.phar install --dev`

**Executable:** `cuke-standalone`.

### Composer with Packagist

[](#composer-with-packagist)

**Installation:** Add `"instaclick/gherkincs": "dev-master"` in the `require` or `require-dev` section of the project's `composer.json`.

**Executable:** `vendor/bin/cuke`.

Usage
-----

[](#usage)

Define `cuke` as either `cuke-standalone` or `vendor/bin/cuke`.

```
cuke [--jcs ] [--html ]
```

where `--html` is to produce a set of reports in HTML and `--jcs` is to produce a checkstyle-format report for Jenkins/Hudson CI.

Please note that:

- by default, the report will be displayed on the standard output,
- `--html` will be used if both `--jcs` and `--html` are given.

For example,

```
cuke --jcs darkside.xml config.xml jedi/
```

Available Analyzers
-------------------

[](#available-analyzers)

### Semantic Analyzer

[](#semantic-analyzer)

#### Context Flow

[](#context-flow)

This analyzer first checks for the given-when-then context flow (precondition-action-assertion) in the following patterns:

```
Precondition
  -> Continuation (as precondition)
  -> Action
  -> Assertion

Action
  -> Continuation (as action)
  -> Assertion

Assertion
  -> Continuation (as assertion)
  -> Precondition
  -> Action

```

#### Semantic Quality

[](#semantic-quality)

It also asserts one of the conditions:

- any contexts containing "click", "fill", "follow", or "select" is an action,
- any contexts containing "should" or "must" is an assertion.

When a context does not satisfy two or more conditions, the analyzer will consider it an exception (and emit no warnings).

### Coding Style Checker

[](#coding-style-checker)

This analyzer checks if:

- **tab characters** are not used,
- the width of indentation is consistent where the default width is **4 spaces**,
- there exists no **trailing spaces**,
- features have **no leading spaces** (no indentation),
- backgrounds, scenarios, and scenario outlines have exactly **one** level of indentation,
- preconditions, actions, assertions and continuations have exactly **two** levels of indentation,
- tabular data has exactly **three** levels of indentation,
- tag lines have at most **one** level of indentation,
- extra spaces (two or more whitespaces) occur in non-tabular-data contexts.

### Instaclick's Coding Style Checker

[](#instaclicks-coding-style-checker)

This analyzer checks if any tags' name must:

- start with **@**,
- start and end with alphanumeric characters,
- only use hyphens ("-"),
- be in lowercase.

Write a Custom Analyzer
-----------------------

[](#write-a-custom-analyzer)

All analyzers must implement `IC\Gherkinics\Analyzer\AnalyzerInterface`.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 76.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~102 days

Total

3

Last Release

4548d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7527f543a29a1e6b1bcbe7525e619a3a02345b49abbc40f775f88a26aaf39a96?d=identicon)[instaclick](/maintainers/instaclick)

---

Top Contributors

[![shiroyuki](https://avatars.githubusercontent.com/u/226612?v=4)](https://github.com/shiroyuki "shiroyuki (10 commits)")[![robocoder](https://avatars.githubusercontent.com/u/922051?v=4)](https://github.com/robocoder "robocoder (2 commits)")[![kjhowe](https://avatars.githubusercontent.com/u/1379713?v=4)](https://github.com/kjhowe "kjhowe (1 commits)")

---

Tags

Behatgherkinsniffer

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/instaclick-gherkincs/health.svg)

```
[![Health](https://phpackages.com/badges/instaclick-gherkincs/health.svg)](https://phpackages.com/packages/instaclick-gherkincs)
```

###  Alternatives

[behat/gherkin

Gherkin DSL parser for PHP

1.1k176.3M97](/packages/behat-gherkin)[doctrine/coding-standard

The Doctrine Coding Standard is a set of PHPCS rules applied to all Doctrine projects.

31914.1M739](/packages/doctrine-coding-standard)[robertfausk/behat-panther-extension

Symfony Panther extension for Behat

341.7M87](/packages/robertfausk-behat-panther-extension)[abydahana/aksara

Aksara is a CodeIgniter based CRUD Toolkit you can use to build complex applications become shorter, secure and more reliable just in a few lines of code. Serving both CMS or Framework, produce both HEADLESS (RESTful API) or TRADITIONAL (Browser Based), just by writing single controller. Yet it's reusable, scalable and ready to use!

1101.2k](/packages/abydahana-aksara)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
