Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Move directories #789

Merged
merged 1 commit into from
Jul 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"EasyWeChat\\": "src/"
},
"files": [
"src/Support/helpers.php"
"src/Kernel/Support/Helpers.php",
"src/Kernel/Helpers.php"
]
},
"autoload-dev": {
Expand Down
74 changes: 0 additions & 74 deletions src/Applications/OfficialAccount/Application.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* with this source code in the file LICENSE.
*/

namespace EasyWeChat\Applications\BaseService;
namespace EasyWeChat\BaseService;

use EasyWeChat\Kernel\ServiceContainer;

Expand All @@ -18,10 +18,10 @@
*
* @author overtrue <[email protected]>
*
* @property \EasyWeChat\Applications\BaseService\Jssdk\Client $jssdk
* @property \EasyWeChat\Applications\BaseService\Media\Client $media
* @property \EasyWeChat\Applications\BaseService\QrCode\Client $qrcode
* @property \EasyWeChat\Applications\BaseService\Url\Client $url
* @property \EasyWeChat\BaseService\Jssdk\Client $jssdk
* @property \EasyWeChat\BaseService\Media\Client $media
* @property \EasyWeChat\BaseService\QrCode\Client $qrcode
* @property \EasyWeChat\BaseService\Url\Client $url
*/
class Application extends ServiceContainer
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
* with this source code in the file LICENSE.
*/

namespace EasyWeChat\Applications\BaseService\Jssdk;
namespace EasyWeChat\BaseService\Jssdk;

use EasyWeChat\Kernel\BaseClient;
use EasyWeChat\Kernel\Support;
use EasyWeChat\Kernel\Traits\InteractsWithCache;
use EasyWeChat\Support;

/**
* Class Client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* with this source code in the file LICENSE.
*/

namespace EasyWeChat\Applications\BaseService\Jssdk;
namespace EasyWeChat\BaseService\Jssdk;

use Pimple\Container;
use Pimple\ServiceProviderInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
* with this source code in the file LICENSE.
*/

namespace EasyWeChat\Applications\BaseService\Media;
namespace EasyWeChat\BaseService\Media;

use EasyWeChat\Exceptions\InvalidArgumentException;
use EasyWeChat\Http\StreamResponse;
use EasyWeChat\Kernel\BaseClient;
use EasyWeChat\Support\File;
use EasyWeChat\Support\Log;
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
use EasyWeChat\Kernel\Http\StreamResponse;
use EasyWeChat\Kernel\Support\Log;

/**
* Class Client.
Expand All @@ -41,9 +40,9 @@ class Client extends BaseClient
*
* @param $path
*
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Support\Collection|array|object|string
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
*
* @throws \EasyWeChat\Exceptions\InvalidArgumentException
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
*/
public function uploadImage($path)
{
Expand All @@ -55,9 +54,9 @@ public function uploadImage($path)
*
* @param $path
*
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Support\Collection|array|object|string
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
*
* @throws \EasyWeChat\Exceptions\InvalidArgumentException
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
*/
public function uploadVideo($path)
{
Expand All @@ -67,9 +66,9 @@ public function uploadVideo($path)
/**
* @param string $path
*
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Support\Collection|array|object|string
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
*
* @throws \EasyWeChat\Exceptions\InvalidArgumentException
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
*/
public function uploadVoice($path)
{
Expand All @@ -79,9 +78,9 @@ public function uploadVoice($path)
/**
* @param $path
*
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Support\Collection|array|object|string
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
*
* @throws \EasyWeChat\Exceptions\InvalidArgumentException
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
*/
public function uploadThumb($path)
{
Expand All @@ -94,9 +93,9 @@ public function uploadThumb($path)
* @param string $type
* @param string $path
*
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Support\Collection|array|object|string
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
*
* @throws \EasyWeChat\Exceptions\InvalidArgumentException
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
*/
public function upload($type, $path)
{
Expand Down Expand Up @@ -140,9 +139,9 @@ public function download($mediaId, $directory, $filename = '')
*
* @param string $mediaId
*
* @return \EasyWeChat\Http\StreamResponse
* @return \EasyWeChat\Kernel\Http\StreamResponse
*
* @throws \EasyWeChat\Exceptions\RuntimeException
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException
*/
public function getStream($mediaId)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* with this source code in the file LICENSE.
*/

namespace EasyWeChat\Applications\BaseService\Media;
namespace EasyWeChat\BaseService\Media;

use Pimple\Container;
use Pimple\ServiceProviderInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* with this source code in the file LICENSE.
*/

namespace EasyWeChat\Applications\BaseService\QrCode;
namespace EasyWeChat\BaseService\QrCode;

use EasyWeChat\Kernel\BaseClient;

Expand Down Expand Up @@ -37,7 +37,7 @@ class Client extends BaseClient
*
* @param int $sceneValue
*
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Support\Collection|array|object|string
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
*/
public function forever($sceneValue)
{
Expand All @@ -60,7 +60,7 @@ public function forever($sceneValue)
* @param string $sceneId
* @param null $expireSeconds
*
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Support\Collection|array|object|string
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
*/
public function temporary($sceneId, $expireSeconds = null)
{
Expand All @@ -82,7 +82,7 @@ public function temporary($sceneId, $expireSeconds = null)
* "is_unique_code": false , "outer_id" : 1
* }
*
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Support\Collection|array|object|string
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
*/
public function card($card)
{
Expand All @@ -109,7 +109,7 @@ public function url($ticket)
* @param bool $temporary
* @param int $expireSeconds
*
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Support\Collection|array|object|string
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
*/
protected function create($actionName, $actionInfo, $temporary = true, $expireSeconds = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* with this source code in the file LICENSE.
*/

namespace EasyWeChat\Applications\BaseService\QrCode;
namespace EasyWeChat\BaseService\QrCode;

use Pimple\Container;
use Pimple\ServiceProviderInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* with this source code in the file LICENSE.
*/

namespace EasyWeChat\Applications\BaseService\Url;
namespace EasyWeChat\BaseService\Url;

use EasyWeChat\Kernel\BaseClient;

Expand All @@ -30,7 +30,7 @@ class Client extends BaseClient
*
* @param string $url
*
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Support\Collection|array|object|string
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
*/
public function shorten($url)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* with this source code in the file LICENSE.
*/

namespace EasyWeChat\Applications\BaseService\Url;
namespace EasyWeChat\BaseService\Url;

use Pimple\Container;
use Pimple\ServiceProviderInterface;
Expand Down
17 changes: 8 additions & 9 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@

namespace EasyWeChat;

use EasyWeChat\Support\Str;

/**
* Class Factory.
*
* @method static \EasyWeChat\Applications\WeWork\Application weWork(array $config)
* @method static \EasyWeChat\Applications\Payment\Application payment(array $config)
* @method static \EasyWeChat\Applications\MiniProgram\Application miniProgram(array $config)
* @method static \EasyWeChat\Applications\OpenPlatform\Application openPlatform(array $config)
* @method static \EasyWeChat\Applications\OfficialAccount\Application officialAccount(array $config)
* @method static \EasyWeChat\WeWork\Application weWork(array $config)
* @method static \EasyWeChat\Payment\Application payment(array $config)
* @method static \EasyWeChat\MiniProgram\Application miniProgram(array $config)
* @method static \EasyWeChat\OpenPlatform\Application openPlatform(array $config)
* @method static \EasyWeChat\OfficialAccount\Application officialAccount(array $config)
* @method static \EasyWeChat\BaseService\Application baseService(array $config)
*/
class Factory
{
Expand All @@ -32,8 +31,8 @@ class Factory
*/
public static function make($name, array $config)
{
$namespace = Str::studly($name);
$application = "\\EasyWeChat\\Applications\\{$namespace}\\Application";
$namespace = Kernel\Support\Str::studly($name);
$application = "\\EasyWeChat\\{$namespace}\\Application";

return new $application($config);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Kernel/AccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

namespace EasyWeChat\Kernel;

use EasyWeChat\Contracts\AccessToken as AccessTokenInterface;
use EasyWeChat\Exceptions\HttpException;
use EasyWeChat\Kernel\Contracts\AccessToken as AccessTokenInterface;
use EasyWeChat\Kernel\Exceptions\HttpException;
use EasyWeChat\Kernel\Traits\HasAttributes;
use EasyWeChat\Kernel\Traits\InteractsWithCache;
use Pimple\Container;
Expand Down Expand Up @@ -113,7 +113,7 @@ public function setToken(string $token, int $lifetime = 7200): AccessToken
}

/**
* @return \EasyWeChat\Contracts\AccessToken
* @return \EasyWeChat\Kernel\Contracts\AccessToken
*/
public function refresh(): AccessTokenInterface
{
Expand All @@ -127,7 +127,7 @@ public function refresh(): AccessTokenInterface
*
* @return array
*
* @throws \EasyWeChat\Exceptions\HttpException
* @throws \EasyWeChat\Kernel\Exceptions\HttpException
*/
public function requestToken(array $credentials): array
{
Expand Down
Loading