update most ancillary files, based on upstream
authorAndrew Engelbrecht <andrew@fsf.org>
Wed, 2 Aug 2023 18:32:24 +0000 (14:32 -0400)
committerAndrew Engelbrecht <andrew@fsf.org>
Wed, 2 Aug 2023 18:32:24 +0000 (14:32 -0400)
commit: 781489f663c1832c35af332f6ad5a709dfdceb8d
https://github.com/simplesamlphp/simplesamlphp-module-sqlauth.git

12 files changed:
.gitattributes [new file with mode: 0644]
.gitignore
.markdownlintignore [new file with mode: 0644]
.markdownlintrc [new file with mode: 0644]
.travis.yml [deleted file]
bin/check-syntax.sh [deleted file]
codecov.yml [moved from .codecov.yml with 54% similarity]
composer.json
phpcs.xml [new file with mode: 0644]
phpunit.xml
psalm.xml
tests/bootstrap.php

diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..3d472ad
--- /dev/null
@@ -0,0 +1,13 @@
+/tools/ export-ignore
+/tests/ export-ignore
+codecov.yml export-ignore
+.editorconfig export-ignore
+.gitattributes export-ignore
+.gitignore export-ignore
+psalm.xml export-ignore
+psalm-dev.xml export-ignore
+phpcs.xml export-ignore
+phpunit.xml export-ignore
+.php_cs.dist export-ignore
+.markdownlintignore export-ignore
+.markdownlintrc export-ignore
index e9517adfeb852ac23c55ba9c971f802854225112..5af2d50675070c42cb216e169ddbcd0a061a6404 100644 (file)
@@ -1,3 +1,12 @@
 *~
 *.swo
 *.swp
+
+.phpunit.result.cache
+composer.lock
+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
diff --git a/.markdownlintignore b/.markdownlintignore
new file mode 100644 (file)
index 0000000..140fada
--- /dev/null
@@ -0,0 +1 @@
+vendor/*
diff --git a/.markdownlintrc b/.markdownlintrc
new file mode 100644 (file)
index 0000000..b077f0e
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "default": true,
+  "MD013": false
+}
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index fec43ab..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-sudo: required
-
-language: php
-
-php:
-  - 5.6
-  - 7.0
-  - 7.1
-  - 7.2
-  - 7.3
-
-env:
-  - SIMPLESAMLPHP_VERSION=1.17.*
-
-before_script:
-  - composer require "simplesamlphp/simplesamlphp:${SIMPLESAMLPHP_VERSION}" --no-update
-  - composer update --no-interaction
-  - if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then composer require --dev vimeo/psalm:1.1.9; fi
-
-script:
-  - bin/check-syntax.sh
-  - if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then php vendor/phpunit/phpunit/phpunit; else php vendor/phpunit/phpunit/phpunit --no-coverage; fi
-  - if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then vendor/bin/psalm; fi
-
-after_success:
-  # Codecov, need to edit bash uploader for incorrect TRAVIS_PYTHON_VERSION environment variable matching, at least until codecov/codecov-bash#133 is resolved
-  - curl -s https://codecov.io/bash > .codecov
-  - sed -i -e 's/TRAVIS_.*_VERSION/^TRAVIS_.*_VERSION=/' .codecov
-  - chmod +x .codecov
-  - if [[ $TRAVIS_PHP_VERSION == "5.6" ]]; then ./.codecov -X gcov; fi
-# - if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then bash <(curl -s https://codecov.io/bash); fi
diff --git a/bin/check-syntax.sh b/bin/check-syntax.sh
deleted file mode 100755 (executable)
index db6dc4b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env bash
-
-PHP='/usr/bin/env php'
-RETURN=0
-
-# check PHP files
-for FILE in `find lib tests -name "*.php"`; do
-    $PHP -l $FILE > /dev/null 2>&1
-    if [ $? -ne 0 ]; then
-        echo "Syntax check failed for ${FILE}"
-        RETURN=`expr ${RETURN} + 1`
-    fi
-done
-
-exit $RETURN
similarity index 54%
rename from .codecov.yml
rename to codecov.yml
index f7f39e1e93d0ca23383d5ed120442f62f5f15ac9..d01dd7dd7252a5df9268b4761b7f1d02859cf623 100644 (file)
@@ -1,7 +1,10 @@
 coverage:
   status:
-    project: yes
-
+    project:
+      default:
+        target: 0%
+        threshold: 2%
+    patch: off
 comment:
   layout: "diff"
   behavior: once
@@ -9,3 +12,6 @@ comment:
   require_base: no
   require_head: yes
   branches: null
+
+github_checks:
+  annotations: false
index 14afd788806600fc17503c28f76d02131608e3ea..dffd95914659f977e906abb00020e4edbacc87d3 100644 (file)
         "preferred-install": {
             "simplesamlphp/simplesamlphp": "source",
             "*": "dist"
+        },
+        "allow-plugins": {
+            "composer/package-versions-deprecated": true,
+            "simplesamlphp/composer-module-installer": true
         }
     },
     "autoload": {
         }
     },
     "require": {
-        "php": ">=5.6",
-        "simplesamlphp/composer-module-installer": "~1.1"
+        "php": "^7.4",
+        "simplesamlphp/assert": "^1.0.0",
+        "simplesamlphp/composer-module-installer": "^1.3.2",
+        "simplesamlphp/simplesamlphp": "*"
     },
     "require-dev": {
-        "phpunit/phpunit": "~5.7",
-        "simplesamlphp/simplesamlphp": "^1.17",
-        "webmozart/assert": "^1.4"
+        "simplesamlphp/simplesamlphp-test-framework": "^1.5.4"
     }
 }
diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644 (file)
index 0000000..dd28f7e
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<ruleset name="SimpleSAMLphp SAML2 ruleset">
+    <description>
+        By default it is less stringent about long lines than other coding standards
+    </description>
+
+    <file>src</file>
+    <file>tests</file>
+    <!-- Use this to exclude paths. You can have multiple patterns -->
+    <!--<exclude-pattern>*/tests/*</exclude-pattern>-->
+    <!--<exclude-pattern>*/other/*</exclude-pattern>-->
+
+    <!-- This is the rule we inherit from. If you want to exclude some specific rules, see the docs on how to do that -->
+    <rule ref="PSR12"/>
+</ruleset>
index c0985fdd804b18d8d9179ecd956d63582c189e95..af9cf95f46037eb51e464e4ae37b7534ac5e7f6f 100644 (file)
@@ -1,19 +1,20 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<phpunit bootstrap="tests/bootstrap.php">
-    <testsuites>
-        <testsuite name="The project's test suite">
-            <directory>tests/</directory>
-        </testsuite>
-    </testsuites>
-    <filter>
-        <whitelist processUncoveredFilesFromWhitelist="true">
-            <directory suffix=".php">./lib</directory>
-        </whitelist>
-    </filter>
-    <logging>
-        <log type="coverage-text" target="php://stdout" showUncoveredFiles="true" />
-        <log type="coverage-html" target="build/coverage" title="PHP Coveralls" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70" />
-        <log type="coverage-clover" target="build/logs/clover.xml" />
-    </logging>
+<?xml version="1.0" encoding="utf-8"?>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
+  <coverage processUncoveredFiles="true">
+    <include>
+      <directory suffix=".php">./lib</directory>
+    </include>
+    <report>
+      <clover outputFile="build/logs/clover.xml"/>
+      <html outputDirectory="build/coverage" lowUpperBound="35" highLowerBound="70"/>
+      <text outputFile="php://stdout" showUncoveredFiles="true"/>
+    </report>
+  </coverage>
+  <testsuites>
+    <testsuite name="The project's test suite">
+      <directory>./vendor/simplesamlphp/simplesamlphp-test-framework/src</directory>
+      <directory>./tests</directory>
+    </testsuite>
+  </testsuites>
+  <logging/>
 </phpunit>
-
index a9cae34101aeb861353a1647059bb37ed40e205a..32626a684c9effcf8bf1272e6df40c0362be47cd 100644 (file)
--- a/psalm.xml
+++ b/psalm.xml
@@ -2,10 +2,11 @@
 <psalm
     name="The SimpleSAMLphp sqlauth module"
     useDocblockTypes="true"
-    totallyTyped="false"
+    errorLevel="2"
+    reportMixedIssues="false"
 >
     <projectFiles>
-        <directory name="lib" />
+        <directory name="src" />
     </projectFiles>
 
     <issueHandlers>
@@ -18,7 +19,6 @@
         <MissingReturnType errorLevel="info" />
         <MissingPropertyType errorLevel="info" />
         <InvalidDocblock errorLevel="info" />
-        <MisplacedRequiredParam errorLevel="info" />
 
         <PropertyNotSetInConstructor errorLevel="info" />
         <MissingConstructor errorLevel="info" />
index 28efee11df1f5b3ff515ddffd584f632b7d78c83..d3b131a2e1a9a44176f00249508fdaee67f3f5f5 100644 (file)
@@ -1,10 +1,12 @@
 <?php
 
+declare(strict_types=1);
+
 $projectRoot = dirname(__DIR__);
-require_once($projectRoot.'/vendor/autoload.php');
+require_once($projectRoot . '/vendor/autoload.php');
 
 // Symlink module into ssp vendor lib so that templates and urls can resolve correctly
-$linkPath = $projectRoot.'/vendor/simplesamlphp/simplesamlphp/modules/sqlauth';
+$linkPath = $projectRoot . '/vendor/simplesamlphp/simplesamlphp/modules/sqlauth';
 if (file_exists($linkPath) === false) {
     echo "Linking '$linkPath' to '$projectRoot'\n";
     symlink($projectRoot, $linkPath);