for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NovaFlexibleContent\Layouts\LayoutTraits;
use Illuminate\Database\Eloquent\Concerns\HasAttributes;
trait AttributesManipulation
{
use HasAttributes;
/**
* Convert the model instance to an array.
*/
public function toArray(): array
return $this->attributesToArray();
}
public function get($key, $default = null)
$default
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function get($key, /** @scrutinizer ignore-unused */ $default = null)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return $this->getAttribute($key);
* Determine if the given attribute exists.
public function offsetExists(mixed $offset): bool
return !is_null($this->getAttribute($offset));
* Get the value for a given offset.
public function offsetGet(mixed $offset): mixed
return $this->getAttribute($offset);
* Set the value for a given offset.
public function offsetSet(mixed $offset, mixed $value): void
$this->setAttribute($offset, $value);
* Unset the value for a given offset.
public function offsetUnset(mixed $offset): void
unset($this->attributes[$offset]);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.