Skip to content

Commit

Permalink
Merge pull request #789 from spiral/hotfix/composer
Browse files Browse the repository at this point in the history
Updates components
  • Loading branch information
butschster committed Sep 13, 2022
2 parents 520f500 + b33a8e1 commit 7494ae0
Show file tree
Hide file tree
Showing 264 changed files with 2,772 additions and 1,302 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Expand Up @@ -114,7 +114,7 @@ jobs:
# Execution
- name: Static Analysis
run: |
vendor/bin/psalm --no-cache
vendor/bin/psalm --no-cache --shepherd --stats --output-format=checkstyle --php-version=${{ matrix.php }}
vendor/bin/rector --dry-run
Expand Down
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -3,10 +3,12 @@
</p>

<p align="center">
<a href="https://packagist.org/packages/spiral/framework"><img src="https://poser.pugx.org/spiral/framework/require/php"></a>
<a href="https://packagist.org/packages/spiral/framework"><img src="https://poser.pugx.org/spiral/framework/version"></a>
<a href="https://github.com/spiral/framework/actions"><img src="https://github.com/spiral/framework/workflows/build/badge.svg"></a>
<a href="https://codecov.io/gh/spiral/framework"><img src="https://codecov.io/gh/spiral/framework/graph/badge.svg"></a>
<a href="https://scrutinizer-ci.com/g/spiral/framework/?branch=master"><img src="https://scrutinizer-ci.com/g/spiral/framework/badges/quality-score.png"></a>
<a href="https://packagist.org/packages/spiral/framework"><img src="https://poser.pugx.org/spiral/framework/downloads"></a>
</p>

<hr />
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Expand Up @@ -128,15 +128,14 @@
"league/flysystem-async-aws-s3": "^2.0",
"league/flysystem-aws-s3-v3": "^2.0",
"mikey179/vfsstream": "^1.6",
"spiral/testing": "^2.0",
"mockery/mockery": "^1.5",
"phpunit/phpunit": "^9.5.20",
"ramsey/uuid": "^4.2.3",
"ramsey/collection": "^1.2",
"ramsey/uuid": "^4.2.3",
"rector/rector": "0.12.15",
"spiral/code-style": "^1.1",
"spiral/nyholm-bridge": "^1.2",
"symfony/var-dumper": "^5.2|^6.0",
"spiral/testing": "^2.0",
"symplify/monorepo-builder": "^10.2.7",
"vimeo/psalm": "^4.27"
},
Expand Down
39 changes: 0 additions & 39 deletions src/AnnotatedRoutes/.github/workflows/main.yml

This file was deleted.

15 changes: 15 additions & 0 deletions src/AnnotatedRoutes/.github/workflows/phpunit.yml
@@ -0,0 +1,15 @@
on:
push:
branches:
- master

name: phpunit

jobs:
phpunit:
uses: spiral/gh-actions/.github/workflows/phpunit.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.1']
15 changes: 15 additions & 0 deletions src/AnnotatedRoutes/.github/workflows/psalm.yml
@@ -0,0 +1,15 @@
on:
push:
branches:
- master

name: static analysis

jobs:
psalm:
uses: spiral/gh-actions/.github/workflows/psalm.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.1']
93 changes: 9 additions & 84 deletions src/AnnotatedRoutes/README.md
@@ -1,89 +1,14 @@
Annotated Routes
========
[![Latest Stable Version](https://poser.pugx.org/spiral/annotated-routes/v/stable)](https://packagist.org/packages/spiral/annotated-routes)
[![Build Status](https://github.com/spiral/annotated-routes/workflows/build/badge.svg)](https://github.com/spiral/annotated-routes/actions)
[![Codecov](https://codecov.io/gh/spiral/annotated-routes/branch/master/graph/badge.svg)](https://codecov.io/gh/spiral/annotated-routes/)

Provides the ability to use annotated routes and route groups.

Installation:
--------
To install the component:

```bash
$ composer require spiral/annotated-routes
```

Activate the bootloader in your application (instead of `RouteBootloader`):

```php
use Spiral\Router\Bootloader as Router;

// ...

protected const LOAD = [
// ...
Router\AnnotatedRoutesBootloader::class,
// ...
];
```

Configuration:
-------
Define one or multiple route groups (optional) or configure `default` group in your bootloader:
# Annotated Routes

```php
namespace App\Bootloader;

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Spiral\Boot\Bootloader\Bootloader;
use Spiral\Router\GroupRegistry;

class MiddlewareBootloader extends Bootloader
{
public function boot(GroupRegistry $registry)
{
$registry
->getGroup('api')
->setPrefix('api/v1')
->addMiddleware(App\Security\ApiAuthMiddleware::class);
}
}
```

Use environment variable `ROUTE_CACHE` to enable or disable route caching (by default enabled in non `DEBUG` mode). To
reset route cache:

```bash
$ php app.php route:reset
```

Usage:
--------
Use the annotation in your controller methods:

```php
namespace App\Controller;

use Spiral\Router\Annotation\Route;
[![PHP Version Require](https://poser.pugx.org/spiral/annotated-routes/require/php)](https://packagist.org/packages/spiral/annotated-routes)
[![Latest Stable Version](https://poser.pugx.org/spiral/annotated-routes/v/stable)](https://packagist.org/packages/spiral/annotated-routes)
[![phpunit](https://github.com/spiral/annotated-routes/workflows/phpunit/badge.svg)](https://github.com/spiral/annotated-routes/actions)
[![psalm](https://github.com/spiral/annotated-routes/workflows/psalm/badge.svg)](https://github.com/spiral/annotated-routes/actions)
[![Codecov](https://codecov.io/gh/spiral/annotated-routes/branch/master/graph/badge.svg)](https://codecov.io/gh/spiral/annotated-routes/)
[![Total Downloads](https://poser.pugx.org/spiral/annotated-routes/downloads)](https://packagist.org/packages/spiral/annotated-routes)

class HomeController
{
/**
* @Route(route="/", name="home", methods="GET", group="api")
*/
public function index()
{
return 'Hello World';
}
}
```
<b>[Documentation](https://spiral.dev/docs/http-annotated-routes)</b> | [Framework Bundle](https://github.com/spiral/framework)

> Use `group` attribute to configure middleware and domain core in bulk.
## License:

License:
--------
MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. Maintained by [Spiral Scout](https://spiralscout.com).
8 changes: 2 additions & 6 deletions src/AnnotatedRoutes/composer.json
Expand Up @@ -41,18 +41,14 @@
"mockery/mockery": "^1.5",
"spiral/nyholm-bridge": "^1.2",
"spiral/boot": "^3.0",
"spiral/console": "^3.0"
"spiral/console": "^3.0",
"vimeo/psalm": "^4.27"
},
"autoload-dev": {
"psr-4": {
"Spiral\\Tests\\Router\\": "tests"
}
},
"extra": {
"branch-alias": {
"dev-master": "2.14.x-dev"
}
},
"config": {
"sort-packages": true
},
Expand Down
18 changes: 18 additions & 0 deletions src/AnnotatedRoutes/psalm.xml
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<psalm
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"

errorLevel="4"
hoistConstants="true"
resolveFromConfigFile="true"
findUnusedPsalmSuppress="true"
findUnusedVariablesAndParams="true"
ensureArrayStringOffsetsExist="true"
addParamDefaultToDocblockType="true"
>
<projectFiles>
<directory name="src" />
</projectFiles>
</psalm>
15 changes: 15 additions & 0 deletions src/Auth/.github/workflows/phpunit.yml
@@ -0,0 +1,15 @@
on:
push:
branches:
- master

name: phpunit

jobs:
phpunit:
uses: spiral/gh-actions/.github/workflows/phpunit.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.1']
15 changes: 15 additions & 0 deletions src/Auth/.github/workflows/psalm.yml
@@ -0,0 +1,15 @@
on:
push:
branches:
- master

name: static analysis

jobs:
psalm:
uses: spiral/gh-actions/.github/workflows/psalm.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.1']
16 changes: 0 additions & 16 deletions src/Auth/.travis.yml

This file was deleted.

16 changes: 13 additions & 3 deletions src/Auth/README.md
@@ -1,4 +1,14 @@
# Spiral: Common Authentication Interfaces
[![Latest Stable Version](https://poser.pugx.org/spiral/auth/v/stable)](https://packagist.org/packages/spiral/auth)
[![Build Status](https://travis-ci.org/spiral/auth.svg?branch=master)](https://travis-ci.org/spiral/auth)
[![Codecov](https://codecov.io/gh/spiral/auth/graph/badge.svg)](https://codecov.io/gh/spiral/auth)

[![PHP Version Require](https://poser.pugx.org/spiral/auth/require/php)](https://packagist.org/packages/spiral/auth)
[![Latest Stable Version](https://poser.pugx.org/spiral/auth/v/stable)](https://packagist.org/packages/spiral/auth)
[![phpunit](https://github.com/spiral/auth/workflows/phpunit/badge.svg)](https://github.com/spiral/auth/actions)
[![psalm](https://github.com/spiral/auth/workflows/psalm/badge.svg)](https://github.com/spiral/auth/actions)
[![Codecov](https://codecov.io/gh/spiral/auth/branch/master/graph/badge.svg)](https://codecov.io/gh/spiral/auth/)
[![Total Downloads](https://poser.pugx.org/spiral/auth/downloads)](https://packagist.org/spiral/auth/phpunit)

<b>[Documentation](https://spiral.dev/docs/security-authentication)</b> | [Framework Bundle](https://github.com/spiral/framework)

## License:

MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. Maintained by [Spiral Scout](https://spiralscout.com).
5 changes: 3 additions & 2 deletions src/Auth/composer.json
Expand Up @@ -31,7 +31,8 @@
"psr/event-dispatcher": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5.20"
"phpunit/phpunit": "^9.5.20",
"vimeo/psalm": "^4.27"
},
"autoload": {
"psr-4": {
Expand All @@ -45,7 +46,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.14.x-dev"
"dev-master": "3.0.x-dev"
}
},
"config": {
Expand Down
18 changes: 18 additions & 0 deletions src/Auth/psalm.xml
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<psalm
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"

errorLevel="1"
hoistConstants="true"
resolveFromConfigFile="true"
findUnusedPsalmSuppress="true"
findUnusedVariablesAndParams="true"
ensureArrayStringOffsetsExist="true"
addParamDefaultToDocblockType="true"
>
<projectFiles>
<directory name="src" />
</projectFiles>
</psalm>
15 changes: 15 additions & 0 deletions src/AuthHttp/.github/workflows/phpunit.yml
@@ -0,0 +1,15 @@
on:
push:
branches:
- master

name: phpunit

jobs:
phpunit:
uses: spiral/gh-actions/.github/workflows/phpunit.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.1']
15 changes: 15 additions & 0 deletions src/AuthHttp/.github/workflows/psalm.yml
@@ -0,0 +1,15 @@
on:
push:
branches:
- master

name: static analysis

jobs:
psalm:
uses: spiral/gh-actions/.github/workflows/psalm.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.1']

0 comments on commit 7494ae0

Please sign in to comment.