1- <?php namespace PA \ProvinceTh \Provider ;
1+ <?php
2+
3+ namespace PA \ProvinceTh \Provider ;
24
35use PA \ProvinceTh \Support \Collection ;
46
5- abstract class ProviderCollection extends Collection {
7+ abstract class ProviderCollection extends Collection
8+ {
69
710 /**
811 * @return array
@@ -37,10 +40,10 @@ public function find($id)
3740 */
3841 public function each (callable $ callback )
3942 {
40- foreach ($ this ->getItems () as $ key => $ value ) {
43+ foreach ($ this ->getItems () as $ key => $ value ) {
4144 $ callbackResult = $ callback (new static ($ value ), $ key );
4245
43- if ($ callbackResult === false ) {
46+ if ($ callbackResult === false ) {
4447 break ;
4548 }
4649 }
@@ -63,13 +66,13 @@ public function getPrimaryKey()
6366 */
6467 protected function hasMany ($ provider , $ foreignKey = null )
6568 {
66- if ($ this ->itemIsObject ()) {
69+ if ($ this ->itemIsObject ()) {
6770 $ this ->setItems ([$ this ->getItems ()]);
6871 }
6972
7073 $ provider = new $ provider ();
7174
72- if (is_null ($ foreignKey )) {
75+ if (is_null ($ foreignKey )) {
7376 $ foreignKey = strtolower ($ this ->getClassName ($ this )) . '_id ' ;
7477 }
7578
@@ -84,13 +87,13 @@ protected function hasMany($provider, $foreignKey = null)
8487 */
8588 protected function belongsTo ($ provider , $ localForeignKey = null )
8689 {
87- if ($ this ->itemIsObject ()) {
90+ if ($ this ->itemIsObject ()) {
8891 $ this ->setItems ([$ this ->getItems ()]);
8992 }
9093
9194 $ provider = new $ provider ();
9295
93- if (is_null ($ localForeignKey )) {
96+ if (is_null ($ localForeignKey )) {
9497 $ localForeignKey = strtolower ($ this ->getClassName ($ provider )) . '_id ' ;
9598 }
9699
@@ -113,4 +116,4 @@ private function itemIsObject()
113116 {
114117 return isset ($ this ->getItems ()[$ this ->getPrimaryKey ()]);
115118 }
116- }
119+ }
0 commit comments