From 302ceca5f151c68849ec0a3d70c5bec2993e73a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20B=C5=99ou=C5=A1ek?= <brousek@ics.muni.cz> Date: Sat, 24 Sep 2022 20:42:10 +0200 Subject: [PATCH] ci: common CI --- .github/workflows/build_and_check.yml | 51 -- .gitignore | 723 ++++++++++++++++++++++++- .gitlab-ci.yml | 3 + .prettierignore | 725 ++++++++++++++++++++++++++ .prettierrc.json | 1 + .releaserc.json | 1 + CODEOWNERS | 15 - LICENSE | 21 +- composer.json | 64 ++- composer.lock | 65 +-- ecs.php | 44 -- package.json | 9 - phpcs.xml | 207 -------- 13 files changed, 1495 insertions(+), 434 deletions(-) delete mode 100644 .github/workflows/build_and_check.yml create mode 100644 .gitlab-ci.yml create mode 100644 .prettierignore create mode 100644 .prettierrc.json create mode 100644 .releaserc.json delete mode 100644 CODEOWNERS delete mode 100644 ecs.php delete mode 100644 package.json delete mode 100644 phpcs.xml diff --git a/.github/workflows/build_and_check.yml b/.github/workflows/build_and_check.yml deleted file mode 100644 index 0b3b2ab..0000000 --- a/.github/workflows/build_and_check.yml +++ /dev/null @@ -1,51 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - php-version: [7.4, 8.0] - composer-version: [1, 2] - steps: - - uses: actions/checkout@v3 - - name: Cache Composer dependencies - uses: actions/cache@v2 - with: - path: /tmp/composer-cache - key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} - - name: Install dependencies - uses: php-actions/composer@v6 - with: - php_version: ${{ matrix.php-version }} - version: ${{ matrix.composer-version }} - php_extensions: curl iconv intl json ldap - - name: Run easy coding standard - run: vendor/bin/ecs check - release: - name: Release - needs: [build] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: 14 - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm install && npx semantic-release - diff --git a/.gitignore b/.gitignore index 2f3285b..25211b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,718 @@ -.idea -*.iml -out -gen +## Ansible -modules/ -vendor/ +*.retry + +## composer + +composer.phar +/vendor/ + +## Java + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +## JetBrains + +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# 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 + +# 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 +.idea/modules.xml +.idea/*.iml +.idea/modules + +# 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 + +# 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 + +## macOS + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +## maven + +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar + +## node + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +#DynamoDB Local files +.dynamodb/ + +## Python + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib64/ +parts/ +sdist/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +## vim + +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +## Visual Studio + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~ +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +bower_components/ +# ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true +**/wwwroot/lib/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +## Windows + +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..1576414 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,3 @@ +include: + - project: perun-proxy-aai/common + file: /templates/.gitlab-ci-template.yml diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..e63377a --- /dev/null +++ b/.prettierignore @@ -0,0 +1,725 @@ +## Ansible + +*.retry + +## composer + +composer.phar +/vendor/ + +## Java + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +## JetBrains + +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# 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 + +# 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 +.idea/modules.xml +.idea/*.iml +.idea/modules + +# 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 + +# 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 + +## macOS + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +## maven + +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar + +## node + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +#DynamoDB Local files +.dynamodb/ + +## Python + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib64/ +parts/ +sdist/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +## vim + +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +## Visual Studio + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~ +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +bower_components/ +# ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true +**/wwwroot/lib/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +## Windows + +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +package-lock.json +composer.lock +CHANGELOG.md +.git +*.min.css +*.min.js diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1 @@ +{} diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..25929ca --- /dev/null +++ b/.releaserc.json @@ -0,0 +1 @@ +{ "extends": ["@perun-proxy-aai/semantic-release-proxy-config"] } diff --git a/CODEOWNERS b/CODEOWNERS deleted file mode 100644 index c9b57c7..0000000 --- a/CODEOWNERS +++ /dev/null @@ -1,15 +0,0 @@ -# Lines starting with '#' are comments. -# Each line is a file pattern followed by one or more owners. - -# These owners will be the default owners for everything in the repo. -* @pajavyskocil @dBucik - -# Order is important. The last matching pattern has the most precedence. -# So if a pull request only touches javascript files, only these owners -# will be requested to review. - -#*.php @login - -# You can also use email addresses if you prefer. - -#* login@example.com \ No newline at end of file diff --git a/LICENSE b/LICENSE index 240f6c3..42bda4f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,17 +1,20 @@ -BSD 2-Clause License +BSD 3-Clause License -Copyright (c) 2017, ELIXIR Hub -All rights reserved. +Copyright (c) 2022, CESNET, z. s. p. o. and Institute of Computer Science, Masaryk University Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -22,4 +25,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/composer.json b/composer.json index c31f817..7911e09 100644 --- a/composer.json +++ b/composer.json @@ -1,38 +1,34 @@ { - "name": "elixir/simplesamlphp-module-elixir", - "description": "A SimpleSAMLphp module providing template for DiscoPower and user-facing parts of the SSP for ELIXIR", - "type": "simplesamlphp-module", - "keywords": ["ELIXIR", "elixir", "simplesamlphp"], - "license": "BSD-2-Clause", - "authors": [ - { - "name": "Pavel Vyskocil", - "email": "vyskocilpavel@muni.cz" - }, - { - "name": "Michal Prochazka", - "email": "michalp@ics.muni.cz" - }, - { - "name": "Dominik Frantisek Bucik", - "email": "bucik@ics.muni.cz" - } - ], - "require": { - "simplesamlphp/composer-module-installer": "~1.0", - "simplesamlphp/simplesamlphp": "~v1.19.0", - "cesnet/simplesamlphp-module-perun": "^v9.0.0", - "cesnet/simplesamlphp-module-proxystatistics": "^v8.0.0", - "ext-json": "*", - "ext-curl": "*", - "ext-pdo": "*" + "name": "elixir/simplesamlphp-module-elixir", + "description": "A SimpleSAMLphp module providing template for DiscoPower and user-facing parts of the SSP for ELIXIR", + "type": "simplesamlphp-module", + "keywords": [ + "ELIXIR", + "elixir", + "simplesamlphp" + ], + "license": "BSD-3-Clause", + "require": { + "simplesamlphp/composer-module-installer": "~1.0", + "simplesamlphp/simplesamlphp": "~v1.19.0", + "cesnet/simplesamlphp-module-perun": "^v9.0.0", + "cesnet/simplesamlphp-module-proxystatistics": "^v8.0.0", + "ext-json": "*", + "ext-curl": "*", + "ext-pdo": "*" + }, + "config": { + "platform": { + "php": "7.4" }, - "require-dev": { - "symplify/easy-coding-standard": "^9.4" - }, - "config": { - "allow-plugins": { - "simplesamlphp/composer-module-installer": true - } + "allow-plugins": { + "simplesamlphp/composer-module-installer": true + } + }, + "authors": [ + { + "name": "Perun proxy AAI team", + "email": "proxyidp@cesnet.cz" } + ] } diff --git a/composer.lock b/composer.lock index 276a9c7..99b350d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "da9c1551e9c77601b2b4f530a6718b67", + "content-hash": "c302685315150dd3ad1c975c560d2036", "packages": [ { "name": "brick/math", @@ -6319,63 +6319,7 @@ "time": "2015-02-11T11:06:42+00:00" } ], - "packages-dev": [ - { - "name": "symplify/easy-coding-standard", - "version": "9.4.70", - "source": { - "type": "git", - "url": "https://github.com/symplify/easy-coding-standard.git", - "reference": "9276b0c7a1a5671fc4a067656ab40d0aea42aaca" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symplify/easy-coding-standard/zipball/9276b0c7a1a5671fc4a067656ab40d0aea42aaca", - "reference": "9276b0c7a1a5671fc4a067656ab40d0aea42aaca", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "conflict": { - "friendsofphp/php-cs-fixer": "<3.0", - "squizlabs/php_codesniffer": "<3.6" - }, - "bin": [ - "bin/ecs" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "9.5-dev" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Prefixed scoped version of ECS package", - "support": { - "source": "https://github.com/symplify/easy-coding-standard/tree/9.4.70" - }, - "funding": [ - { - "url": "https://www.paypal.me/rectorphp", - "type": "custom" - }, - { - "url": "https://github.com/tomasvotruba", - "type": "github" - } - ], - "time": "2021-10-02T16:09:04+00:00" - } - ], + "packages-dev": [], "aliases": [], "minimum-stability": "stable", "stability-flags": [], @@ -6387,5 +6331,8 @@ "ext-pdo": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "platform-overrides": { + "php": "7.4" + }, + "plugin-api-version": "2.2.0" } diff --git a/ecs.php b/ecs.php deleted file mode 100644 index 2ae3fe7..0000000 --- a/ecs.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -declare(strict_types=1); - -use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer; -use PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer; -use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -use Symplify\EasyCodingStandard\ValueObject\Option; -use Symplify\EasyCodingStandard\ValueObject\Set\SetList; - -return static function (ContainerConfigurator $containerConfigurator): void { - $parameters = $containerConfigurator->parameters(); - $parameters->set(Option::PATHS, [ - __DIR__ . '/ecs.php', - __DIR__ . '/config-templates', - __DIR__ . '/themes', - __DIR__ . '/www', - ]); - $parameters->set(Option::PARALLEL, true); - $parameters->set(Option::SKIP, [NotOperatorWithSuccessorSpaceFixer::class, FunctionTypehintSpaceFixer::class]); - - $containerConfigurator->import(SetList::PHP_CS_FIXER); - $containerConfigurator->import(SetList::CLEAN_CODE); - $containerConfigurator->import(SetList::SYMPLIFY); - $containerConfigurator->import(SetList::ARRAY); - $containerConfigurator->import(SetList::COMMON); - $containerConfigurator->import(SetList::COMMENTS); - $containerConfigurator->import(SetList::CONTROL_STRUCTURES); - $containerConfigurator->import(SetList::DOCBLOCK); - $containerConfigurator->import(SetList::NAMESPACES); - $containerConfigurator->import(SetList::PHPUNIT); - $containerConfigurator->import(SetList::SPACES); - $containerConfigurator->import(SetList::STRICT); - $containerConfigurator->import(SetList::SYMFONY); - $containerConfigurator->import(SetList::PSR_12); - - $services = $containerConfigurator->services(); - $services->set(ArraySyntaxFixer::class) - ->call('configure', [[ - 'syntax' => 'short', - ]]) - ; -}; diff --git a/package.json b/package.json deleted file mode 100644 index e115d60..0000000 --- a/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "simplesamlphp-module-elixir", - "private": true, - "devDependencies": { - "@semantic-release/changelog": "^5.0.1", - "@semantic-release/git": "^9.0.0", - "semantic-release": "^17.4.2" - } -} diff --git a/phpcs.xml b/phpcs.xml deleted file mode 100644 index 7e64f46..0000000 --- a/phpcs.xml +++ /dev/null @@ -1,207 +0,0 @@ -<?xml version="1.0"?> -<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PSR2" xsi:noNamespaceSchemaLocation="../../../phpcs.xsd"> - <description>The PSR-2 coding standard.</description> - <arg name="tab-width" value="4"/> - - <!-- 2. General --> - - <!-- 2.1 Basic Coding Standard --> - - <!-- Include the whole PSR-1 standard --> - <rule ref="PSR1"/> - - <!-- 2.2 Files --> - - <!-- All PHP files MUST use the Unix LF (linefeed) line ending. --> - <rule ref="Generic.Files.LineEndings"> - <properties> - <property name="eolChar" value="\n"/> - </properties> - </rule> - - <!-- All PHP files MUST end with a single blank line. --> - <!-- checked by PSR2.Files.EndFileNewline --> - - <!-- The closing ?> tag MUST be omitted from files containing only PHP. --> - <!-- checked by PSR2.Files.ClosingTag --> - - <!-- 2.3 Lines --> - - <!-- The soft limit on line length MUST be 120 characters; automated style checkers MUST warn but MUST NOT error at the soft limit. --> - <rule ref="Generic.Files.LineLength"> - <properties> - <property name="lineLimit" value="120"/> - <property name="absoluteLineLimit" value="0"/> - </properties> - </rule> - - <!-- There MUST NOT be trailing whitespace at the end of non-blank lines. --> - <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"> - <properties> - <property name="ignoreBlankLines" value="true"/> - </properties> - </rule> - <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile"> - <severity>0</severity> - </rule> - <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile"> - <severity>0</severity> - </rule> - <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines"> - <severity>0</severity> - </rule> - - <!-- There MUST NOT be more than one statement per line. --> - <rule ref="Generic.Formatting.DisallowMultipleStatements"/> - - <!-- 2.4 Indenting --> - - <!-- Code MUST use an indent of 4 spaces, and MUST NOT use tabs for indenting. --> - <rule ref="Generic.WhiteSpace.ScopeIndent"> - <properties> - <property name="ignoreIndentationTokens" type="array"> - <element value="T_COMMENT"/> - <element value="T_DOC_COMMENT_OPEN_TAG"/> - </property> - </properties> - </rule> - <rule ref="Generic.WhiteSpace.DisallowTabIndent"/> - - <!-- 2.5 Keywords and True/False/Null --> - - <!-- PHP keywords MUST be in lower case. --> - <rule ref="Generic.PHP.LowerCaseKeyword"/> - - <!-- The PHP constants true, false, and null MUST be in lower case. --> - <rule ref="Generic.PHP.LowerCaseConstant"/> - - <!-- 3. Namespace and Use Declarations --> - - <!-- When present, there MUST be one blank line after the namespace declaration. --> - <!-- checked by PSR2.Namespaces.NamespaceDeclaration --> - - <!-- When present, all use declarations MUST go after the namespace declaration. - There MUST be one use keyword per declaration. - There MUST be one blank line after the use block. --> - <!-- checked by PSR2.Namespaces.UseDeclaration --> - - <!-- 4. Classes, Properties, and Methods --> - - <!-- 4.1. Extends and Implements --> - - <!-- The extends and implements keywords MUST be declared on the same line as the class name. - The opening brace for the class go MUST go on its own line; the closing brace for the class MUST go on the next line after the body. - Lists of implements MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one interface per line. --> - <!-- checked by PSR2.Classes.ClassDeclaration --> - - <!-- 4.2. Properties --> - - <!-- Visibility MUST be declared on all properties. - The var keyword MUST NOT be used to declare a property. - There MUST NOT be more than one property declared per statement. - Property names SHOULD NOT be prefixed with a single underscore to indicate protected or private visibility. --> - <!-- checked by PSR2.Classes.PropertyDeclaration --> - - <!-- 4.3 Methods --> - - <!-- Visibility MUST be declared on all methods. --> - <rule ref="Squiz.Scope.MethodScope"/> - <rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/> - - <!-- Method names SHOULD NOT be prefixed with a single underscore to indicate protected or private visibility. --> - <!-- checked by PSR2.Methods.MethodDeclaration --> - - <!-- Method names MUST NOT be declared with a space after the method name. The opening brace MUST go on its own line, and the closing brace MUST go on the next line following the body. There MUST NOT be a space after the opening parenthesis, and there MUST NOT be a space before the closing parenthesis. --> - <!-- checked by PSR2.Methods.FunctionClosingBrace --> - <rule ref="Squiz.Functions.FunctionDeclaration"/> - <rule ref="Squiz.Functions.LowercaseFunctionKeywords"/> - - <!-- 4.4 Method Arguments --> - - <!-- In the argument list, there MUST NOT be a space before each comma, and there MUST be one space after each comma. --> - <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"> - <properties> - <property name="equalsSpacing" value="1"/> - </properties> - </rule> - <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint"> - <severity>0</severity> - </rule> - - <!-- Method arguments with default values MUST go at the end of the argument list. --> - <rule ref="PEAR.Functions.ValidDefaultValue"/> - - <!-- Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line. When the argument list is split across multiple lines, the closing parenthesis and opening brace MUST be placed together on their own line with one space between them. --> - <rule ref="Squiz.Functions.MultiLineFunctionDeclaration"/> - - <!-- 4.5 abstract, final, and static --> - - <!-- When present, the abstract and final declarations MUST precede the visibility declaration. - When present, the static declaration MUST come after the visibility declaration. --> - <!-- checked by PSR2.Methods.MethodDeclaration --> - - <!-- 4.6 Method and Function Calls --> - - <!-- When making a method or function call, there MUST NOT be a space between the method or function name and the opening parenthesis, there MUST NOT be a space after the opening parenthesis, and there MUST NOT be a space before the closing parenthesis. In the argument list, there MUST NOT be a space before each comma, and there MUST be one space after each comma. - Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line. --> - <rule ref="Generic.Functions.FunctionCallArgumentSpacing"/> - <rule ref="PSR2.Methods.FunctionCallSignature.SpaceAfterCloseBracket"> - <severity>0</severity> - </rule> - <rule ref="PSR2.Methods.FunctionCallSignature.OpeningIndent"> - <severity>0</severity> - </rule> - - <!-- 5. Control Structures --> - - <!-- The general style rules for control structures are as follows: - There MUST be one space after the control structure keyword - There MUST NOT be a space after the opening parenthesis - There MUST NOT be a space before the closing parenthesis - There MUST be one space between the closing parenthesis and the opening brace - The structure body MUST be indented once - The closing brace MUST be on the next line after the body --> - <rule ref="Squiz.ControlStructures.ControlSignature"/> - <rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen"/> - <rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose"/> - <rule ref="Squiz.WhiteSpace.ScopeClosingBrace"/> - <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration"/> - <rule ref="Squiz.ControlStructures.ForLoopDeclaration"/> - <rule ref="Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterOpen"> - <severity>0</severity> - </rule> - <rule ref="Squiz.ControlStructures.ForLoopDeclaration.SpacingBeforeClose"> - <severity>0</severity> - </rule> - <rule ref="Squiz.ControlStructures.LowercaseDeclaration"/> - <!-- checked by PSR2.ControlStructures.ControlStructureSpacing --> - - <!-- exclude this message as it is already checked Generic.PHP.LowerCaseKeyword --> - <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.AsNotLower"> - <severity>0</severity> - </rule> - - <!-- The body of each structure MUST be enclosed by braces. This standardizes how the structures look, and reduces the likelihood of introducing errors as new lines get added to the body. --> - <rule ref="Generic.ControlStructures.InlineControlStructure"/> - - <!-- 5.1. if, elseif, else --> - - <!-- The keyword elseif SHOULD be used instead of else if so that all control keywords look like single words. --> - <!-- checked by PSR2.ControlStructures.ElseIfDeclaration --> - - <!-- 5.2. switch, case --> - - <!-- The case statement MUST be indented once from switch, and the break keyword (or other terminating keyword) MUST be indented at the same level as the case body. There MUST be a comment such as // no break when fall-through is intentional in a non-empty case body. --> - <!-- checked by PSR2.ControlStructures.SwitchDeclaration --> - - <!-- 6. Closures --> - - <!-- Closures MUST be declared with a space after the function keyword, and a space before and after the use keyword. - The opening brace MUST go on the same line, and the closing brace MUST go on the next line following the body. - There MUST NOT be a space after the opening parenthesis of the argument list or variable list, and there MUST NOT be a space before the closing parenthesis of the argument list or variable list. - In the argument list and variable list, there MUST NOT be a space before each comma, and there MUST be one space after each comma. - Closure arguments with default values MUST go at the end of the argument list. - Argument lists and variable lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument or variable per line. - When the ending list (whether or arguments or variables) is split across multiple lines, the closing parenthesis and opening brace MUST be placed together on their own line with one space between them. --> - <!-- checked in Squiz.Functions.MultiLineFunctionDeclaration --> -</ruleset> -- GitLab