1
0
mirror of https://github.com/flarum/core.git synced 2025-10-09 22:16:51 +02:00

Massive refactor

- Use contextual namespaces within Flarum\Core
- Clean up and docblock everything
- Refactor Activity/Notification blueprint stuff
- Refactor Formatter stuff
- Refactor Search stuff
- Upgrade to JSON-API 1.0
- Removed “addedPosts” and “removedPosts” relationships from discussion
API. This was used for adding/removing event posts after renaming a
discussion etc. Instead we should make an additional request to get all
new posts

Todo:
- Fix Extenders and extensions
- Get rid of repository interfaces
- Fix other bugs I’ve inevitably introduced
This commit is contained in:
Toby Zerner
2015-07-04 12:24:48 +09:30
parent 12dd550a14
commit a74b40fe47
324 changed files with 6443 additions and 4197 deletions

View File

@@ -1,19 +1,37 @@
<?php namespace Flarum\Core\Exceptions;
use Exception;
use Illuminate\Support\MessageBag;
use DomainException;
class ValidationFailureException extends \InvalidArgumentException
class ValidationFailureException extends DomainException
{
/**
* @var MessageBag
*/
protected $errors;
/**
* @var array
*/
protected $input = array();
/**
* @param string $message
* @param int $code
* @param Exception $previous
*/
public function __construct($message = '', $code = 0, Exception $previous = null)
{
parent::__construct($message, $code, $previous);
$this->errors = new MessageBag;
}
/**
* @param MessageBag $errors
* @return $this
*/
public function setErrors(MessageBag $errors)
{
$this->errors = $errors;
@@ -21,11 +39,18 @@ class ValidationFailureException extends \InvalidArgumentException
return $this;
}
/**
* @return MessageBag
*/
public function getErrors()
{
return $this->errors;
}
/**
* @param array $input
* @return $this
*/
public function setInput(array $input)
{
$this->input = $input;
@@ -33,6 +58,9 @@ class ValidationFailureException extends \InvalidArgumentException
return $this;
}
/**
* @return array
*/
public function getInput()
{
return $this->input;