diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 757d47a..c02b873 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,30 +6,24 @@ on: pull_request: jobs: - test: + tests: + name: Tests runs-on: ubuntu-latest - strategy: - matrix: - php: [ '8.5' ] steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 + - uses: actions/checkout@v6 + - uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php }} + php-version: '8.5' + - uses: ramsey/composer-install@v3 + - run: composer phpunit - - name: Get composer cache - uses: actions/cache@v4 + static-analysis: + name: Static Analysis + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: shivammathur/setup-php@v2 with: - path: ~/.cache/composer - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - - name: Install dependencies - run: composer install --no-progress --prefer-dist --no-interaction - - - name: Run PHPUnit - run: vendor/bin/phpunit --configuration phpunit.xml.dist \ No newline at end of file + php-version: '8.5' + - uses: ramsey/composer-install@v3 + - run: composer phpstan diff --git a/composer.json b/composer.json index 0e683fc..4d996e7 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,12 @@ }, "autoload": { "psr-4": { - "Respect\\": "library/Respect" + "Respect\\Data\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Respect\\Data\\": "tests/" } }, "scripts": { diff --git a/phpcs.xml.dist b/phpcs.xml.dist index e46b5b1..923dc83 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -11,7 +11,7 @@ - library/ + src/ tests/ diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 863cf16..b3f480f 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,9 +1,9 @@ parameters: - level: 1 + level: 2 paths: - - library/ + - src/ - tests/ ignoreErrors: - - message: '/Call to an undefined static method Respect\\Data\\Collections\\(Collection|Filtered|Mix|Typed)::\w+\(\)\./' - - message: '/Call to an undefined method Respect\\Data\\AbstractMapper::\w+\(\)\./' + - message: '/Call to an undefined (static )?method Respect\\Data\\(AbstractMapper|Collections\\(Collection|Filtered|Mix|Typed))::\w+\(\)\./' + - message: '/Access to an undefined property Respect\\Data\\Collections\\Collection::\$\w+\./' - message: '/Unsafe usage of new static\(\)\./' diff --git a/library/Respect/Data/AbstractMapper.php b/src/AbstractMapper.php similarity index 99% rename from library/Respect/Data/AbstractMapper.php rename to src/AbstractMapper.php index 0531be4..1ea036e 100644 --- a/library/Respect/Data/AbstractMapper.php +++ b/src/AbstractMapper.php @@ -1,5 +1,7 @@