Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeryther committed Feb 2, 2022
0 parents commit e7a5129
Show file tree
Hide file tree
Showing 7 changed files with 2,525 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Gigadrive EditorConfig

root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8

[*.{php,js,java,ts,jsx,tsx,scss,css,py,json}]
indent_style = tab
indent_size = 4

[*.{yaml,yml}]
indent_size = 4
indent_style = space
180 changes: 180 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
/.idea

# Created by https://www.toptal.com/developers/gitignore/api/phpstorm,composer,symfony
# Edit at https://www.toptal.com/developers/gitignore?templates=phpstorm,composer,symfony

### Composer ###
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock

### PhpStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### PhpStorm Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/

# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/

# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$

# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml

### Symfony ###
# Cache and logs (Symfony2)
/app/cache/*
/app/logs/*
!app/cache/.gitkeep
!app/logs/.gitkeep

# Email spool folder
/app/spool/*

# Cache, session files and logs (Symfony3)
/var/cache/*
/var/logs/*
/var/sessions/*
!var/cache/.gitkeep
!var/logs/.gitkeep
!var/sessions/.gitkeep

# Logs (Symfony4)
/var/log/*
!var/log/.gitkeep

# Parameters
/app/config/parameters.yml
/app/config/parameters.ini

# Managed by Composer
/app/bootstrap.php.cache
/var/bootstrap.php.cache
/bin/*
!bin/console
!bin/symfony_requirements

# Assets and user uploads
/web/bundles/
/web/uploads/

# PHPUnit
/app/phpunit.xml
/phpunit.xml

# Build data
/build/

# Composer PHAR
/composer.phar

# Backup entities generated with doctrine:generate:entities command
**/Entity/*~

# Embedded web-server pid file
/.web-server-pid

### Symfony Patch ###
/web/css/
/web/js/

# End of https://www.toptal.com/developers/gitignore/api/phpstorm,composer,symfony
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Gigadrive UG, Mehdi Baaboura

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Gigadrive's PHP Coding Standard

This repository holds the coding standard used for Gigadrive PHP projects. It is available to the public and licensed under the [MIT License](https://github.com/Gigadrive/php-coding-standard/blob/master/LICENSE).

The coding standard was made to be used with the [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) tool for easy IDE and CI pipeline integrations.

## Installation

You will need to install both PHP CS Fixer and the Gigadrive coding standard with composer:

```shell
composer require --dev friendsofphp/php-cs-fixer
composer require --dev gigadrive/php-coding-standard
```

## Usage

Next, create a `.php-cs-fixer.dist.php` file at your project root:

```php
<?php

$config = require_once "vendor/gigadrive/php-coding-standard/php-cs-fixer-config.php";

// Define what project files you want to pass to PHP CS Fixer.
$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude("var")
->exclude("vendor");

return $config
->setFinder($finder);
```

Your project will now use the Gigadrive PHP Coding Standard by default.

**IMPORTANT:** This coding standard contains rules that are considered **risky** by PHP CS Fixer. Use them at your own risk. To prevent unintended damage, the risky flag is disabled by default. You can adjust your config file to enable it, or pass the `--allow-risky=yes` option to the command line.

* `$config` is a PHP CS Fixer Config object you can use according to the [PHP CS Fixer documentation](https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/config.rst). You can use this to adjust the coding standard rules to your liking.

## Copyright and License

This program was developed by [Mehdi Baaboura](https://github.com/Zeryther) and published by [Gigadrive UG](https://gigadrivegroup.com) under the MIT License. For more information click [here](https://github.com/Gigadrive/php-coding-standard/blob/master/LICENSE).
11 changes: 11 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "gigadrive/php-coding-standard",
"type": "library",
"description": "The PHP Coding Standard for Gigadrive projects - Integrates with PHP CS Fixer",
"version": "1.0.0",
"license": "MIT",
"homepage": "https://github.com/Gigadrive/php-coding-standard",
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.5"
}
}
Loading

0 comments on commit e7a5129

Please sign in to comment.