PHPackages                             tsufeki/tenkawa-php-language-server - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tsufeki/tenkawa-php-language-server

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tsufeki/tenkawa-php-language-server
===================================

Language server for PHP, with powerful static analysis and type inference

0.4.3(6y ago)828957[4 issues](https://github.com/tsufeki/tenkawa-php-language-server/issues)[12 PRs](https://github.com/tsufeki/tenkawa-php-language-server/pulls)GPL-3.0-or-laterPHPPHP &gt;=7.1

Since Apr 18Pushed 5y ago2 watchersCompare

[ Source](https://github.com/tsufeki/tenkawa-php-language-server)[ Packagist](https://packagist.org/packages/tsufeki/tenkawa-php-language-server)[ RSS](/packages/tsufeki-tenkawa-php-language-server/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (31)Versions (23)Used By (0)

Tenkawa PHP Language Server
===========================

[](#tenkawa-php-language-server)

[![Tenkawa](images/tenkawa-logo.png)](images/tenkawa-logo.png)

Tenkawa is a [language server](https://microsoft.github.io/language-server-protocol/) for PHP, with powerful static analysis and type inference engine borrowed without asking from [PHPStan](https://github.com/phpstan/phpstan).

Still experimental, but should be usable. Any bug reports, feature requests, suggestions, questions are welcome.

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

[](#installation)

Requires PHP &gt;= 7.1 with pdo\_sqlite extension.

For Visual Studio Code extension, see [here](https://github.com/tsufeki/vscode-tenkawa-php).

Either with [`composer`](https://getcomposer.org/) `create-project` (`~` directory is an example):

```
$ cd ~
$ composer create-project --no-dev --keep-vcs \
    tsufeki/tenkawa-php-language-server tenkawa/
```

Or by cloning the repo:

```
$ cd ~
$ git clone https://github.com/tsufeki/tenkawa-php-language-server.git tenkawa/
$ cd tenkawa/
$ composer install --no-dev
$ cd ..
```

Build index of the standard library:

```
$ php ~/tenkawa/bin/tenkawa.php --build-index
```

Now configure your client to start the server with this command to use stdio:

```
php ~/tenkawa/bin/tenkawa.php
```

Or to connect to a TCP socket:

```
php ~/tenkawa/bin/tenkawa.php --socket=tcp://127.0.0.1:12345
```

Features
--------

[](#features)

- ✔ Autocompletion
    - ✔ Classes/functions (also with automatic import and within doc comments)
    - ✔ Class members
    - ✔ Local variables
- ✔ Diagnostics
    - ✔ Static analysis with [PHPStan](https://github.com/phpstan/phpstan)(see [Known issues](#known-issues))
- ✔ Go to definition
- ✔ Go to implementation
- ✔ Hover info
- ✔ Signature help
- ✔ References
- ✔ Document symbols
- ✔ Workspace symbols
    - ✔ Classes/functions/consts
    - ✘ Class members (not yet)
- ✔ Code actions
    - ✔ Import class/function
    - ✔ Fix wrong autoloaded class/namespace name
    - ✘ More to come...
- ✔ Multi-root workspace
- ✔ Snippets
    - ✔ Class/interface/trait
- ✔ Dynamic configuration

Unimplemented (yet?):

- ✘ Go to type definition
- ✘ Go to declaration
- ✘ Document highlight
- ✘ Document link
- ✘ Code lens
- ✘ Formatting
    - ✘ document
    - ✘ range
    - ✘ on type
- ✘ Rename
- ✘ Folding range

Known issues
------------

[](#known-issues)

- Many features don't work inside traits. This is caused by PHPStan's design.
- Refactors are not 100% bullet-proof.
- Performance &amp; long indexing times.

Command line options
--------------------

[](#command-line-options)

- `--socket=` - connect to a socket instead of communicating through STDIO. Allowed format: `tcp://127.0.0.1:12345` or `unix:///path/to/socket`.
- `--log-stderr` - log to stderr.
- `--log-file=` - log to the given file.
- `--log-client` - log using `window/logMessage` protocol method.
- `--log-level=` - log only messages of the given level and up. `` can be one of `emergency`, `alert`, `critical`, `error`, `warning`, `notice`, `info`, `debug`. Defaults to `info`.
- `--build-index` - build standard library index instead of starting the server.
- `--config-json=` - default options, see [Configuration](#configuration). Example: `--config-json={"completion":{"autoImport":false}}`.

Configuration
-------------

[](#configuration)

You can pass configuration options to the server through `initializationOptions` parameter of `initialize` protocol method or by implementing `workspace/configuration` request and sending `workspace/didChangeConfiguration` notifications from client.

Recognized options:

```
{
  "tenkawaphp": {
    "diagnostics": {
      "phpstan": {
        // Enable PHPStan diagnostics.
        "enabled": true
      }
    },
    "completion": {
      // Enable automatic import (use) of completed classes.
      "autoImport": true,
      // By default, only some PHP extensions are used for autocompletion.
      // Additional ones can be enabled here.
      "extensions": ["mysqli", "redis"]
    },
    "index": {
      // Additional stubs directories
      "stubs": ["/path/to/stubs/dir"]
    }
  }
}
```

Licence
-------

[](#licence)

Copyright (c) 2017 tsufeki

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see .

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.6% 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 ~56 days

Recently: every ~76 days

Total

10

Last Release

2489d ago

PHP version history (2 changes)0.1.0PHP &gt;=7.0

0.3.0PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4078572?v=4)[tsufeki](/maintainers/tsufeki)[@tsufeki](https://github.com/tsufeki)

---

Top Contributors

[![tsufeki](https://avatars.githubusercontent.com/u/4078572?v=4)](https://github.com/tsufeki "tsufeki (431 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (19 commits)")[![benedyktbla](https://avatars.githubusercontent.com/u/18659685?v=4)](https://github.com/benedyktbla "benedyktbla (1 commits)")

---

Tags

autocompletionlanguage-serverlspphprefactoring-toolsstatic-analysis

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tsufeki-tenkawa-php-language-server/health.svg)

```
[![Health](https://phpackages.com/badges/tsufeki-tenkawa-php-language-server/health.svg)](https://phpackages.com/packages/tsufeki-tenkawa-php-language-server)
```

###  Alternatives

[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136400.8k14](/packages/rector-rector-src)[deptrac/deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.

3.0k7.9M105](/packages/deptrac-deptrac)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[phpdocumentor/reflection

Reflection library to do Static Analysis for PHP Projects

12524.8M137](/packages/phpdocumentor-reflection)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[phpactor/phpactor

PHP refactoring and intellisense tool for text editors

1.9k16.6k1](/packages/phpactor-phpactor)

PHPackages © 2026

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