Completed
Push — master ( f9521c...a16a3a )
by Roni
02:17
created

Traits/EntityHydrationMethod.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/*
4
 * This file is part of the XiideaEasyAuditBundle package.
5
 *
6
 * (c) Xiidea <http://www.xiidea.net>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Xiidea\EasyAuditBundle\Traits;
13
14
trait  EntityHydrationMethod
0 ignored issues
show
Expected 1 space between trait keyword and trait name; 2 found
Loading history...
15
{
16
    public function fromArray($data = array())
17
    {
18
        foreach ($data as $property => $value) {
19
            $method = sprintf('set%s', ucwords($property));
20
            $this->$method($value);
21
        }
22
23
        return $this;
24
    }
25
}
26