for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?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\Clauses;
/**
* Class Clause.
* @author mingyoung <[email protected]>
class Clause
{
* @var array
protected $clauses = [
'where' => [],
];
* @param string $key
* @param string $value
* @return $this
public function where(...$args)
array_push($this->clauses['where'], $args);
return $this;
}
* @param mixed $payload
* @return bool
public function intercepted($payload)
return (bool) $this->interceptWhereClause($payload);
protected function interceptWhereClause($payload)
foreach ($this->clauses['where'] as [$key, $value]) {
if (isset($payload[$key]) && $payload[$key] !== $value) {
return true;