Skip to content
This repository was archived by the owner on Jun 11, 2020. It is now read-only.

Commit 03640a5

Browse files
committed
bug fixed for class import error
1 parent a1049b8 commit 03640a5

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

src/Configurable.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: inhere
5+
* Date: 2018/5/2
6+
* Time: 上午10:12
7+
*/
8+
9+
namespace Toolkit\ObjUtil;
10+
11+
use Toolkit\ObjUtil\Traits\PropertyAccessByGetterSetterTrait;
12+
13+
/**
14+
* Class Configurable
15+
* @package Toolkit\ObjUtil
16+
*/
17+
class Configurable
18+
{
19+
use PropertyAccessByGetterSetterTrait;
20+
21+
/**
22+
* Configurable constructor.
23+
* @param array $config
24+
*/
25+
public function __construct(array $config = [])
26+
{
27+
if ($config) {
28+
Obj::init($this, $config);
29+
}
30+
31+
$this->init();
32+
}
33+
34+
/**
35+
* init
36+
*/
37+
protected function init()
38+
{
39+
// init something ...
40+
}
41+
}

src/Traits/ArrayAccessByGetterSetterTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ trait ArrayAccessByGetterSetterTrait
2727
*/
2828
public function offsetExists($offset): bool
2929
{
30-
return property_exists($this, $offset);
30+
return \property_exists($this, $offset);
3131
}
3232

3333
/**

src/Traits/ArrayAccessByPropertyTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ trait ArrayAccessByPropertyTrait
2727
*/
2828
public function offsetExists($offset): bool
2929
{
30-
return property_exists($this, $offset);
30+
return \property_exists($this, $offset);
3131
}
3232

3333
/**

0 commit comments

Comments
 (0)