Skip to content

Commit

Permalink
Reflection: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
krausv committed Feb 20, 2016
1 parent 3381817 commit 72525f5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea/
.idea/
README.md
35 changes: 35 additions & 0 deletions src/Reflection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* This file is part of the krausv/permissions-panel
*
* Copyright (c) 2016 Vaclav Kraus ([email protected])
*
* For the full copyright and license information, please view the file license.txt that was distributed with this
* source code.
*/

namespace Krausv\PermissionsPanel;


class Reflection extends \ReflectionClass
{
private $object;

public function __construct($object)
{
parent::__construct($object);
$this->object = $object;
}

/**
* @param $property
* @return mixed
*/
public function getPropertyValue($property)
{
$reflection = $this->getProperty($property);
$reflection->setAccessible(true);

return $reflection->getValue($this->object);
}
}

0 comments on commit 72525f5

Please sign in to comment.