PHPackages                             netherphp/standards - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. netherphp/standards

ActivePhpcodesniffer-standard[PSR &amp; Standards](/categories/psr-standards)

netherphp/standards
===================

Documentation and PHPCS Standard for Nether Notation

v0.2.10(2y ago)05.0k5BSD-3-ClausePHPPHP ^8.0CI failing

Since May 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/netherphp/standards)[ Packagist](https://packagist.org/packages/netherphp/standards)[ RSS](/packages/netherphp-standards/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (22)Used By (5)

Nether \[ˈne-thər\]
===================

[](#nether-ˈne-thər)

[![PHPCS Test](https://github.com/netherphp/standards/workflows/PHPCS%20Test/badge.svg)](https://github.com/netherphp/standards/actions?query=workflow%3A%22PHPCS+Test%22)

> *Located toward the bottom or more distant part of something.*-- Merriam-Webster Dictionary

Nether Standards Project
========================

[](#nether-standards-project)

Known as Nether Notation, NN, N2, or N2

This is a project to document the code conventions used by the Nether Project. A lot of the rules here are based on the concept of being explicit. The developer will always explictly state their intentions, never allowing for default behaviours. This is for a few reasons. First being it shows that the developer has actually thought about what their code is doing. Second, it helps lessen backwards compatbility issues in the future when a default behaviour changes. And yes, it does happen. Third, the entire format and rules are based on the concept that the code can be as self documenting as possible to minimise the amount of metadata needed to describe various entities. And Finally, it helps minimise the amount of eye tracking from the extreme left right over and over which I find helpful suffering from vision floaters.

Automated Formatting
--------------------

[](#automated-formatting)

\[2025-01\] Something changed in PHPCS recently that broke some of my tests and it made me so mad that I ended up hacking PHPCS to work like it used to. Considering how absolutely insane PHPCS is to seek around presently trying to decide if I want to stick with it or just build my own tool based on newer tokeniser features.

This repository contains a `phpcs` standard for testing and automated reformatting of source to fit the standard. For instructions on installation and automated testing against this standard please refer to the Wiki page:

[https://github.com/netherphp/standards/wiki/Nether-Notation-Coding-Standard-for-PHP\_CodeSniffer](https://github.com/netherphp/standards/wiki/Nether-Notation-Coding-Standard-for-PHP_CodeSniffer)

General Standards
-----------------

[](#general-standards)

- PascalCaseAllTheThings except:
    - UPPERCASE for boolean/trulean constants (TRUE, FALSE) and NULL.
    - lowercase for core types (int, float, etc...)
- Tabs for indenting.
- \\n for new lines.
- initialize variables in scopes prior to use.
- explicit "return" at end of functions.
- design for strict types in mind.
- attempt to keep lines shorter than 80 characters.
- prefer single quotes when not using string evaluation.
- anything that can have a type, should have a type.
- no derp commas (trailing commas at the end of arrays, etc).

Inline Documentation.
---------------------

[](#inline-documentation)

All symbol documentation is done with Nether Senpai format documentation. Unlike typical docblocks, these come after the symbol they define on the same indention level. Senpai blocks are opened with /\*// and closed with //\*/ - more on the documentation when I finish writing this document and start writing that one.

Nether Senpai generates as much documentation from the code itself before noticing the comment that describes it. This reduces the amount of junk you need to manually write in the documentation. Taking advantage of featured added in PHP 7.0+ 7.1 most code can be completely self document itself.

NN will use Senpai notation until the day PHP has real annotation support that is not via the slow Reflection system you do not want to use within a production project.

This means a typical method will look like this:

```
