Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Merge of the next-dev branch with the stable branch (#18)
Browse files Browse the repository at this point in the history
* add symply.yml config

* set to Symply name

* add support native waterdogpe in symply and fix system symply.yml

* fix php-cs-fixer and add new rule

* oups no commit rules for php-cs-fixer

* fix rules and add support multi rules

* fix rules for pmmp

* fix finder for exclude file

* fix cs

---------

Signed-off-by: AzaleeX <azaleemcpe@gmail.com>
Co-authored-by: Vuillamier Lilian <33796736+Virvolta@users.noreply.github.com>
Co-authored-by: Sensei Tarzan <gabrielcaptari0@gmail.com>
  • Loading branch information
3 people authored Dec 3, 2023
1 parent f897639 commit 892bd50
Show file tree
Hide file tree
Showing 40 changed files with 2,450 additions and 258 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run PHP-CS-Fixer
run: php-cs-fixer fix --dry-run --diff --ansi
- name: Run PHP-CS-Fixer PMMP
run: "rm -fr .php-cs-fixer.cache && php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --diff --ansi"

- name: Run PHP-CS-Fixer SYMPLY
run: "rm -fr .php-cs-fixer.cache && php-cs-fixer fix --config=.php-cs-fixer-symply.php --dry-run --diff --ansi"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ crashdumps/*
*.phar
server.properties
/pocketmine.yml
/symply.yml
/plugin_list.yml
memory_dumps/*
resource_packs/
Expand Down Expand Up @@ -53,3 +54,4 @@ Documentation/*
# php-cs-fixer
/.php_cs.cache
/.php-cs-fixer.cache
/server/
83 changes: 0 additions & 83 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/fileTemplates/code/PHP Constructor.php

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/fileTemplates/code/PHP Fluent Setter Method.php

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/fileTemplates/code/PHP Getter Method.php

This file was deleted.

2 changes: 0 additions & 2 deletions .idea/fileTemplates/code/PHP Setter Method.php

This file was deleted.

Empty file.
21 changes: 0 additions & 21 deletions .idea/fileTemplates/includes/PHP File Header.php

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/fileTemplates/includes/PHP Function Doc Comment.php

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion .idea/fileTemplates/includes/PHP Property Doc Comment.php

This file was deleted.

Empty file.
10 changes: 0 additions & 10 deletions .idea/fileTemplates/internal/PHP Class.php

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/fileTemplates/internal/PHP File.php

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/fileTemplates/internal/PHP Interface.php

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/fileTemplates/internal/PHP Trait.php

This file was deleted.

121 changes: 121 additions & 0 deletions .php-cs-fixer-symply.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/symply')
->in(__DIR__ . '/build/symply');

return (new PhpCsFixer\Config)
->setRiskyAllowed(true)

->setRules([
'align_multiline_comment' => [
'comment_type' => 'phpdocs_only'
],
'array_indentation' => true,
'array_syntax' => [
'syntax' => 'short'
],
'binary_operator_spaces' => [
'default' => 'single_space'
],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => [
'statements' => [
'declare'
]
],
'cast_spaces' => [
'space' => 'single'
],
'concat_space' => [
'spacing' => 'one'
],
'declare_strict_types' => true,
'elseif' => true,
'fully_qualified_strict_types' => true,
'global_namespace_import' => [
'import_constants' => true,
'import_functions' => true,
'import_classes' => null,
],
'header_comment' => [
'comment_type' => 'comment',
'header' => <<<BODY
_____ _
/ ___| | |
\ `--. _ _ _ __ ___ _ __ | |_ _
`--. \ | | | '_ ` _ \| '_ \| | | | |
/\__/ / |_| | | | | | | |_) | | |_| |
\____/ \__, |_| |_| |_| .__/|_|\__, |
__/ | | | __/ |
|___/ |_| |___/
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@author Symply Team
@link http://www.symplymc.com/
BODY,
'location' => 'after_open'
],
'indentation_type' => true,
'logical_operators' => true,
'native_constant_invocation' => [
'scope' => 'namespaced'
],
'native_function_invocation' => [
'scope' => 'namespaced',
'include' => ['@all'],
],
'new_with_braces' => [
'named_class' => true,
'anonymous_class' => false,
],
'no_closing_tag' => true,
'no_empty_phpdoc' => true,
'no_extra_blank_lines' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
],
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_whitespace_in_blank_line' => true,
'no_unused_imports' => true,
'ordered_imports' => [
'imports_order' => [
'class',
'function',
'const',
],
'sort_algorithm' => 'alpha'
],
'phpdoc_align' => [
'align' => 'vertical',
'tags' => [
'param',
]
],
'phpdoc_line_span' => [
'property' => 'single',
'method' => null,
'const' => null
],
'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'return_type_declaration' => [
'space_before' => 'one'
],
'single_blank_line_at_eof' => true,
'single_import_per_statement' => true,
'strict_param' => true,
'unary_operator_spaces' => true,
])
->setFinder($finder)
->setIndent("\t")
->setLineEnding("\n");
4 changes: 3 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
->in(__DIR__ . '/build')
->in(__DIR__ . '/tests')
->in(__DIR__ . '/tools')
->exclude( __DIR__ . '/symply')
->notPath('plugins/DevTools')
->notName('PocketMine.php');
->notName('PocketMine.php')
->notName('generate-symply-yml-property-consts.php');

return (new PhpCsFixer\Config)
->setRiskyAllowed(true)
Expand Down
5 changes: 3 additions & 2 deletions build/server-phar.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,13 @@ function main() : void{
$build = 0;
}
foreach(buildPhar(
$opts["out"] ?? getcwd() . DIRECTORY_SEPARATOR . "PocketMine-MP.phar",
$opts["out"] ?? getcwd() . DIRECTORY_SEPARATOR . "Symply.phar",
dirname(__DIR__) . DIRECTORY_SEPARATOR,
[
'resources',
'src',
'vendor'
'vendor',
'symply'
],
[
'git' => $gitHash,
Expand Down
Loading

0 comments on commit 892bd50

Please sign in to comment.