vendor/braintree/braintree_php/lib/Braintree/Instance.php
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace Braintree;
/**
* Braintree Class Instance template
*
* @abstract
*/
abstract class Instance
{
protected $_attributes = [];
// phpcs:ignore PEAR.Commenting.FunctionComment.Missing
public function __construct($attributes)
{
if (!empty($attributes)) {
$this->_initializeFromArray($attributes);
}
}
/**
* returns private/nonexistent instance properties
*
* @param string $name property name
*
* @return mixed contents of instance properties
*/
public function __get($name)
{
if (array_key_exists($name, $this->_attributes)) {
return $this->_attributes[$name];
} else {
trigger_error('Undefined property on ' . get_class($this) . ': ' . $name, E_USER_NOTICE);
return null;
}
}
/**
* used by isset() and empty()
*
* @param string $name property name
*
* @return boolean
*/
public function __isset($name)
{
return isset($this->_attributes[$name]);
}
/**
* create a printable representation of the object as:
* ClassName[property=value, property=value]
*
* @return string
*/
public function __toString()
{
$objOutput = Util::implodeAssociativeArray($this->_attributes);
return get_class($this) . '[' . $objOutput . ']';
后面还有 39 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
