-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed response formatting feature. #661
- Loading branch information
Showing
18 changed files
with
293 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the overtrue/wechat. | ||
* | ||
* (c) overtrue <[email protected]> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace EasyWeChat\Kernel\Contracts; | ||
|
||
use ArrayAccess; | ||
|
||
/** | ||
* Interface Arrayable. | ||
* | ||
* @author overtrue <[email protected]> | ||
*/ | ||
interface Arrayable extends ArrayAccess | ||
{ | ||
/** | ||
* Get the instance as an array. | ||
* | ||
* @return array | ||
*/ | ||
public function toArray(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the overtrue/wechat. | ||
* | ||
* (c) overtrue <[email protected]> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace EasyWeChat\Kernel\Support; | ||
|
||
use ArrayAccess; | ||
use ArrayIterator; | ||
use EasyWeChat\Kernel\Contracts\Arrayable; | ||
use IteratorAggregate; | ||
|
||
/** | ||
* Class ArrayAccessible. | ||
* | ||
* @author overtrue <[email protected]> | ||
*/ | ||
class ArrayAccessible implements ArrayAccess, IteratorAggregate, Arrayable | ||
{ | ||
private $array; | ||
|
||
public function __construct(array $array = []) | ||
{ | ||
$this->array = $array; | ||
} | ||
|
||
public function offsetExists($offset) | ||
{ | ||
return array_key_exists($offset, $this->array); | ||
} | ||
|
||
public function offsetGet($offset) | ||
{ | ||
return $this->array[$offset]; | ||
} | ||
|
||
public function offsetSet($offset, $value) | ||
{ | ||
if (null === $offset) { | ||
$this->array[] = $value; | ||
} else { | ||
$this->array[$offset] = $value; | ||
} | ||
} | ||
|
||
public function offsetUnset($offset) | ||
{ | ||
unset($this->array[$offset]); | ||
} | ||
|
||
public function getIterator() | ||
{ | ||
return new ArrayIterator($this->array); | ||
} | ||
|
||
public function toArray() | ||
{ | ||
return $this->array; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.