Showing 27 of 27 total issues
Avoid unused parameters such as '$model'. Open
Open
static::saved(function ($model) use ($entities) {
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid assigning values to variables in if clauses and the like (line '40', column '45'). Open
Open
public function handle(Entity $entity): void
{
$this->trash = $entity->getEntityAttributeValueTrash();
// Wrap the whole process inside database transaction
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '31', column '21'). Open
Open
public function handle(Entity $entity): void
{
// We will initially check if the model is using soft deletes. If so,
// the attribute values will remain untouched as they should sill
// be available till the entity is truly deleted from database.
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
TODO found Open
Open
// @TODO: This is REALLY REALLY BAD DESIGN!! But can't figure out a better way for now!!
- Create a ticketCreate a ticket
- Exclude checks
TODO found Open
Open
$table->integer('entity_id')->unsigned()->nullable(); // TODO: Making this nullable for now as it breaks the basic features
- Create a ticketCreate a ticket
- Exclude checks
TODO found Open
Open
// @TODO: because when RelationBuilder::build is called very early
- Create a ticketCreate a ticket
- Exclude checks
TODO found Open
Open
// @TODO: because when RelationBuilder::build is called very early
- Create a ticketCreate a ticket
- Exclude checks