From 12d34a9dc5ca4158e9c5c89e8714a24e50fdb9cd Mon Sep 17 00:00:00 2001 From: Abdellah Chadidi Date: Sun, 28 Jun 2020 05:20:03 +0100 Subject: [PATCH] Implement array access methods and fix code style --- src/Models/Translation.php | 8 +++++++- src/Translator.php | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Models/Translation.php b/src/Models/Translation.php index c2f1053..0249cec 100644 --- a/src/Models/Translation.php +++ b/src/Models/Translation.php @@ -8,5 +8,11 @@ class Translation extends Model { protected $table = 'translations'; - protected $fillable = ['table_name', 'column_name', 'foreign_key', 'locale', 'value']; + protected $fillable = [ + 'table_name', + 'column_name', + 'foreign_key', + 'locale', + 'value', + ]; } diff --git a/src/Translator.php b/src/Translator.php index 2fab3bc..e824190 100644 --- a/src/Translator.php +++ b/src/Translator.php @@ -175,12 +175,12 @@ public function __set($name, $value) $this->attributes[$name]['modified'] = true; } - public function getOffset($offset) + public function offsetGet($offset) { return $this->attributes[$offset]['value']; } - public function setOffset($offset, $value) + public function offsetSet($offset, $value) { $this->attributes[$offset]['value'] = $value; @@ -196,7 +196,7 @@ public function offsetExists($offset) return isset($this->attributes[$offset]); } - public function unsetOffset($offset) + public function offsetUnset($offset) { unset($this->attributes[$offset]); }