diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..c92aa01 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,49 @@ +name: 'CI' + +on: + - 'push' + - 'pull_request' + +jobs: + tests: + name: 'Lint files' + + runs-on: 'ubuntu-latest' + + strategy: + matrix: + php-version: + - '5.3' + - '5.4' + - '5.5' + - '5.6' + - '7.0' + - '7.1' + - '7.2' + - '7.3' + - '7.4' + - '8.0' + + steps: + - name: 'Check out' + uses: 'actions/checkout@v2' + + - name: 'Set up PHP' + uses: 'shivammathur/setup-php@v2' + with: + php-version: '${{ matrix.php-version }}' + coverage: 'none' + + - name: 'Get Composer cache directory' + id: 'composer-cache' + run: 'echo "::set-output name=cache-dir::$(composer config cache-files-dir)"' + + - name: 'Cache dependencies' + uses: 'actions/cache@v2' + with: + path: '${{ steps.composer-cache.outputs.cache-dir }}' + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" + restore-keys: 'php-${{ matrix.php-version }}-composer-locked-' + + - name: 'Lint PHP files' + run: 'find src -type f -name "*.php" -exec php -l {} \; | (! grep -v "No syntax errors detected" )' diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cb6cc9..6f911a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ CHANGELOG ========= +0.2.0 +----- + +* Added `StatementIdAlreadyExistsException`. +* Added `UnsupportedStatementVersionException`. + 0.1.1 ----- diff --git a/LICENSE b/LICENSE index 967410f..00e1421 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2016 Christian Flothmann +Copyright (c) 2014-2018 Christian Flothmann Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/composer.json b/composer.json index cc19a7c..976d964 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ }, "extra": { "branch-alias": { - "dev-master": "0.1.x-dev" + "dev-master": "0.2.x-dev" } } } diff --git a/src/StatementIdAlreadyExistsException.php b/src/StatementIdAlreadyExistsException.php new file mode 100644 index 0000000..9751ce6 --- /dev/null +++ b/src/StatementIdAlreadyExistsException.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Xabbuh\XApi\Common\Exception; + +/** + * Statement id already exists exception. + * + * @author Jérôme Parmentier + */ +class StatementIdAlreadyExistsException extends XApiException +{ + public function __construct($statementId, \Exception $previous = null) + { + parent::__construct(sprintf('A statement with ID "%s" already exists.', $statementId), 0, $previous); + } +} diff --git a/src/UnsupportedStatementVersionException.php b/src/UnsupportedStatementVersionException.php new file mode 100644 index 0000000..19252a5 --- /dev/null +++ b/src/UnsupportedStatementVersionException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Xabbuh\XApi\Common\Exception; + +/** + * Unsupported statement version exception. + * + * @author Jérôme Parmentier + */ +class UnsupportedStatementVersionException extends XApiException +{ +}