Skip to content

Commit

Permalink
changed config filename
Browse files Browse the repository at this point in the history
code style
  • Loading branch information
ericyzhu committed Sep 5, 2020
1 parent 869ea1e commit b959dfe
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 71 deletions.
9 changes: 4 additions & 5 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?php

$header = <<<'EOF'
This file is part of Hyperf.
This file is part of hyperf-ext/cookie.
@link https://www.hyperf.io
@document https://hyperf.wiki
@contact group@hyperf.io
@license https://github.com/hyperf/hyperf/blob/master/LICENSE
@link https://github.com/hyperf-ext/cookie
@contact eric@zhu.email
@license https://github.com/hyperf-ext/cookie/blob/master/LICENSE
EOF;

return PhpCsFixer\Config::create()
Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)

Copyright (c) Taylor Otwell
Copyright (c) Eric Zhu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ composer require hyperf-ext/cookie
php bin/hyperf.php vendor:publish hyperf-ext/cookie
```

> 配置文件位于 `config/autoload/ext-cookie.php`
> 配置文件位于 `config/autoload/cookie.php`
## 设置

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"hyperf",
"cookie"
],
"description": "The unofficial Hyperf Queued Cookie package.",
"description": "The Hyperf Queued Cookie package.",
"authors": [
{
"name": "Eric Zhu",
Expand Down
15 changes: 15 additions & 0 deletions publish/cookie.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);
/**
* This file is part of hyperf-ext/cookie.
*
* @link https://github.com/hyperf-ext/cookie
* @contact eric@zhu.email
* @license https://github.com/hyperf-ext/cookie/blob/master/LICENSE
*/
return [
'path' => env('COOKIE_PATH', '/'),
'domain' => env('COOKIE_DOMAIN', ''),
'same_site' => env('COOKIE_SANE_SITE', 'lax'),
];
16 changes: 0 additions & 16 deletions publish/ext-cookie.php

This file was deleted.

13 changes: 6 additions & 7 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

declare(strict_types=1);
/**
* This file is part of Hyperf.
* This file is part of hyperf-ext/cookie.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
* @link https://github.com/hyperf-ext/cookie
* @contact eric@zhu.email
* @license https://github.com/hyperf-ext/cookie/blob/master/LICENSE
*/
namespace HyperfExt\Cookie;

Expand All @@ -25,8 +24,8 @@ public function __invoke(): array
[
'id' => 'config',
'description' => 'The config for HyperfExt\Cookie.',
'source' => __DIR__ . '/../publish/ext-cookie.php',
'destination' => BASE_PATH . '/config/autoload/ext-cookie.php',
'source' => __DIR__ . '/../publish/cookie.php',
'destination' => BASE_PATH . '/config/autoload/cookie.php',
],
],
];
Expand Down
9 changes: 4 additions & 5 deletions src/Contract/CookieJarInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

declare(strict_types=1);
/**
* This file is part of Hyperf.
* This file is part of hyperf-ext/cookie.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
* @link https://github.com/hyperf-ext/cookie
* @contact eric@zhu.email
* @license https://github.com/hyperf-ext/cookie/blob/master/LICENSE
*/
namespace HyperfExt\Cookie\Contract;

Expand Down
9 changes: 4 additions & 5 deletions src/CookieJar.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

declare(strict_types=1);
/**
* This file is part of Hyperf.
* This file is part of hyperf-ext/cookie.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
* @link https://github.com/hyperf-ext/cookie
* @contact eric@zhu.email
* @license https://github.com/hyperf-ext/cookie/blob/master/LICENSE
*/
namespace HyperfExt\Cookie;

Expand Down
11 changes: 5 additions & 6 deletions src/CookieJarProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

declare(strict_types=1);
/**
* This file is part of Hyperf.
* This file is part of hyperf-ext/cookie.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
* @link https://github.com/hyperf-ext/cookie
* @contact eric@zhu.email
* @license https://github.com/hyperf-ext/cookie/blob/master/LICENSE
*/
namespace HyperfExt\Cookie;

Expand Down Expand Up @@ -67,7 +66,7 @@ protected function getCookieJar(): CookieJarInterface
{
if (! Context::has(CookieJarInterface::class)) {
$cookieJar = new CookieJar();
$config = $this->config->get('ext-cookie', []);
$config = $this->config->get('cookie', []);
$cookieJar->setDefaultPathAndDomain(
$config['path'] ?? '/',
$config['domain'] ?? '',
Expand Down
9 changes: 4 additions & 5 deletions src/CookieValuePrefix.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

declare(strict_types=1);
/**
* This file is part of Hyperf.
* This file is part of hyperf-ext/cookie.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
* @link https://github.com/hyperf-ext/cookie
* @contact eric@zhu.email
* @license https://github.com/hyperf-ext/cookie/blob/master/LICENSE
*/
namespace HyperfExt\Cookie;

Expand Down
9 changes: 4 additions & 5 deletions src/Middleware/EncryptCookieMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

declare(strict_types=1);
/**
* This file is part of Hyperf.
* This file is part of hyperf-ext/cookie.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
* @link https://github.com/hyperf-ext/cookie
* @contact eric@zhu.email
* @license https://github.com/hyperf-ext/cookie/blob/master/LICENSE
*/
namespace HyperfExt\Cookie\Middleware;

Expand Down
9 changes: 4 additions & 5 deletions src/Middleware/QueuedCookieMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

declare(strict_types=1);
/**
* This file is part of Hyperf.
* This file is part of hyperf-ext/cookie.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
* @link https://github.com/hyperf-ext/cookie
* @contact eric@zhu.email
* @license https://github.com/hyperf-ext/cookie/blob/master/LICENSE
*/
namespace HyperfExt\Cookie\Middleware;

Expand Down
9 changes: 4 additions & 5 deletions tests/CookieTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

declare(strict_types=1);
/**
* This file is part of Hyperf.
* This file is part of hyperf-ext/cookie.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
* @link https://github.com/hyperf-ext/cookie
* @contact eric@zhu.email
* @license https://github.com/hyperf-ext/cookie/blob/master/LICENSE
*/
namespace HyperfTest;

Expand Down
9 changes: 4 additions & 5 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

declare(strict_types=1);
/**
* This file is part of Hyperf.
* This file is part of hyperf-ext/cookie.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
* @link https://github.com/hyperf-ext/cookie
* @contact eric@zhu.email
* @license https://github.com/hyperf-ext/cookie/blob/master/LICENSE
*/
require_once dirname(dirname(__FILE__)) . '/vendor/autoload.php';

0 comments on commit b959dfe

Please sign in to comment.