-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #371 from thephpleague/docs
Documentation Improvements
- Loading branch information
Showing
26 changed files
with
71 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014 Scott Robertson <[email protected]> | ||
Copyright (c) 2014 Graham Campbell <[email protected]> | ||
Copyright (c) 2014 Scott Robertson <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,13 @@ | |
"homepage": "http://factory-muffin.thephpleague.com/", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Scott Robertson", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Graham Campbell", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Scott Robertson", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,17 +19,17 @@ | |
* | ||
* This class contains some array helpers we use internally. | ||
* | ||
* @author Scott Robertson <[email protected]> | ||
* @author Graham Campbell <[email protected]> | ||
* @author Scott Robertson <[email protected]> | ||
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT | ||
*/ | ||
class Arr | ||
{ | ||
/** | ||
* Get an item from an array. | ||
* | ||
* @param array $array | ||
* @param string $key | ||
* @param array $array The array to get the item from. | ||
* @param string $key The index the item is located at. | ||
* | ||
* @return mixed | ||
*/ | ||
|
@@ -43,8 +43,8 @@ public static function get(&$array, $key) | |
/** | ||
* Is the item in the array. | ||
* | ||
* @param array $array | ||
* @param mixed $item | ||
* @param array $array The array to search. | ||
* @param mixed $item The item to search for. | ||
* | ||
* @return bool | ||
*/ | ||
|
@@ -56,8 +56,8 @@ public static function has(&$array, $item) | |
/** | ||
* Add an object to an array. | ||
* | ||
* @param array $array | ||
* @param object $object | ||
* @param array $array The array to add to. | ||
* @param object $object The object to add. | ||
* | ||
* @return void | ||
*/ | ||
|
@@ -69,9 +69,9 @@ public static function add(&$array, $object) | |
/** | ||
* Move an object to another array. | ||
* | ||
* @param array $old | ||
* @param array $new | ||
* @param object $object | ||
* @param array $old The old array. | ||
* @param array $new The new array. | ||
* @param object $object The object to move. | ||
* | ||
* @return void | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,8 @@ | |
/** | ||
* This is the model definition class. | ||
* | ||
* @author Scott Robertson <[email protected]> | ||
* @author Graham Campbell <[email protected]> | ||
* @author Scott Robertson <[email protected]> | ||
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT | ||
*/ | ||
class Definition | ||
|
@@ -83,9 +83,9 @@ public function getClass() | |
/** | ||
* Set the model group. | ||
* | ||
* @param string|null $group | ||
* @param string|null $group The model group. | ||
* | ||
* @return $this | ||
* @return \League\FactoryMuffin\Definition | ||
*/ | ||
public function setGroup($group) | ||
{ | ||
|
@@ -107,9 +107,9 @@ public function getGroup() | |
/** | ||
* Set the maker. | ||
* | ||
* @param callable $maker | ||
* @param callable $maker The maker. | ||
* | ||
* @return $this | ||
* @return \League\FactoryMuffin\Definition | ||
*/ | ||
public function setMaker(callable $maker) | ||
{ | ||
|
@@ -121,7 +121,7 @@ public function setMaker(callable $maker) | |
/** | ||
* Clear the maker. | ||
* | ||
* @return $this | ||
* @return \League\FactoryMuffin\Definition | ||
*/ | ||
public function clearMaker() | ||
{ | ||
|
@@ -143,9 +143,9 @@ public function getMaker() | |
/** | ||
* Set the callback. | ||
* | ||
* @param callable $callback | ||
* @param callable $callback The callback. | ||
* | ||
* @return $this | ||
* @return \League\FactoryMuffin\Definition | ||
*/ | ||
public function setCallback(callable $callback) | ||
{ | ||
|
@@ -157,7 +157,7 @@ public function setCallback(callable $callback) | |
/** | ||
* Clear the callback. | ||
* | ||
* @return $this | ||
* @return \League\FactoryMuffin\Definition | ||
*/ | ||
public function clearCallback() | ||
{ | ||
|
@@ -181,10 +181,10 @@ public function getCallback() | |
* | ||
* Note that we're appending to the original attribute definitions here. | ||
* | ||
* @param string $attribute | ||
* @param string|callable $definition | ||
* @param string $attribute The attribute name. | ||
* @param string|callable $definition The attribute definition. | ||
* | ||
* @return $this | ||
* @return \League\FactoryMuffin\Definition | ||
*/ | ||
public function addDefinition($attribute, $definition) | ||
{ | ||
|
@@ -199,9 +199,9 @@ public function addDefinition($attribute, $definition) | |
* Note that we're appending to the original attribute definitions here | ||
* instead of switching them out for the new ones. | ||
* | ||
* @param array $definitions | ||
* @param array $definitions The attribute definitions. | ||
* | ||
* @return $this | ||
* @return \League\FactoryMuffin\Definition | ||
*/ | ||
public function setDefinitions(array $definitions = []) | ||
{ | ||
|
@@ -213,7 +213,7 @@ public function setDefinitions(array $definitions = []) | |
/** | ||
* Clear the attribute definitions. | ||
* | ||
* @return $this | ||
* @return \League\FactoryMuffin\Definition | ||
*/ | ||
public function clearDefinitions() | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,8 @@ | |
* loose comparison. This class extends ModelException, so you may want to try | ||
* to catch that exception instead, if you want to be more general. | ||
* | ||
* @author Scott Robertson <[email protected]> | ||
* @author Graham Campbell <[email protected]> | ||
* @author Scott Robertson <[email protected]> | ||
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT | ||
*/ | ||
class DeleteFailedException extends ModelException | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,8 @@ | |
* extends MethodNotFoundException and ModelException, so you may want to try | ||
* to catch one of those exceptions instead, if you want to be more general. | ||
* | ||
* @author Scott Robertson <[email protected]> | ||
* @author Graham Campbell <[email protected]> | ||
* @author Scott Robertson <[email protected]> | ||
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT | ||
*/ | ||
class DeleteMethodNotFoundException extends MethodNotFoundException | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,14 +25,14 @@ | |
* underlying exception, in the order they were thrown during the whole | ||
* process, by calling getExceptions to return an array of exceptions. | ||
* | ||
* @author Scott Robertson <[email protected]> | ||
* @author Graham Campbell <[email protected]> | ||
* @author Scott Robertson <[email protected]> | ||
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT | ||
*/ | ||
class DeletingFailedException extends Exception | ||
{ | ||
/** | ||
* The array of exceptions. | ||
* The array of caught exceptions. | ||
* | ||
* @var \Exception[] | ||
*/ | ||
|
@@ -77,7 +77,7 @@ private function plural($word, $count) | |
} | ||
|
||
/** | ||
* Get the array of exceptions. | ||
* Get the array of caught exceptions. | ||
* | ||
* @return \Exception[] | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,8 +22,8 @@ | |
* This is thrown if you try to load model definitions from a directory that | ||
* doesn't exit. | ||
* | ||
* @author Scott Robertson <[email protected]> | ||
* @author Graham Campbell <[email protected]> | ||
* @author Scott Robertson <[email protected]> | ||
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT | ||
*/ | ||
class DirectoryNotFoundException extends Exception | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,14 +20,14 @@ | |
* This exception is never directly thrown, but you may try to catch this | ||
* exception rather than the 2 other exceptions that extend this class. | ||
* | ||
* @author Scott Robertson <[email protected]> | ||
* @author Graham Campbell <[email protected]> | ||
* @author Scott Robertson <[email protected]> | ||
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT | ||
*/ | ||
class MethodNotFoundException extends ModelException | ||
{ | ||
/** | ||
* The method. | ||
* The method name. | ||
* | ||
* @var string | ||
*/ | ||
|
@@ -50,7 +50,7 @@ public function __construct($class, $method, $message) | |
} | ||
|
||
/** | ||
* Get the method. | ||
* Get the method name. | ||
* | ||
* @return string | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,8 @@ | |
* definitions first. This class extends ModelException, so you may want to try | ||
* to catch that exception instead, if you want to be more general. | ||
* | ||
* @author Scott Robertson <[email protected]> | ||
* @author Graham Campbell <[email protected]> | ||
* @author Scott Robertson <[email protected]> | ||
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT | ||
*/ | ||
class MissingDefinitionException extends ModelException | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,8 @@ | |
* was not found. This class extends ModelException, so you may want to try to | ||
* catch that exception instead, if you want to be more general. | ||
* | ||
* @author Scott Robertson <[email protected]> | ||
* @author Graham Campbell <[email protected]> | ||
* @author Scott Robertson <[email protected]> | ||
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT | ||
*/ | ||
class MissingModelException extends ModelException | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,14 +22,14 @@ | |
* This exception is never directly thrown, but you may try to catch this | ||
* exception rather than the many other exceptions that extend this class. | ||
* | ||
* @author Scott Robertson <[email protected]> | ||
* @author Graham Campbell <[email protected]> | ||
* @author Scott Robertson <[email protected]> | ||
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT | ||
*/ | ||
class ModelException extends Exception | ||
{ | ||
/** | ||
* The model. | ||
* The model class name. | ||
* | ||
* @var string | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,16 +21,16 @@ | |
* loose comparison. This class extends ModelException, so you may want to try | ||
* to catch that exception instead, if you want to be more general. | ||
* | ||
* @author Scott Robertson <[email protected]> | ||
* @author Graham Campbell <[email protected]> | ||
* @author Scott Robertson <[email protected]> | ||
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT | ||
*/ | ||
class SaveFailedException extends ModelException | ||
{ | ||
/** | ||
* The validation errors. | ||
* | ||
* @var string | ||
* @var string|null | ||
*/ | ||
private $validationErrors; | ||
|
||
|
@@ -86,7 +86,7 @@ private function formatErrors($errors) | |
/** | ||
* Get the validation errors. | ||
* | ||
* @return string | ||
* @return string|null | ||
*/ | ||
public function getValidationErrors() | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,8 @@ | |
* extends MethodNotFoundException and ModelException, so you may want to try | ||
* to catch one of those exceptions instead, if you want to be more general. | ||
* | ||
* @author Scott Robertson <[email protected]> | ||
* @author Graham Campbell <[email protected]> | ||
* @author Scott Robertson <[email protected]> | ||
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT | ||
*/ | ||
class SaveMethodNotFoundException extends MethodNotFoundException | ||
|
Oops, something went wrong.