Failed Conditions
Pull Request — master (#26)
by Bob Olde
07:33
created

src/models/Result.php (1 issue)

Labels
Severity

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
namespace NerdsAndCompany\Schematic\Models;
4
5
use Craft\BaseModel as Base;
6
7
/**
8
 * Schematic Result Model.
9
 *
10
 * Encapsulates the result of an action, including error messages.
11
 *
12
 * @author    Nerds & Company
13
 * @copyright Copyright (c) 2015, Nerds & Company
14
 * @license   MIT
15
 *
16
 * @link      http://www.nerds.company
17
 */
18
class Result extends Base
19
{
20
    /**
21
     * Consumes the errors listed in an existing result and appends them to this result.
22
     *
23
     * @param Result $result The result to consume.
24
     */
25
    public function consume(Result $result)
26
    {
27
        if ($result->hasErrors('errors')) {
28
            $this->addErrors(['errors' => $result->getErrors('errors']));
0 ignored issues
show
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected ']', expecting ',' or ')'
Loading history...
29
        }
30
    }
31
}
32