@@ -87,7 +87,7 @@ public function fill( array $attributes ) : ModelInterface {
8787 * @throws RuntimeException
8888 */
8989 public function getAttribute ( string $ key , $ default = null ) {
90- $ this -> validatePropertyExists ( $ key );
90+ static :: validatePropertyExists ( $ key );
9191
9292 return $ this ->attributes [ $ key ] ?? $ default ;
9393 }
@@ -139,6 +139,7 @@ public function isSet( string $key ): bool {
139139 /**
140140 * Check if there is a default value for a property.
141141 *
142+ * @since 2.0.0 changed to static
142143 * @since 1.2.2
143144 *
144145 * @param string $key Property name.
@@ -152,6 +153,7 @@ protected static function hasDefault( string $key ): bool {
152153 /**
153154 * Returns the default value for a property if one is provided, otherwise null.
154155 *
156+ * @since 2.0.0 changed to static
155157 * @since 1.0.0
156158 *
157159 * @param string $key Property name.
@@ -169,6 +171,7 @@ protected static function getPropertyDefault( string $key ) {
169171 /**
170172 * Returns the defaults for all the properties. If a default is omitted it defaults to null.
171173 *
174+ * @since 2.0.0 changed to static
172175 * @since 1.0.0
173176 *
174177 * @return array<string,mixed>
@@ -262,6 +265,7 @@ protected function hasCachedRelationship( string $key ) : bool {
262265 /**
263266 * Determines if the model has the given property.
264267 *
268+ * @since 2.0.0 changed to static
265269 * @since 1.0.0
266270 *
267271 * @param string $key Property name.
@@ -305,6 +309,7 @@ public function isDirty( string $attribute = null ) : bool {
305309 /**
306310 * Validates an attribute to a PHP type.
307311 *
312+ * @since 2.0.0
308313 * @since 1.0.0
309314 *
310315 * @param string $key Property name.
@@ -428,14 +433,15 @@ public function toArray() : array {
428433 /**
429434 * Validates that the given property exists
430435 *
436+ * @since 2.0.0 changed to static
431437 * @since 1.0.0
432438 *
433439 * @param string $key Property name.
434440 *
435441 * @return void
436442 */
437- protected function validatePropertyExists ( string $ key ) {
438- if ( ! $ this -> hasProperty ( $ key ) ) {
443+ protected static function validatePropertyExists ( string $ key ) {
444+ if ( ! static :: hasProperty ( $ key ) ) {
439445 $ exception = Config::getInvalidArgumentException ();
440446 throw new $ exception ( "Invalid property. ' $ key' does not exist. " );
441447 }
@@ -444,6 +450,7 @@ protected function validatePropertyExists( string $key ) {
444450 /**
445451 * Validates that the given value is a valid type for the given property.
446452 *
453+ * @since 2.0.0 changed to static
447454 * @since 1.0.0
448455 *
449456 * @param string $key Property name.
0 commit comments