File tree 2 files changed +18
-6
lines changed
2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Academe \Laravel \ContextualNotes \Logging ;
4
+
5
+ use Monolog \Logger ;
6
+
7
+ class CreateContextualLogger
8
+ {
9
+ public function __invoke (array $ config )
10
+ {
11
+ return new Logger (...);
12
+ }
13
+ }
Original file line number Diff line number Diff line change 8
8
*/
9
9
10
10
use Illuminate \Database \Eloquent \Model ;
11
+ use Traversable ;
11
12
use Log ;
12
13
13
14
class Note extends Model
@@ -42,7 +43,7 @@ public function models($model)
42
43
* Add this note to a single model.
43
44
*
44
45
* @param Model $model any eloquent mndel
45
- * @return TBC
46
+ * @return bool
46
47
*/
47
48
public function attachModel (Model $ model )
48
49
{
@@ -51,15 +52,13 @@ public function attachModel(Model $model)
51
52
52
53
/**
53
54
* Add this note to a list of models.
54
- * TODO: more flexibility of the types of lists that can be provided, or
55
- * even support varidiac (?) parameters.
56
55
*
57
- * @param array $models eloquent mndels, of the same or different types
56
+ * @param array|Traversable $models eloquent mndels, of the same or different types
58
57
* @return self
59
58
*/
60
59
public function attach ($ models )
61
60
{
62
- if (! is_array ($ models ) && ! $ models instanceof \ Traversable) {
61
+ if (! is_array ($ models ) && ! $ models instanceof Traversable) {
63
62
$ models = [$ models ];
64
63
}
65
64
@@ -91,7 +90,7 @@ public function __call($method, $arguments)
91
90
}
92
91
93
92
/**
94
- * Write a log entry for this note, to the default log.
93
+ * TODO: Write a log entry for this note, to the default log.
95
94
*/
96
95
public function withLog ()
97
96
{
You can’t perform that action at this time.
0 commit comments