Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
Bradez committed Jun 21, 2023
0 parents commit dd91d0c
Show file tree
Hide file tree
Showing 718 changed files with 67,304 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/build export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.php-cs-fixer.php export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file is used to define a set of default reviewers.
* @v16Studios @leonardocustodio @enjinabner
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: composer
directory: /
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 10
9 changes: 9 additions & 0 deletions .github/graphql-inspector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
diff:
annotations: true
failOnBreaking: true
experimental_merge: true
approveLabel: breaking-change
summaryLimit: 150

branch: master
schema: "schema/schema.gql"
40 changes: 40 additions & 0 deletions .github/workflows/code_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Code Analysis and Linting

on:
pull_request:
paths-ignore:
- '**.md'
push:
paths-ignore:
- '**.md'

jobs:
tests:
runs-on: ubuntu-latest
name: Code Analysis

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: composer:v2
coverage: none

- name: Checkout friendsofphp php-cs-fixer code
uses: actions/checkout@v3
with:
repository: 'friendsofphp/php-cs-fixer'
ref: 'v3.15.1'
path: '.php-cs-fixer'

- name: Install dependencies
run: |
cd .php-cs-fixer/
composer install
cd ..
- name: Run
run: ./.php-cs-fixer/php-cs-fixer fix --dry-run --diff --show-progress=none --verbose
78 changes: 78 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Run Tests

on:
pull_request:
paths-ignore:
- '**.md'
push:
paths-ignore:
- '**.md'

jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8
env:
MYSQL_DATABASE: platform
MYSQL_ROOT_PASSWORD: password
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis:7
ports:
- 6379:6379
options: --entrypoint redis-server
strategy:
fail-fast: true
matrix:
php: [8.1, 8.2]

name: PHP ${{ matrix.php }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, gmp, intl, json, mysql, readline, sodium, bcmath
tools: composer:v2
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup GO
uses: actions/setup-go@v4
with:
go-version: '^1.19'

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer install --no-interaction --no-progress
composer build-sr25519
composer dumpautoload
- name: Execute tests
run: |
XDEBUG_MODE=coverage ./vendor/bin/phpunit --colors=always --coverage-clover coverage.xml
env:
DB_HOST: 127.0.0.1:${{ job.services.mysql.ports[3306] }}
DB_DATABASE: platform

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
dry_run: github.event.pull_request.draft == true
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
verbose: true
41 changes: 41 additions & 0 deletions .github/workflows/security_checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Dependencies Security Checker

on:
pull_request:
paths-ignore:
- '**.md'
push:
paths-ignore:
- '**.md'

jobs:
security-checker:
runs-on: ubuntu-latest
name: Sensiolabs Security Checker

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.SSH_PHP_COMMONS }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer:v2
coverage: none

- name: Checkout sensiolabs security-checker code
uses: actions/checkout@v3
with:
repository: 'sensiolabs/security-checker'
path: 'security-checker'

- name: Install dependencies
run: |
cd security-checker/
composer install
- name: Run
run: php security-checker security:check ../composer.lock
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/.idea
/.vscode
/temp
/node_modules
/vendor
/build
/tests/content/*
.env
.*.cache
coverage.xml
composer.lock
165 changes: 165 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<?php

$finder = PhpCsFixer\Finder::create()
->notPath('vendor')
->notPath('build')
->in(__DIR__)
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return (new PhpCsFixer\Config())
->setFinder($finder)
->setRiskyAllowed(true)
->setLineEnding("\n")
->setRules([
'@PSR1' => true,
'@PSR2' => true,
'@PSR12' => true,
'align_multiline_comment' => true,
'array_indentation' => true,
'backtick_to_shell_exec' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => true,
'cast_spaces' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'combine_nested_dirname' => true,
'comment_to_phpdoc' => true,
'compact_nullable_typehint' => true,
'declare_equal_normalize' => true,
'dir_constant' => true,
'explicit_indirect_variable' => true,
'explicit_string_variable' => true,
'fully_qualified_strict_types' => true,
'function_to_constant' => true,
'function_typehint_space' => true,
'single_line_comment_style' => [
'comment_types' => ['hash'],
],
'heredoc_to_nowdoc' => true,
'implode_call' => true,
'include' => true,
'linebreak_after_opening_tag' => true,
'list_syntax' => ['syntax' => 'short'],
'logical_operators' => true,
'lowercase_cast' => true,
'constant_case' => ['case' => 'lower'],
'lowercase_static_reference' => true,
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_chaining_indentation' => true,
'modernize_types_casting' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true,
'native_function_casing' => true,
'no_alias_functions' => true,
'no_alternative_syntax' => true,
'no_binary_string' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_null_property_initialization' => true,
'no_php4_constructor' => true,
'no_short_bool_cast' => true,
'echo_tag_syntax' => ['format' => 'long'],
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_trailing_comma_in_singleline' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_final_method' => true,
'no_unreachable_default_argument_value' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'non_printable_character' => true,
'normalize_index_brace' => true,
'object_operator_without_whitespace' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'ordered_interfaces' => true,
'php_unit_construct' => true,
'php_unit_dedicate_assert' => true,
'php_unit_dedicate_assert_internal_type' => true,
'php_unit_expectation' => true,
'php_unit_method_casing' => ['case' => 'snake_case'],
'phpdoc_indent' => true,
'phpdoc_no_access' => true,
'phpdoc_no_alias_tag' => true,
'phpdoc_no_package' => true,
'phpdoc_order' => true,
'phpdoc_scalar' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_var_without_name' => true,
'phpdoc_summary' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'pow_to_exponentiation' => true,
'psr_autoloading' => true,
'random_api_migration' => true,
'return_type_declaration' => [
'space_before' => 'none',
],
'self_accessor' => true,
'semicolon_after_instruction' => true,
'short_scalar_cast' => true,
'simple_to_complex_string_variable' => true,
'simplified_null_return' => true,
'single_blank_line_before_namespace' => true,
'single_quote' => true,
'space_after_semicolon' => true,
'standardize_increment' => true,
'standardize_not_equals' => true,
'string_line_ending' => true,
'ternary_operator_spaces' => true,
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline' => [
'elements' => ['arrays'],
],
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
'native_function_type_declaration_casing' => true,
'no_closing_tag' => true,
'no_spaces_inside_parenthesis' => true,
'no_spaces_after_function_name' => true,
'nullable_type_declaration_for_default_null_value' => [
'use_nullable_type_declaration' => true,
],
'single_line_after_imports' => true,
'single_import_per_statement' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null],
],
'array_syntax' => ['syntax' => 'short'],
'class_attributes_separation' => [
'elements' => ['method' => 'one'],
],
'concat_space' => [
'spacing' => 'one',
],
'general_phpdoc_annotation_remove' => [
'annotations' => ['author'],
],
'increment_style' => [
'style' => 'post',
],
'no_extra_blank_lines' => [
'tokens' => [
'break',
'continue',
'throw',
'use',
],
],
]);
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

All notable changes to `platform-core` will be documented in this file.

## 1.0.0 - 202X-XX-XX

- initial release
Loading

0 comments on commit dd91d0c

Please sign in to comment.