Skip to content

Commit 8f13154

Browse files
committed
Initial commit
0 parents  commit 8f13154

File tree

10 files changed

+373
-0
lines changed

10 files changed

+373
-0
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 4
9+
indent_style = tab
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.{json,neon,neon.dist,yml,md}]
14+
indent_size = 2
15+
16+
[*.{yml,md,neon,neon.dist}]
17+
indent_style = space

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/.devcontainer export-ignore
2+
/.editorconfig export-ignore
3+
/.gitattributes export-ignore
4+
/.github export-ignore
5+
/.gitignore export-ignore
6+
/.vscode export-ignore
7+
/docs export-ignore
8+
/phpstan.neon.dist export-ignore
9+
/phpcs.xml.dist export-ignore
10+
/phpunit.xml.dist export-ignore
11+
/tests export-ignore

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "composer"
4+
versioning-strategy: increase
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "sunday"
9+
groups:
10+
composer-require:
11+
dependency-type: "production"
12+
update-types:
13+
- "minor"
14+
- "patch"
15+
composer-require-dev:
16+
dependency-type: "development"
17+
update-types:
18+
- "minor"
19+
- "patch"

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#OS
2+
.DS_*
3+
4+
# Composer
5+
/vendor
6+
composer.lock
7+
auth.json
8+
9+
# Log, cache, and tmp files
10+
*.cache
11+
*.log
12+
*.meta
13+
tmp/
14+
15+
# Dotenv
16+
.env.*
17+
!.env
18+
19+
# Tests #
20+
#############
21+
artifacts/
22+
phpunit.xml
23+
phpstan.neon
24+
phpcs.xml
25+
26+
# Docker
27+
docker-composer.override.yml

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"editorconfig.editorconfig",
4+
"dotjoshjohnson.xml"
5+
]
6+
}

CODE_OF_CONDUCT.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official email address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
[INSERT CONTACT METHOD].
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series of
86+
actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or permanent
93+
ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within the
113+
community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.1, available at
119+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120+
121+
Community Impact Guidelines were inspired by
122+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123+
124+
For answers to common questions about this code of conduct, see the FAQ at
125+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126+
[https://www.contributor-covenant.org/translations][translations].
127+
128+
[homepage]: https://www.contributor-covenant.org
129+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130+
[Mozilla CoC]: https://github.com/mozilla/diversity
131+
[FAQ]: https://www.contributor-covenant.org/faq
132+
[translations]: https://www.contributor-covenant.org/translations

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Syntatis
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<div align="center">
2+
<strong>💅 phpcs-ruleset</strong>
3+
<p>PHP Coding Standard applied to Syntatis projects</p>
4+
5+
![Packagist PHP Version](https://img.shields.io/packagist/dependency-v/syntatis/coding-standard/php)
6+
</div>
7+
8+
---
9+
10+
A collection of rulesets to apply standard PHP coding practices across Syntatis projects. The rulesets are based on some established PHP coding standards, such as [PSR-12](https://www.php-fig.org/psr/psr-12/), [Doctrine](https://github.com/doctrine/coding-standard), [Slevomat](https://github.com/slevomat/coding-standard), and are extended with a few additional rules to suit with the specific projects' needs.

Syntatis/ruleset.xml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?xml version="1.0"?>
2+
<ruleset
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"
5+
name="Syntatis">
6+
<description>PHP Coding Standard</description>
7+
8+
<!-- Use colors in output -->
9+
<arg name="colors"/>
10+
11+
<!-- Show progress of the run -->
12+
<arg value="p"/>
13+
14+
<!-- Show sniff codes in all reports -->
15+
<arg value="s"/>
16+
17+
<!-- Only check files with PHP extension -->
18+
<arg name="extensions" value="php"/>
19+
20+
<!-- Show the warning but exit with 0. The Warning is fine -->
21+
<config name="ignore_warnings_on_exit" value="1"/>
22+
23+
<!-- Include full Doctrine Coding Standard -->
24+
<rule ref="Doctrine">
25+
<exclude name="Generic.Formatting.MultipleStatementAlignment"/>
26+
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
27+
<exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming"/>
28+
<exclude name="SlevomatCodingStandard.PHP.RequireExplicitAssertion"/>
29+
</rule>
30+
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
31+
<properties>
32+
<property name="annotationsGroups" type="array">
33+
<element value="@phpcsSuppress"/>
34+
<!--
35+
Tests annotation
36+
@link https://phpunit.readthedocs.io/en/7.0/annotations.html
37+
The @author annotation is excluded from the list, use @group or @ticket instead.
38+
-->
39+
<element value="
40+
@after,
41+
@afterClass,
42+
@backupGlobals,
43+
@backupStaticAttributes,
44+
@before,
45+
@beforeClass,
46+
@codeCoverageIgnore*,
47+
@covers,
48+
@coversDefaultClass,
49+
@coversNothing,
50+
@dataProvider,
51+
@depends,
52+
@doesNotPerformAssertions,
53+
@group,
54+
@large,
55+
@medium,
56+
@preserveGlobalState,
57+
@requires,
58+
@runTestsInSeparateProcesses,
59+
@runInSeparateProcess,
60+
@small,
61+
@test,
62+
@testdox,
63+
@testWith,
64+
@ticket,
65+
@uses"
66+
/>
67+
<!-- Psalm annotations essentially overrides PHP docBlocks -->
68+
<element value="@phpstan-consistent-constructor, @phpstan-import-type, @phpstan-type"/>
69+
<element value="@template, @template-implements, @template-extends"/>
70+
<element value="@example, @see, @link, @todo"/>
71+
<element value="@method, @property"/>
72+
<element value="@phpstan-method, @phpstan-property"/>
73+
<element value="@param, @throws, @return"/>
74+
<element value="@phpstan-param, @phpstan-return, @phpstan-throws"/>
75+
</property>
76+
</properties>
77+
</rule>
78+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification">
79+
<exclude-pattern>/tests/</exclude-pattern>
80+
</rule>
81+
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification">
82+
<exclude-pattern>/tests/</exclude-pattern>
83+
</rule>
84+
85+
<!-- Generic -->
86+
<rule ref="Generic.Files.LineLength">
87+
<properties>
88+
<property name="ignoreComments" value="true"/>
89+
</properties>
90+
</rule>
91+
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
92+
<rule ref="Generic.WhiteSpace.ScopeIndent">
93+
<properties>
94+
<property name="indent" value="4" />
95+
<property name="tabIndent" value="true" />
96+
</properties>
97+
</rule>
98+
<rule ref="Generic.Files.LineLength.TooLong">
99+
<exclude-pattern>/tests/</exclude-pattern>
100+
</rule>
101+
</ruleset>

composer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "syntatis/coding-standard",
3+
"type": "phpcodesniffer-standard",
4+
"description": "PHP Coding Standard applied to Syntatis projects",
5+
"license": "MIT",
6+
"keywords": [
7+
"php",
8+
"codesniffer",
9+
"coding-standard"
10+
],
11+
"homepage": "https://github.com/syntatis/phpcs-ruleset#README",
12+
"authors": [
13+
{
14+
"name": "Thoriq Firdaus",
15+
"homepage": "https://github.com/tfirdaus",
16+
"role": "Developer"
17+
}
18+
],
19+
"require": {
20+
"php": ">=7.4",
21+
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
22+
"doctrine/coding-standard": "^12.0"
23+
},
24+
"config": {
25+
"allow-plugins": {
26+
"dealerdirect/phpcodesniffer-composer-installer": true
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)